manual_find

This commit is contained in:
Johann Hemmann 2024-01-19 14:01:37 +01:00
parent 2a500d5280
commit 60dda08266
2 changed files with 1 additions and 7 deletions

View file

@ -182,7 +182,6 @@ get_first = "allow"
if_same_then_else = "allow"
large_enum_variant = "allow"
let_and_return = "allow"
manual_find = "allow"
manual_map = "allow"
map_clone = "allow"
match_like_matches_macro = "allow"

View file

@ -764,12 +764,7 @@ impl Iterator for PatternIterator {
type Item = SyntaxElement;
fn next(&mut self) -> Option<SyntaxElement> {
for element in &mut self.iter {
if !element.kind().is_trivia() {
return Some(element);
}
}
None
(&mut self.iter).find(|element| !element.kind().is_trivia())
}
}