diff --git a/clippy_lints/src/shadow.rs b/clippy_lints/src/shadow.rs index 1a9717ff53b3..558b3cde3ed5 100644 --- a/clippy_lints/src/shadow.rs +++ b/clippy_lints/src/shadow.rs @@ -123,7 +123,7 @@ impl<'tcx> LateLintPass<'tcx> for Shadow { return; } - if self.skip.len() > 0 && self.skip.last_mut().unwrap().contains(&ident.name) { + if !self.skip.is_empty() && self.skip.last_mut().unwrap().contains(&ident.name) { // skip async function's params return; } @@ -166,10 +166,10 @@ impl<'tcx> LateLintPass<'tcx> for Shadow { if let Some(header) = match kind { FnKind::ItemFn(_, _, header, _) => Some(header), FnKind::Method(_, sig, _) => Some(sig.header), - _ => None, + FnKind::Closure => None, }; if header.asyncness == IsAsync::Async; - if body.params.len() > 0; + if !body.params.is_empty(); then { self.skip.push(FxHashSet::default()); let skip_params = self.skip.last_mut().unwrap(); @@ -195,10 +195,10 @@ impl<'tcx> LateLintPass<'tcx> for Shadow { if let Some(header) = match kind { FnKind::ItemFn(_, _, header, _) => Some(header), FnKind::Method(_, sig, _) => Some(sig.header), - _ => None, + FnKind::Closure => None, }; if header.asyncness == IsAsync::Async; - if body.params.len() > 0; + if !body.params.is_empty(); then { self.skip.pop(); }