redundant closure call

This commit is contained in:
Folkert 2023-11-18 22:46:40 +01:00
parent 6d55acc5cf
commit 49c2b1dbb7
No known key found for this signature in database
GPG Key ID: 1F17F6FFD112B97C
2 changed files with 8 additions and 3 deletions

View File

@ -1300,17 +1300,21 @@ mod debug_types {
Arg,
}
fn always_true() -> bool {
true
}
macro_rules! maybe_paren {
($paren_if_above:expr, $my_prec:expr, $doc:expr) => {
maybe_paren!($paren_if_above, $my_prec, || true, $doc)
maybe_paren!($paren_if_above, $my_prec, always_true, $doc)
};
($paren_if_above:expr, $my_prec:expr, $extra_cond:expr, $doc:expr) => {
($paren_if_above:expr, $my_prec:expr, $extra_cond:expr, $doc:expr) => {{
if $my_prec > $paren_if_above && $extra_cond() {
$doc.parens().group()
} else {
$doc
}
};
}};
}
fn typ<'a>(

View File

@ -90,6 +90,7 @@ macro_rules! section_impl {
let mut bytes = Vec::<u8>::with_capacity_in(range.len() * 2, arena);
*cursor = range.end;
bytes.extend_from_slice(&module_bytes[range]);
#[allow(clippy::redundant_closure_call)]
Ok($from_count_and_bytes(count, bytes))
}
}