use matches! macro in more places
This commit is contained in:
parent
e6e956dade
commit
bcc15bba95
13 changed files with 52 additions and 75 deletions
|
@ -663,15 +663,17 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
Ident::with_dummy_span(name),
|
||||
Namespace::ValueNS,
|
||||
&parent_scope,
|
||||
&|res: Res| match res {
|
||||
Res::Def(
|
||||
DefKind::Ctor(CtorOf::Variant, CtorKind::Const)
|
||||
| DefKind::Ctor(CtorOf::Struct, CtorKind::Const)
|
||||
| DefKind::Const
|
||||
| DefKind::AssocConst,
|
||||
_,
|
||||
) => true,
|
||||
_ => false,
|
||||
&|res: Res| {
|
||||
matches!(
|
||||
res,
|
||||
Res::Def(
|
||||
DefKind::Ctor(CtorOf::Variant, CtorKind::Const)
|
||||
| DefKind::Ctor(CtorOf::Struct, CtorKind::Const)
|
||||
| DefKind::Const
|
||||
| DefKind::AssocConst,
|
||||
_,
|
||||
)
|
||||
)
|
||||
},
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue