pub fn minmax<I, T>(vals: I) -> Option<(T, T)> where
    I: Iterator<Item = T>,
    T: Copy + Ord