Skip to content

Commit 042f262

Browse files
authored
Merge pull request #321 from fox0/clippy--while_let_loop
ls: Fix clippy::while_let_loop
2 parents 47bb77f + 44ac87a commit 042f262

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

tree/ls.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -419,20 +419,16 @@ impl Config {
419419
MULTI_COLUMN | STREAM_OUTPUT_FORMAT | MUTI_COLUMN_ACROSS => {
420420
long_format_state.push(false);
421421
}
422-
ONE_ENTRY_PER_LINE => loop {
422+
ONE_ENTRY_PER_LINE => {
423423
// Remove any `false` that was added by -C, -m or -x until
424424
// a `true` is reached or the vec is empty
425-
match long_format_state.last().copied() {
426-
Some(enabled) => {
427-
if enabled {
428-
break;
429-
} else {
430-
long_format_state.pop();
431-
}
425+
while let Some(enabled) = long_format_state.last().copied() {
426+
if enabled {
427+
break;
432428
}
433-
None => break,
429+
long_format_state.pop();
434430
}
435-
},
431+
}
436432
_ => unreachable!(),
437433
}
438434
}

0 commit comments

Comments
 (0)