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.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide_ssr/src/matching.rs b/crates/ide_ssr/src/matching.rs
index 004bbeec5b..6812947218 100644
--- a/crates/ide_ssr/src/matching.rs
+++ b/crates/ide_ssr/src/matching.rs
@@ -462,7 +462,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
let mut last_matched_token = child;
// Read code tokens util we reach one equal to the next token from our pattern
// or we reach the end of the token tree.
- while let Some(next) = children.next() {
+ for next in &mut children {
match &next {
SyntaxElement::Token(t) => {
if Some(t.to_string()) == next_pattern_token {
@@ -763,7 +763,7 @@ impl Iterator for PatternIterator {
type Item = SyntaxElement;
fn next(&mut self) -> Option<SyntaxElement> {
- while let Some(element) = self.iter.next() {
+ for element in &mut self.iter {
if !element.kind().is_trivia() {
return Some(element);
}