pub fn call_and_replace(&mut self, arg: U) -> V {
        let new_val = (self.calculation)(arg);
        self.values.insert(arg, new_val);
        new_val
    }
/// Calls the function without performing a lookup and replaces
/// the old return value with the new one, and returns it.
/// Potentially useful if the function reads from a file or RNG
/// whose state may have changed.
// TODO: if there's state, FnMut seems more appropriate.
Calls the function without performing a lookup and replaces
the old return value with the new one, and returns it.
Potentially useful if the function reads from a file or RNG
whose state may have changed.
TODO: if there's state, FnMut seems more appropriate.
Calls the function without performing a lookup and replaces the old return value with the new one and returns it . Potentially useful if the function reads from a file or RNG whose state may have changed . TODO : if there ' s state FnMut seems more appropriate .
pub fn call_and_replace(&mut self, arg: U) -> V {
        let new_val = (self.calculation)(arg);
        self.values.insert(arg, new_val);
        new_val
    }
pub fn call_and_replace ( & mut self , arg : U ) -> V { let new_val = ( self . calculation ) ( arg ) ; self . values . insert ( arg , new_val ) ; new_val }
Calls the function without performing a lookup and replaces
the old return value with the new one, and returns it.
Calls the function without performing a lookup and replaces the old return value with the new one and returns it .
&mut self
arg
U