Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Remove some redundant {}s from the sorting code #93485

Merged
merged 1 commit into from
Jan 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions library/core/src/slice/sort.rs
Original file line number Diff line number Diff line change
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