Function minmax_by
const fn minmax_by<T, F>(v1: T, v2: T, compare: F) -> [T; 2]
where
F: ~const FnOnce(&T, &T) -> Ordering
Returns minimum and maximum values with respect to the specified comparison function.
Returns [v1, v2] if the comparison determines them to be equal.
The parameter order is preserved when calling the compare function, i.e. v1 is
always passed as the first argument and v2 as the second.
Examples
use cmp;
let abs_cmp = ;
assert_eq!;
assert_eq!;
assert_eq!;
// You can destructure the result using array patterns
let = minmax_by;
assert_eq!;
assert_eq!;