pub fn max_value<T: PartialOrd>(xs: &[T]) -> Option<&T>Expand description
Maximum value in a slice. Returns None for an empty slice.
ยงExamples
use mathverse_core::ops::max_value;
assert_eq!(max_value(&[3, 1, 4, 1, 5]), Some(&5));
assert_eq!(max_value::<i32>(&[]), None);