Skip to content

Commit

Permalink
Apply review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
weiznich committed Dec 11, 2019
1 parent 089a894 commit ab3f4fd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/librustc_lint/unused.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ab3f4fd

Please sign in to comment.