Skip to content

Commit 5e56316

Browse files
committed
remove uncessary parens in closure body in tools
1 parent c7ec66c commit 5e56316

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/tools/clippy/clippy_lints/src/unused_async.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedAsync {
165165
let iter = self
166166
.unused_async_fns
167167
.iter()
168-
.filter(|UnusedAsyncFn { def_id, .. }| (!self.async_fns_as_value.contains(def_id)));
168+
.filter(|UnusedAsyncFn { def_id, .. }| !self.async_fns_as_value.contains(def_id));
169169

170170
for fun in iter {
171171
span_lint_hir_and_then(

src/tools/clippy/clippy_utils/src/higher.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl<'hir> IfLetOrMatch<'hir> {
172172
if_then,
173173
if_else,
174174
let_span,
175-
}| { Self::IfLet(let_expr, let_pat, if_then, if_else, let_span) },
175+
}| Self::IfLet(let_expr, let_pat, if_then, if_else, let_span),
176176
),
177177
}
178178
}

src/tools/clippy/clippy_utils/src/ty/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ impl AdtVariantInfo {
927927
.enumerate()
928928
.map(|(i, f)| (i, approx_ty_size(cx, f.ty(cx.tcx, subst))))
929929
.collect::<Vec<_>>();
930-
fields_size.sort_by(|(_, a_size), (_, b_size)| (a_size.cmp(b_size)));
930+
fields_size.sort_by(|(_, a_size), (_, b_size)| a_size.cmp(b_size));
931931

932932
Self {
933933
ind: i,
@@ -936,7 +936,7 @@ impl AdtVariantInfo {
936936
}
937937
})
938938
.collect::<Vec<_>>();
939-
variants_size.sort_by(|a, b| (b.size.cmp(&a.size)));
939+
variants_size.sort_by(|a, b| b.size.cmp(&a.size));
940940
variants_size
941941
}
942942
}

src/tools/miri/src/concurrency/thread.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ impl<'tcx> ThreadManager<'tcx> {
641641
assert!(
642642
self.threads
643643
.iter()
644-
.all(|thread| { !thread.state.is_blocked_on(BlockReason::Join(joined_thread_id)) }),
644+
.all(|thread| !thread.state.is_blocked_on(BlockReason::Join(joined_thread_id))),
645645
"this thread already has threads waiting for its termination"
646646
);
647647

0 commit comments

Comments
 (0)