about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGeorg Semmler <georg_semmler_05@web.de>2019-12-06 15:10:07 +0100
committerGeorg Semmler <georg_semmler_05@web.de>2019-12-06 15:10:07 +0100
commit089a894193c34babe51af62e570d295021c215d6 (patch)
treebe3e73afcd534c1fe717ad3ee015e815f9bf00e2
parent9598cf416dcfba4e15770f57447b3996d1853fc1 (diff)
parentcc4ced88404d417fadb94d706b184f01d6064fbe (diff)
downloadrust-089a894193c34babe51af62e570d295021c215d6.tar.gz
rust-089a894193c34babe51af62e570d295021c215d6.zip
Merge branch 'bugfix/issue_66295' of github.com:weiznich/rust into bugfix/issue_66295
-rw-r--r--src/librustc_lint/unused.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs
index 25c351f6234..ee644acd099 100644
--- a/src/librustc_lint/unused.rs
+++ b/src/librustc_lint/unused.rs
@@ -357,8 +357,7 @@ impl UnusedParens {
                 if !Self::is_expr_parens_necessary(inner, followed_by_block) &&
                     value.attrs.is_empty() &&
                     !MultiSpan::from(value.span).primary_span()
-                        .map(|span| span.from_expansion())
-                        .unwrap_or(false)
+                        .map_or(false, |span| span.from_expansion())
                 {
                     let expr_text = if let Ok(snippet) = cx.sess().source_map()
                         .span_to_snippet(value.span) {