Move BufGuard impl outside of function

This commit is contained in:
Lukas Bergdoll 2024-04-16 20:59:17 +02:00
parent 1a6b0e410e
commit d20b1190cf

View File

@ -864,10 +864,12 @@ fn stable_sort<T, F>(v: &mut [T], mut is_less: F)
where
F: FnMut(&T, &T) -> bool,
{
use sort::stable::BufGuard;
sort::stable::sort::<T, F, Vec<T>>(v, &mut is_less);
}
#[unstable(issue = "none", feature = "std_internals")]
impl<T> BufGuard<T> for Vec<T> {
#[cfg(not(no_global_oom_handling))]
#[unstable(issue = "none", feature = "std_internals")]
impl<T> sort::stable::BufGuard<T> for Vec<T> {
fn with_capacity(capacity: usize) -> Self {
Vec::with_capacity(capacity)
}
@ -875,7 +877,4 @@ fn with_capacity(capacity: usize) -> Self {
fn as_uninit_slice_mut(&mut self) -> &mut [MaybeUninit<T>] {
self.spare_capacity_mut()
}
}
sort::stable::sort::<T, F, Vec<T>>(v, &mut is_less);
}