diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-02-26 23:03:45 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-02-27 14:50:54 +0100 |
| commit | 896a0814427827e0e0346544c92e5ddc390ad29f (patch) | |
| tree | e08fc94df05f381118b230442115bd84edf488e9 /src/librustc_parse/parser/expr.rs | |
| parent | a8437cf213ac1e950b6f5c691c4d2a29bf949bcd (diff) | |
| download | rust-896a0814427827e0e0346544c92e5ddc390ad29f.tar.gz rust-896a0814427827e0e0346544c92e5ddc390ad29f.zip | |
use find(x) instead of filter(x).next()
Diffstat (limited to 'src/librustc_parse/parser/expr.rs')
| -rw-r--r-- | src/librustc_parse/parser/expr.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/librustc_parse/parser/expr.rs b/src/librustc_parse/parser/expr.rs index 3ae97ed5f88..b8f67e73bc3 100644 --- a/src/librustc_parse/parser/expr.rs +++ b/src/librustc_parse/parser/expr.rs @@ -225,12 +225,8 @@ impl<'a> Parser<'a> { // Make sure that the span of the parent node is larger than the span of lhs and rhs, // including the attributes. - let lhs_span = lhs - .attrs - .iter() - .filter(|a| a.style == AttrStyle::Outer) - .next() - .map_or(lhs_span, |a| a.span); + let lhs_span = + lhs.attrs.iter().find(|a| a.style == AttrStyle::Outer).map_or(lhs_span, |a| a.span); let span = lhs_span.to(rhs.span); lhs = match op { AssocOp::Add |
