From cc4ced88404d417fadb94d706b184f01d6064fbe Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Tue, 3 Dec 2019 14:07:45 +0000 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: lzutao --- src/librustc_lint/unused.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs index 25c351f62348..ee644acd0997 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) {