Rollup merge of #74213 - pickfire:patch-1, r=jonas-schievink

Minor refactor for rustc_resolve diagnostics match

Use `matches!` instead of old `if let`
This commit is contained in:
Manish Goregaokar 2020-07-11 08:53:25 -07:00 committed by GitHub
commit 6204a73efa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();