diff --git a/sixtyfps_compiler/passes/resolving.rs b/sixtyfps_compiler/passes/resolving.rs index 1668bb2e8e0..55e604d6a7a 100644 --- a/sixtyfps_compiler/passes/resolving.rs +++ b/sixtyfps_compiler/passes/resolving.rs @@ -865,7 +865,7 @@ impl Expression { ) }); let mut result = exprs.next().unwrap_or_default(); - while let Some(x) = exprs.next() { + for x in exprs { result = Expression::BinaryExpression { lhs: Box::new(std::mem::take(&mut result)), rhs: Box::new(x), diff --git a/sixtyfps_runtime/corelib/sharedvector.rs b/sixtyfps_runtime/corelib/sharedvector.rs index 53f28ac8557..fbeacf712ac 100644 --- a/sixtyfps_runtime/corelib/sharedvector.rs +++ b/sixtyfps_runtime/corelib/sharedvector.rs @@ -176,8 +176,7 @@ impl SharedVector { let mut new_array = SharedVector::with_capacity(new_capacity); core::mem::swap(&mut self.inner, &mut new_array.inner); let mut size = 0; - let mut iter = new_array.into_iter(); - while let Some(x) = iter.next() { + for x in new_array.into_iter() { assert_ne!(size, new_capacity); unsafe { core::ptr::write(self.inner.as_mut().data.as_mut_ptr().add(size), x); diff --git a/tools/lsp/completion.rs b/tools/lsp/completion.rs index b9a7535d9cf..393f41fee7c 100644 --- a/tools/lsp/completion.rs +++ b/tools/lsp/completion.rs @@ -180,8 +180,7 @@ pub(crate) fn completion_at( let global = sixtyfps_compilerlib::lookup::global_lookup(); let mut expr_it = global.lookup(ctx, &first)?.expression; let mut has_dot = false; - loop { - let t = if let Some(t) = it.next() { t } else { break }; + for t in it { has_dot |= t.kind() == SyntaxKind::Dot; if t.token == token.token { break;