Skip to content

Commit

Permalink
core: Remove some redundant {}s from the sorting code
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Jan 30, 2022
1 parent 7cc28c1 commit cde240c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/core/src/slice/sort.rs
Expand Up @@ -773,7 +773,7 @@ where
let mid = partition_equal(v, pivot, is_less);

// Continue sorting elements greater than the pivot.
v = &mut { v }[mid..];
v = &mut v[mid..];
continue;
}
}
Expand All @@ -784,7 +784,7 @@ where
was_partitioned = was_p;

// Split the slice into `left`, `pivot`, and `right`.
let (left, right) = { v }.split_at_mut(mid);
let (left, right) = v.split_at_mut(mid);
let (pivot, right) = right.split_at_mut(1);
let pivot = &pivot[0];

Expand Down Expand Up @@ -860,7 +860,7 @@ fn partition_at_index_loop<'a, T, F>(
let (mid, _) = partition(v, pivot, is_less);

// Split the slice into `left`, `pivot`, and `right`.
let (left, right) = { v }.split_at_mut(mid);
let (left, right) = v.split_at_mut(mid);
let (pivot, right) = right.split_at_mut(1);
let pivot = &pivot[0];

Expand Down

0 comments on commit cde240c

Please sign in to comment.