We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
str::ends_with
1 parent 43f832d commit 27784f2Copy full SHA for 27784f2
clippy_lints/src/collapsible_if.rs
@@ -141,10 +141,7 @@ impl CollapsibleIf {
141
142
// Prevent "elseif"
143
// Check that the "else" is followed by whitespace
144
- let requires_space = snippet(cx, up_to_else, "..")
145
- .chars()
146
- .last()
147
- .is_some_and(|c| !c.is_whitespace());
+ let requires_space = snippet(cx, up_to_else, "..").ends_with(|c: char| !c.is_whitespace());
148
let mut applicability = Applicability::MachineApplicable;
149
diag.span_suggestion(
150
else_block.span,
0 commit comments