pub fn memsearch<T>(s: &[T], val: T) -> Option<usize> where
    T: PartialOrd<T>, 
Expand description

Binary search of an explicitly sorted list (in ascending order). Returns Some(index) of any item that is neither smaller nor greater than val. When none are found, returns None. Example use: membership of an ascending ordered set.