Skip to content

Commit 4b4d758

Browse files
author
Michael Wright
committed
Fix warnings in clippy_lints
1 parent 2f364d9 commit 4b4d758

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

clippy_lints/src/lifetimes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ fn check_fn_inner<'a, 'tcx>(
103103
}
104104

105105
let mut bounds_lts = Vec::new();
106-
let types = generics.params.iter().filter_map(|param| match param.kind {
107-
GenericParamKind::Type { .. } => Some(param),
108-
GenericParamKind::Lifetime { .. } => None,
106+
let types = generics.params.iter().filter(|param| match param.kind {
107+
GenericParamKind::Type { .. } => true,
108+
GenericParamKind::Lifetime { .. } => false,
109109
});
110110
for typ in types {
111111
for bound in &typ.bounds {

clippy_lints/src/utils/mod.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -682,13 +682,10 @@ impl LimitStack {
682682
}
683683

684684
pub fn get_attr<'a>(attrs: &'a [ast::Attribute], name: &'static str) -> impl Iterator<Item = &'a ast::Attribute> {
685-
attrs.iter().filter_map(move |attr| {
686-
if attr.path.segments.len() == 2 && attr.path.segments[0].ident.to_string() == "clippy" && attr.path.segments[1].ident.to_string() == name {
687-
Some(attr)
688-
} else {
689-
None
690-
}
691-
})
685+
attrs.iter().filter(move |attr|
686+
attr.path.segments.len() == 2 &&
687+
attr.path.segments[0].ident.to_string() == "clippy" &&
688+
attr.path.segments[1].ident.to_string() == name)
692689
}
693690

694691
fn parse_attrs<F: FnMut(u64)>(sess: &Session, attrs: &[ast::Attribute], name: &'static str, mut f: F) {

0 commit comments

Comments
 (0)