minor: New clippy lints

This commit is contained in:
Lukas Wirth 2025-01-06 11:21:25 +01:00
parent 6725e046df
commit 4b6007115a
92 changed files with 180 additions and 201 deletions

View file

@ -819,7 +819,7 @@ pub fn match_arm_with_guard(
pub fn match_arm_list(arms: impl IntoIterator<Item = ast::MatchArm>) -> ast::MatchArmList {
let arms_str = arms.into_iter().fold(String::new(), |mut acc, arm| {
let needs_comma = arm.expr().map_or(true, |it| !it.is_block_like());
let needs_comma = arm.expr().is_none_or(|it| !it.is_block_like());
let comma = if needs_comma { "," } else { "" };
let arm = arm.syntax();
format_to_acc!(acc, " {arm}{comma}\n")