mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 00:24:03 +00:00
Minor refactor for rustc_resolve diagnostics match
Use `matches!` instead of old `if let`
This commit is contained in:
parent
e59b08e62e
commit
1fb0ed0e2c
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user