diff --git a/clippy_lints/src/inherent_impl.rs b/clippy_lints/src/inherent_impl.rs index a78811c31..9c4a6bfcb 100644 --- a/clippy_lints/src/inherent_impl.rs +++ b/clippy_lints/src/inherent_impl.rs @@ -78,8 +78,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass { let mut impl_spans = impls .iter() .filter_map(|impl_def| self.impls.get(impl_def)) - .filter(|(_, generics)| generics.params.len() == 0) - .map(|(span, _)| span); + .filter_map(|(span, generics)| if generics.params.len() == 0 { + Some(span) + } else { + None + }); if let Some(initial_span) = impl_spans.nth(0) { impl_spans.for_each(|additional_span| { span_lint_and_then( diff --git a/src/driver.rs b/src/driver.rs index 267e460ad..e85f61e34 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -78,8 +78,11 @@ pub fn main() { args.extend( extra_args .split("__CLIPPY_HACKERY__") - .filter(|s| !s.is_empty()) - .map(str::to_owned), + .filter_map(|s| if s.is_empty() { + None + } else { + Some(s.to_string()) + }) ); } }