Move BufGuard impl outside of function
This commit is contained in:
parent
1a6b0e410e
commit
d20b1190cf
@ -864,10 +864,12 @@ fn stable_sort<T, F>(v: &mut [T], mut is_less: F)
|
|||||||
where
|
where
|
||||||
F: FnMut(&T, &T) -> bool,
|
F: FnMut(&T, &T) -> bool,
|
||||||
{
|
{
|
||||||
use sort::stable::BufGuard;
|
sort::stable::sort::<T, F, Vec<T>>(v, &mut is_less);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(no_global_oom_handling))]
|
||||||
#[unstable(issue = "none", feature = "std_internals")]
|
#[unstable(issue = "none", feature = "std_internals")]
|
||||||
impl<T> BufGuard<T> for Vec<T> {
|
impl<T> sort::stable::BufGuard<T> for Vec<T> {
|
||||||
fn with_capacity(capacity: usize) -> Self {
|
fn with_capacity(capacity: usize) -> Self {
|
||||||
Vec::with_capacity(capacity)
|
Vec::with_capacity(capacity)
|
||||||
}
|
}
|
||||||
@ -876,6 +878,3 @@ fn as_uninit_slice_mut(&mut self) -> &mut [MaybeUninit<T>] {
|
|||||||
self.spare_capacity_mut()
|
self.spare_capacity_mut()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sort::stable::sort::<T, F, Vec<T>>(v, &mut is_less);
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user