From ab3f4fd709fc2fcb19cda89305da08d9ae989c47 Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Wed, 11 Dec 2019 10:10:41 +0100 Subject: [PATCH] Apply review suggestions --- src/librustc_lint/unused.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs index ee644acd09974..e6f39cca6dc3a 100644 --- a/src/librustc_lint/unused.rs +++ b/src/librustc_lint/unused.rs @@ -17,7 +17,7 @@ use syntax::print::pprust; use syntax::symbol::{kw, sym}; use syntax::symbol::Symbol; use syntax::util::parser; -use syntax_pos::{MultiSpan, Span, BytePos}; +use syntax_pos::{Span, BytePos}; use log::debug; @@ -356,8 +356,7 @@ impl UnusedParens { ast::ExprKind::Paren(ref inner) => { if !Self::is_expr_parens_necessary(inner, followed_by_block) && value.attrs.is_empty() && - !MultiSpan::from(value.span).primary_span() - .map_or(false, |span| span.from_expansion()) + !value.span.from_expansion() { let expr_text = if let Ok(snippet) = cx.sess().source_map() .span_to_snippet(value.span) {