about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorfee1-dead <ent3rm4n@gmail.com>2023-04-16 19:36:02 +0800
committerGitHub <noreply@github.com>2023-04-16 19:36:02 +0800
commitfba49a7ee2da30a34a1cb05efa249e4267879d7e (patch)
tree032e996eba0783cea9763d3002a7bb461cc6a9dd /compiler/rustc_resolve/src
parent508d661105507f40aebf957aa5bdc59095f8f8f4 (diff)
parentbcc15bba953dcb749d88950539b5e206a8bd86bb (diff)
downloadrust-fba49a7ee2da30a34a1cb05efa249e4267879d7e.tar.gz
rust-fba49a7ee2da30a34a1cb05efa249e4267879d7e.zip
Rollup merge of #110398 - matthiaskrgr:clippy_match, r=Nilstrieb,fee1-dead
use matches! macro in more places

r? `@Nilstrieb`
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/diagnostics.rs20
1 files changed, 11 insertions, 9 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs
index 0c9d306081e..c5ec19732be 100644
--- a/compiler/rustc_resolve/src/diagnostics.rs
+++ b/compiler/rustc_resolve/src/diagnostics.rs
@@ -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,
+                                    _,
+                                )
+                            )
                         },
                     );