mirror of
https://github.com/rust-lang/rust.git
synced 2026-03-19 12:43:41 +00:00
use Option::is_some_and
This commit is contained in:
@@ -141,11 +141,10 @@ impl CollapsibleIf {
|
||||
|
||||
// Prevent "elseif"
|
||||
// Check that the "else" is followed by whitespace
|
||||
let requires_space = if let Some(c) = snippet(cx, up_to_else, "..").chars().last() {
|
||||
!c.is_whitespace()
|
||||
} else {
|
||||
false
|
||||
};
|
||||
let requires_space = snippet(cx, up_to_else, "..")
|
||||
.chars()
|
||||
.last()
|
||||
.is_some_and(|c| !c.is_whitespace());
|
||||
let mut applicability = Applicability::MachineApplicable;
|
||||
diag.span_suggestion(
|
||||
else_block.span,
|
||||
|
||||
Reference in New Issue
Block a user