Skip to content

Commit

Permalink
remove uncessary parens in closure body in tools
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukang committed Feb 12, 2025
1 parent c7ec66c commit 5e56316
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/unused_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedAsync {
let iter = self
.unused_async_fns
.iter()
.filter(|UnusedAsyncFn { def_id, .. }| (!self.async_fns_as_value.contains(def_id)));
.filter(|UnusedAsyncFn { def_id, .. }| !self.async_fns_as_value.contains(def_id));

for fun in iter {
span_lint_hir_and_then(
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_utils/src/higher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl<'hir> IfLetOrMatch<'hir> {
if_then,
if_else,
let_span,
}| { Self::IfLet(let_expr, let_pat, if_then, if_else, let_span) },
}| Self::IfLet(let_expr, let_pat, if_then, if_else, let_span),
),
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_utils/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ impl AdtVariantInfo {
.enumerate()
.map(|(i, f)| (i, approx_ty_size(cx, f.ty(cx.tcx, subst))))
.collect::<Vec<_>>();
fields_size.sort_by(|(_, a_size), (_, b_size)| (a_size.cmp(b_size)));
fields_size.sort_by(|(_, a_size), (_, b_size)| a_size.cmp(b_size));

Self {
ind: i,
Expand All @@ -936,7 +936,7 @@ impl AdtVariantInfo {
}
})
.collect::<Vec<_>>();
variants_size.sort_by(|a, b| (b.size.cmp(&a.size)));
variants_size.sort_by(|a, b| b.size.cmp(&a.size));
variants_size
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/concurrency/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ impl<'tcx> ThreadManager<'tcx> {
assert!(
self.threads
.iter()
.all(|thread| { !thread.state.is_blocked_on(BlockReason::Join(joined_thread_id)) }),
.all(|thread| !thread.state.is_blocked_on(BlockReason::Join(joined_thread_id))),
"this thread already has threads waiting for its termination"
);

Expand Down

0 comments on commit 5e56316

Please sign in to comment.