/// Returns the microchip that is given by the provided `gift`.
Returns the microchip that is given by the provided `gift`.
Returns the microchip that is given by the provided ` gift ` .
fn given_microchip(&self, gift: Gift, memo: &mut HashMap<Id, Microchip2>) -> Microchip {
            match gift {
                Gift::Input { chip } => chip, // an input bin, easy.
                Gift::Donation { from_robot_id, weight } => {
                    let donator = self.robots.get(&from_robot_id).unwrap();
                    let donator_pair = self.compared_microchips(donator, memo);
                    match weight {
                        MicrochipWeight::Lower  => donator_pair.low,
                        MicrochipWeight::Higher => donator_pair.high,
                    }
                }
            }
        }
fn given_microchip ( & self , gift : Gift , memo : & mut HashMap < Id , Microchip2 > ) -> Microchip { match gift { Gift :: Input { chip } => chip , // an input bin, easy. Gift :: Donation { from_robot_id , weight } => { let donator = self . robots . get ( & from_robot_id ) . unwrap ( ) ; let donator_pair = self . compared_microchips ( donator , memo ) ; match weight { MicrochipWeight :: Lower => donator_pair . low , MicrochipWeight :: Higher => donator_pair . high , } } } }
Returns the microchip that is given by the provided `gift`.
Returns the microchip that is given by the provided ` gift ` .
&self
gift
Gift
memo
&mut HashMap<Id, Microchip2>