Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-ssr/src/matching.rs')
| -rw-r--r-- | crates/ide-ssr/src/matching.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/crates/ide-ssr/src/matching.rs b/crates/ide-ssr/src/matching.rs index 66cb14451f..3e6b2d4dd9 100644 --- a/crates/ide-ssr/src/matching.rs +++ b/crates/ide-ssr/src/matching.rs @@ -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()) } } |