Skip to content

Commit ab55454

Browse files
Review suggestion - WorkerResult matching in sort - src/walk.rs
Co-authored-by: Thayne McCombs <astrothayne@gmail.com>
1 parent ba9cb06 commit ab55454

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/walk.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -677,14 +677,14 @@ impl WorkerState {
677677
fn sort_worker_results(results: &mut [WorkerResult], sort_key: SortKey) {
678678
results.sort_by(|a, b| {
679679
// Errors sort to the end; two errors are considered equal
680-
let (WorkerResult::Entry(a), WorkerResult::Entry(b)) = (a, b) else {
681-
return match (a, b) {
682-
(WorkerResult::Error(_), WorkerResult::Entry(_)) => std::cmp::Ordering::Greater,
683-
(WorkerResult::Entry(_), WorkerResult::Error(_)) => std::cmp::Ordering::Less,
684-
_ => std::cmp::Ordering::Equal,
685-
};
680+
let (a, b) = match (a, b) {
681+
(WorkerResult::Entry(a), WorkerResult::Entry(b)) => (a, b)
682+
(WorkerResult::Error(_), WorkerResult::Entry(_)) => return std::cmp::Ordering::Greater,
683+
(WorkerResult::Entry(_), WorkerResult::Error(_)) => return std::cmp::Ordering::Less,
684+
_ => return std::cmp::Ordering::Equal,
686685
};
687686

687+
688688
match sort_key {
689689
SortKey::Path => a.path().cmp(b.path()),
690690
SortKey::Size => {

0 commit comments

Comments
 (0)