Rollup merge of #93485 - est31:remove_curly, r=joshtriplett

core: Remove some redundant {}s from the sorting code
This commit is contained in:
Matthias Krüger 2022-01-31 07:00:46 +01:00 committed by GitHub
commit 24737bd1ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -773,7 +773,7 @@ where
let mid = partition_equal(v, pivot, is_less); let mid = partition_equal(v, pivot, is_less);
// Continue sorting elements greater than the pivot. // Continue sorting elements greater than the pivot.
v = &mut { v }[mid..]; v = &mut v[mid..];
continue; continue;
} }
} }
@ -784,7 +784,7 @@ where
was_partitioned = was_p; was_partitioned = was_p;
// Split the slice into `left`, `pivot`, and `right`. // 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, right) = right.split_at_mut(1);
let pivot = &pivot[0]; let pivot = &pivot[0];
@ -860,7 +860,7 @@ fn partition_at_index_loop<'a, T, F>(
let (mid, _) = partition(v, pivot, is_less); let (mid, _) = partition(v, pivot, is_less);
// Split the slice into `left`, `pivot`, and `right`. // 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, right) = right.split_at_mut(1);
let pivot = &pivot[0]; let pivot = &pivot[0];