Skip to content

Commit c7ec66c

Browse files
committed
remove uncessary parens in closure body
1 parent ccdf053 commit c7ec66c

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

Diff for: compiler/rustc_errors/src/emitter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3449,7 +3449,7 @@ pub fn is_case_difference(sm: &SourceMap, suggested: &str, sp: Span) -> bool {
34493449
// All the chars that differ in capitalization are confusable (above):
34503450
let confusable = iter::zip(found.chars(), suggested.chars())
34513451
.filter(|(f, s)| f != s)
3452-
.all(|(f, s)| (ascii_confusables.contains(&f) || ascii_confusables.contains(&s)));
3452+
.all(|(f, s)| ascii_confusables.contains(&f) || ascii_confusables.contains(&s));
34533453
confusable && found.to_lowercase() == suggested.to_lowercase()
34543454
// FIXME: We sometimes suggest the same thing we already have, which is a
34553455
// bug, but be defensive against that here.

Diff for: compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl<'a, Node: Idx> SpantreeBuilder<'a, Node> {
261261
debug_assert!(
262262
span_edges
263263
.iter_enumerated()
264-
.all(|(node, span_edge)| { span_edge.is_some() <= self.is_supernode(node) }),
264+
.all(|(node, span_edge)| span_edge.is_some() <= self.is_supernode(node)),
265265
"only supernodes can have a span edge",
266266
);
267267
debug_assert!(

Diff for: compiler/rustc_mir_transform/src/coverage/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fn create_mappings(extracted_mappings: &ExtractedMappings) -> Vec<Mapping> {
160160
condition_info: _,
161161
true_index: _,
162162
false_index: _,
163-
}| { Mapping { kind: MappingKind::Branch { true_bcb, false_bcb }, span } },
163+
}| Mapping { kind: MappingKind::Branch { true_bcb, false_bcb }, span },
164164
));
165165

166166
for (decision, branches) in mcdc_mappings {

Diff for: compiler/rustc_parse/src/parser/item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2189,7 +2189,7 @@ impl<'a> Parser<'a> {
21892189

21902190
if self.look_ahead(1, |t| *t == token::Not) && self.look_ahead(2, |t| t.is_ident()) {
21912191
return IsMacroRulesItem::Yes { has_bang: true };
2192-
} else if self.look_ahead(1, |t| (t.is_ident())) {
2192+
} else if self.look_ahead(1, |t| t.is_ident()) {
21932193
// macro_rules foo
21942194
self.dcx().emit_err(errors::MacroRulesMissingBang {
21952195
span: macro_rules_span,

Diff for: compiler/rustc_resolve/src/late/diagnostics.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,7 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
326326
let module_did = mod_prefix.as_ref().and_then(Res::mod_def_id);
327327

328328
let mod_prefix =
329-
mod_prefix.map_or_else(String::new, |res| (format!("{} ", res.descr())));
330-
329+
mod_prefix.map_or_else(String::new, |res| format!("{} ", res.descr()));
331330
(mod_prefix, format!("`{}`", Segment::names_to_string(mod_path)), module_did, None)
332331
};
333332

Diff for: src/librustdoc/html/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ impl clean::FnDecl {
14401440
fmt::from_fn(move |f| {
14411441
// First, generate the text form of the declaration, with no line wrapping, and count the bytes.
14421442
let mut counter = WriteCounter(0);
1443-
write!(&mut counter, "{:#}", fmt::from_fn(|f| { self.inner_full_print(None, f, cx) }))
1443+
write!(&mut counter, "{:#}", fmt::from_fn(|f| self.inner_full_print(None, f, cx)))
14441444
.unwrap();
14451445
// If the text form was over 80 characters wide, we will line-wrap our output.
14461446
let line_wrapping_indent =

0 commit comments

Comments
 (0)