fn play(&self) -> Mana {
        let results = SPELLS
            .iter()
            .filter(|&spell| spell.cost() <= self.hero_mana)
            .map(|spell| match self.next_round(spell) {
                Ok(next) => next.play(),
                Err(Outcome::Lose) => Mana::MAX,
                Err(Outcome::Win(cost)) => cost,
            });

        results.min().unwrap_or(Mana::MAX)
    }
/// Play the game to find the cheapest winning scenario
Play the game to find the cheapest winning scenario
Play the game to find the cheapest winning scenario
fn play(&self) -> Mana {
        let results = SPELLS
            .iter()
            .filter(|&spell| spell.cost() <= self.hero_mana)
            .map(|spell| match self.next_round(spell) {
                Ok(next) => next.play(),
                Err(Outcome::Lose) => Mana::MAX,
                Err(Outcome::Win(cost)) => cost,
            });
        results.min().unwrap_or(Mana::MAX)
    }
fn play ( & self ) -> Mana { let results = SPELLS . iter ( ) . filter ( | & spell | spell . cost ( ) <= self . hero_mana ) . map ( | spell | match self . next_round ( spell ) { Ok ( next ) => next . play ( ) , Err ( Outcome :: Lose ) => Mana :: MAX , Err ( Outcome :: Win ( cost ) ) => cost , } ) ; results . min ( ) . unwrap_or ( Mana :: MAX ) }
Play the game to find the cheapest winning scenario
Play the game to find the cheapest winning scenario
&self
&self