Trait std::slice::MutableTotalOrdVector
pub trait MutableTotalOrdVector<T> { fn sort(self); }
Methods for mutable vectors with orderable elements, such as in-place sorting.
Required Methods
fn sort(self)
Sort the vector, in place.
This is equivalent to self.sort_by(|a, b| a.cmp(b))
.
Example
let mut v = [-5, 4, 1, -3, 2]; v.sort(); assert!(v == [-5, -3, 1, 2, 4]);
Implementors
impl<'a, T: TotalOrd> MutableTotalOrdVector<T> for &'a mut [T]