diff --git a/clippy_lints/src/lifetimes.rs b/clippy_lints/src/lifetimes.rs index ee8517b76..62e308bb5 100644 --- a/clippy_lints/src/lifetimes.rs +++ b/clippy_lints/src/lifetimes.rs @@ -103,9 +103,9 @@ fn check_fn_inner<'a, 'tcx>( } let mut bounds_lts = Vec::new(); - let types = generics.params.iter().filter_map(|param| match param.kind { - GenericParamKind::Type { .. } => Some(param), - GenericParamKind::Lifetime { .. } => None, + let types = generics.params.iter().filter(|param| match param.kind { + GenericParamKind::Type { .. } => true, + GenericParamKind::Lifetime { .. } => false, }); for typ in types { for bound in &typ.bounds { diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index 856fa8056..0011065db 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -682,13 +682,10 @@ impl LimitStack { } pub fn get_attr<'a>(attrs: &'a [ast::Attribute], name: &'static str) -> impl Iterator { - attrs.iter().filter_map(move |attr| { - if attr.path.segments.len() == 2 && attr.path.segments[0].ident.to_string() == "clippy" && attr.path.segments[1].ident.to_string() == name { - Some(attr) - } else { - None - } - }) + attrs.iter().filter(move |attr| + attr.path.segments.len() == 2 && + attr.path.segments[0].ident.to_string() == "clippy" && + attr.path.segments[1].ident.to_string() == name) } fn parse_attrs(sess: &Session, attrs: &[ast::Attribute], name: &'static str, mut f: F) {