Function minmax_by_key
const fn minmax_by_key<T, F, K>(v1: T, v2: T, f: F) -> [T; 2]
where
F: ~const FnMut(&T) -> K,
K: ~const Ord
Returns minimum and maximum values with respect to the specified key function.
Returns [v1, v2] if the comparison determines them to be equal.
Examples
use cmp;
assert_eq!;
assert_eq!;
// You can destructure the result using array patterns
let = minmax_by_key;
assert_eq!;
assert_eq!;