fn count_cards(&self) -> HashMap<Card, u16> {
        let mut res = HashMap::<Card, u16>::new();
        
        for card in &self.0 {
            if res.contains_key(card) {
                *res.get_mut(card).unwrap() += 1;
            } else {
                res.insert(card.clone(), 1);
            }
        }
        
        res
    }
/// count the numbers of cards of each type and return them as a hashmap
count the numbers of cards of each type and return them as a hashmap
count the numbers of cards of each type and return them as a hashmap
fn count_cards(&self) -> HashMap<Card, u16> {
        let mut res = HashMap::<Card, u16>::new();
        for card in &self.0 {
            if res.contains_key(card) {
                *res.get_mut(card).unwrap() += 1;
            } else {
                res.insert(card.clone(), 1);
            }
        }
        res
    }
fn count_cards ( & self ) -> HashMap < Card , u16 > { let mut res = HashMap :: < Card , u16 > :: new ( ) ; for card in & self . 0 { if res . contains_key ( card ) { * res . get_mut ( card ) . unwrap ( ) += 1 ; } else { res . insert ( card . clone ( ) , 1 ) ; } } res }
count the numbers of cards of each type and return them as a hashmap
count the numbers of cards of each type and return them as a hashmap
&self
&self