Function find_streak

Source
fn find_streak<T, F>(v: &[T], is_less: &F) -> (usize, bool)
where F: Fn(&T, &T) -> bool,
Expand description

Finds a streak of presorted elements starting at the beginning of the slice. Returns the first value that is not part of said streak, and a bool denoting whether the streak was reversed. Streaks can be increasing or decreasing.