Skip to content

Commit

Permalink
Rollup merge of rust-lang#74213 - pickfire:patch-1, r=jonas-schievink
Browse files Browse the repository at this point in the history
Minor refactor for rustc_resolve diagnostics match

Use `matches!` instead of old `if let`
  • Loading branch information
Manishearth authored Jul 11, 2020
2 parents 1bd03b2 + 1fb0ed0 commit 2e95d26
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/librustc_resolve/late/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ impl<'a> LateResolutionVisitor<'a, '_, '_> {
let ident_span = path.last().map_or(span, |ident| ident.ident.span);
let ns = source.namespace();
let is_expected = &|res| source.is_expected(res);
let is_enum_variant = &|res| {
if let Res::Def(DefKind::Variant, _) = res { true } else { false }
};
let is_enum_variant = &|res| matches!(res, Res::Def(DefKind::Variant, _));

// Make the base error.
let expected = source.descr_expected();
Expand Down

0 comments on commit 2e95d26

Please sign in to comment.