summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorecstatic-morse <ecstaticmorse@gmail.com>2020-09-21 20:40:55 -0700
committerGitHub <noreply@github.com>2020-09-21 20:40:55 -0700
commitdcf4d1f2beefa7bebdbfb31e4774cefa901928b7 (patch)
tree4432dd5d81aa59585c17d4585facccd99335d15b /compiler/rustc_resolve/src
parent60b99015e95e5840a8f409d1042f1e3458d2c7dd (diff)
parentc690c82ad42a15417996a087ef072fd2d8c2fe3a (diff)
downloadrust-dcf4d1f2beefa7bebdbfb31e4774cefa901928b7.tar.gz
rust-dcf4d1f2beefa7bebdbfb31e4774cefa901928b7.zip
Rollup merge of #76888 - matthiaskrgr:clippy_single_match_2, r=Dylan-DPC
use if let instead of single match arm expressions

use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match)
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/lib.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs
index 85ddc5f55d1..677cf27cde7 100644
--- a/compiler/rustc_resolve/src/lib.rs
+++ b/compiler/rustc_resolve/src/lib.rs
@@ -534,11 +534,8 @@ impl<'a> ModuleData<'a> {
                 if ns != TypeNS {
                     return;
                 }
-                match binding.res() {
-                    Res::Def(DefKind::Trait | DefKind::TraitAlias, _) => {
-                        collected_traits.push((name, binding))
-                    }
-                    _ => (),
+                if let Res::Def(DefKind::Trait | DefKind::TraitAlias, _) = binding.res() {
+                    collected_traits.push((name, binding))
                 }
             });
             *traits = Some(collected_traits.into_boxed_slice());