[][src]Function bisection::insort_left_slice_by

pub fn insort_left_slice_by<T, I, F>(a: &mut Vec<T>, x: T, within: I, f: F) where
    I: RangeBounds<usize>,
    F: FnMut(&T, &T) -> Ordering

Insert x in a[within], keeping it sorted, assuming a is sorted, according to a comparator function.

The comparator function should implement an order consistent with the sort order of the underlying slice.

If a contains x, insert it just before the leftmost occurence of x.

Panics

Panics if within is out of bounds of a.