Skip to content

Commit 60dda08

Browse files
committed
manual_find
1 parent 2a500d5 commit 60dda08

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ get_first = "allow"
182182
if_same_then_else = "allow"
183183
large_enum_variant = "allow"
184184
let_and_return = "allow"
185-
manual_find = "allow"
186185
manual_map = "allow"
187186
map_clone = "allow"
188187
match_like_matches_macro = "allow"

crates/ide-ssr/src/matching.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -764,12 +764,7 @@ impl Iterator for PatternIterator {
764764
type Item = SyntaxElement;
765765

766766
fn next(&mut self) -> Option<SyntaxElement> {
767-
for element in &mut self.iter {
768-
if !element.kind().is_trivia() {
769-
return Some(element);
770-
}
771-
}
772-
None
767+
(&mut self.iter).find(|element| !element.kind().is_trivia())
773768
}
774769
}
775770

0 commit comments

Comments
 (0)