Skip to content

Commit

Permalink
edit for clippy check
Browse files Browse the repository at this point in the history
  • Loading branch information
surechen committed Nov 19, 2021
1 parent 03114bb commit b9529d7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions clippy_lints/src/shadow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
Expand All @@ -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();
}
Expand Down

0 comments on commit b9529d7

Please sign in to comment.