/// An attempt to get n cards from the deck wrapped in a Vec. There might not be enough.
An attempt to get n cards from the deck wrapped in a Vec. There might not be enough.
An attempt to get n cards from the deck wrapped in a Vec . There might not be enough .
pub fn draw_n(&mut self, n: usize) -> Result<Vec<Card>, DeckError> {
        if self.count_dealt + n > 52 {
            Err(DeckError::NotEnoughCards)
        } else {
            let mut cards = Vec::new();
            for _ in 0..n {
                cards.push(self.draw().ok().unwrap());
            }
            Ok(cards)
        }
    }
pub fn draw_n ( & mut self , n : usize ) -> Result < Vec < Card > , DeckError > { if self . count_dealt + n > 52 { Err ( DeckError :: NotEnoughCards ) } else { let mut cards = Vec :: new ( ) ; for _ in 0 .. n { cards . push ( self . draw ( ) . ok ( ) . unwrap ( ) ) ; } Ok ( cards ) } }
An attempt to get n cards from the deck wrapped in a Vec.
An attempt to get n cards from the deck wrapped in a Vec .
&mut self
n
usize