pub fn update<U: ?Sized>(&mut self, other: &U)
    where
        T: Borrow<U>,
        U: ToOwned<Owned = T> + PartialOrd + IsNan,
    {
        self.count += 1;

        if !other.is_nan() {
            match &self.min {
                None => self.min = Some(other.to_owned()),
                Some(s) => {
                    if s.borrow() > other {
                        self.min = Some(other.to_owned());
                    }
                }
            }

            match &self.max {
                None => {
                    self.max = Some(other.to_owned());
                }
                Some(s) => {
                    if other > s.borrow() {
                        self.max = Some(other.to_owned());
                    }
                }
            }
        }
    }
/// updates the statistics keeping the min, max and incrementing count.
///
/// The type plumbing exists to allow calling with &str on a StatValues<String>
updates the statistics keeping the min, max and incrementing count.
The type plumbing exists to allow calling with &str on a StatValues
updates the statistics keeping the min max and incrementing count . The type plumbing exists to allow calling with &str on a StatValues
pub fn update<U: ?Sized>(&mut self, other: &U)
    where
        T: Borrow<U>,
        U: ToOwned<Owned = T> + PartialOrd + IsNan,
    {
        self.count += 1;
        if !other.is_nan() {
            match &self.min {
                None => self.min = Some(other.to_owned()),
                Some(s) => {
                    if s.borrow() > other {
                        self.min = Some(other.to_owned());
                    }
                }
            }
            match &self.max {
                None => {
                    self.max = Some(other.to_owned());
                }
                Some(s) => {
                    if other > s.borrow() {
                        self.max = Some(other.to_owned());
                    }
                }
            }
        }
    }
pub fn update < U : ? Sized > ( & mut self , other : & U ) where T : Borrow < U > , U : ToOwned < Owned = T > + PartialOrd + IsNan , { self . count += 1 ; if ! other . is_nan ( ) { match & self . min { None => self . min = Some ( other . to_owned ( ) ) , Some ( s ) => { if s . borrow ( ) > other { self . min = Some ( other . to_owned ( ) ) ; } } } match & self . max { None => { self . max = Some ( other . to_owned ( ) ) ; } Some ( s ) => { if other > s . borrow ( ) { self . max = Some ( other . to_owned ( ) ) ; } } } } }
updates the statistics keeping the min, max and incrementing count.
updates the statistics keeping the min max and incrementing count .
&mut self
other
&U
&mut self
other
&U