about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-12-11 19:13:16 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-12-11 23:02:19 +0100
commitcf10a0abf23850018b32ed9a15b1bce6a1e71c93 (patch)
tree925915165d73c1b42e9e877838a46f094851498e
parent5833f74a9cd2316dae030155a36c16bcc7805da5 (diff)
downloadrust-cf10a0abf23850018b32ed9a15b1bce6a1e71c93.tar.gz
rust-cf10a0abf23850018b32ed9a15b1bce6a1e71c93.zip
fix clippy::unnecessary_filter_map
-rw-r--r--compiler/rustc_builtin_macros/src/deriving/generic/mod.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs
index a767de53dae..68c11868af8 100644
--- a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs
+++ b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs
@@ -597,10 +597,7 @@ impl<'a> TraitDef<'a> {
 
             let mut ty_params = params
                 .iter()
-                .filter_map(|param| match param.kind {
-                    ast::GenericParamKind::Type { .. } => Some(param),
-                    _ => None,
-                })
+                .filter(|param| matches!(param.kind,  ast::GenericParamKind::Type{..}))
                 .peekable();
 
             if ty_params.peek().is_some() {