Skip to content

Commit

Permalink
Janitor: Fix clippy::while_let_on_iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
hunger authored and tronical committed Aug 9, 2021
1 parent ce30f9b commit bac4d89
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sixtyfps_compiler/passes/resolving.rs
Expand Up @@ -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),
Expand Down
3 changes: 1 addition & 2 deletions sixtyfps_runtime/corelib/sharedvector.rs
Expand Up @@ -176,8 +176,7 @@ impl<T: Clone> SharedVector<T> {
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);
Expand Down
3 changes: 1 addition & 2 deletions tools/lsp/completion.rs
Expand Up @@ -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;
Expand Down

0 comments on commit bac4d89

Please sign in to comment.