Skip to content

Commit b9529d7

Browse files
committed
edit for clippy check
1 parent 03114bb commit b9529d7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clippy_lints/src/shadow.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl<'tcx> LateLintPass<'tcx> for Shadow {
123123
return;
124124
}
125125

126-
if self.skip.len() > 0 && self.skip.last_mut().unwrap().contains(&ident.name) {
126+
if !self.skip.is_empty() && self.skip.last_mut().unwrap().contains(&ident.name) {
127127
// skip async function's params
128128
return;
129129
}
@@ -166,10 +166,10 @@ impl<'tcx> LateLintPass<'tcx> for Shadow {
166166
if let Some(header) = match kind {
167167
FnKind::ItemFn(_, _, header, _) => Some(header),
168168
FnKind::Method(_, sig, _) => Some(sig.header),
169-
_ => None,
169+
FnKind::Closure => None,
170170
};
171171
if header.asyncness == IsAsync::Async;
172-
if body.params.len() > 0;
172+
if !body.params.is_empty();
173173
then {
174174
self.skip.push(FxHashSet::default());
175175
let skip_params = self.skip.last_mut().unwrap();
@@ -195,10 +195,10 @@ impl<'tcx> LateLintPass<'tcx> for Shadow {
195195
if let Some(header) = match kind {
196196
FnKind::ItemFn(_, _, header, _) => Some(header),
197197
FnKind::Method(_, sig, _) => Some(sig.header),
198-
_ => None,
198+
FnKind::Closure => None,
199199
};
200200
if header.asyncness == IsAsync::Async;
201-
if body.params.len() > 0;
201+
if !body.params.is_empty();
202202
then {
203203
self.skip.pop();
204204
}

0 commit comments

Comments
 (0)