Function quick_sort::sort_by [] [src]

pub fn sort_by<T, F>(arr: &mut [T], compare: &F) where T: PartialOrd, F: Fn(&T, &T) -> Ordering

Example

let mut numbers = vec![12, 2, -9, -45, 0, 67];
quick_sort::sort_by(numbers.as_mut_slice(), &|a, b| b.cmp(a));