// Updates statistics from other if the same type, otherwise a noop
Updates statistics from other if the same type, otherwise a noop
Updates statistics from other if the same type otherwise a noop
pub fn update_from(&mut self, other: &Self) {
        match (&mut self.stats, &other.stats) {
            (Statistics::F64(s), Statistics::F64(o)) => {
                s.update_from(o);
            }
            (Statistics::I64(s), Statistics::I64(o)) => {
                s.update_from(o);
            }
            (Statistics::Bool(s), Statistics::Bool(o)) => {
                s.update_from(o);
            }
            (Statistics::String(s), Statistics::String(o)) => {
                s.update_from(o);
            }
            (Statistics::U64(s), Statistics::U64(o)) => {
                s.update_from(o);
            }
            // do catch alls for the specific types, that way if a new type gets added, the compiler
            // will complain.
            (Statistics::F64(_), _) => unreachable!(),
            (Statistics::I64(_), _) => unreachable!(),
            (Statistics::U64(_), _) => unreachable!(),
            (Statistics::Bool(_), _) => unreachable!(),
            (Statistics::String(_), _) => unreachable!(),
        }
    }
pub fn update_from ( & mut self , other : & Self ) { match ( & mut self . stats , & other . stats ) { ( Statistics :: F64 ( s ) , Statistics :: F64 ( o ) ) => { s . update_from ( o ) ; } ( Statistics :: I64 ( s ) , Statistics :: I64 ( o ) ) => { s . update_from ( o ) ; } ( Statistics :: Bool ( s ) , Statistics :: Bool ( o ) ) => { s . update_from ( o ) ; } ( Statistics :: String ( s ) , Statistics :: String ( o ) ) => { s . update_from ( o ) ; } ( Statistics :: U64 ( s ) , Statistics :: U64 ( o ) ) => { s . update_from ( o ) ; } // do catch alls for the specific types, that way if a new type gets added, the compiler // will complain. ( Statistics :: F64 ( _ ) , _ ) => unreachable ! ( ) , ( Statistics :: I64 ( _ ) , _ ) => unreachable ! ( ) , ( Statistics :: U64 ( _ ) , _ ) => unreachable ! ( ) , ( Statistics :: Bool ( _ ) , _ ) => unreachable ! ( ) , ( Statistics :: String ( _ ) , _ ) => unreachable ! ( ) , } }
Updates statistics from other if the same type, otherwise a noop
Updates statistics from other if the same type otherwise a noop
&mut self
other
&Self