pub fn is_pair_chain(cards: &[Card]) -> bool {
        let mut previous: u32 = 0;

        if cards.len() >= 6 && cards.len() % 2 == 0 {
            for i in (0..cards.len()).step_by(2) {
                if Pair::is_pair(&cards[i..i + 2]) {
                    if previous == 0 {
                        previous = cards[i].value;
                    } else if cards[i].value != previous + 1 {
                        return false;
                    } else {
                        previous = cards[i].value;
                    }
                } else {
                    return false;
                }
            }
            true
        } else {
            false
        }
    }
// cards' value has already sorted in ascending
cards' value has already sorted in ascending
cards ' value has already sorted in ascending
pub fn is_pair_chain(cards: &[Card]) -> bool {
        let mut previous: u32 = 0;
        if cards.len() >= 6 && cards.len() % 2 == 0 {
            for i in (0..cards.len()).step_by(2) {
                if Pair::is_pair(&cards[i..i + 2]) {
                    if previous == 0 {
                        previous = cards[i].value;
                    } else if cards[i].value != previous + 1 {
                        return false;
                    } else {
                        previous = cards[i].value;
                    }
                } else {
                    return false;
                }
            }
            true
        } else {
            false
        }
    }
pub fn is_pair_chain ( cards : & [ Card ] ) -> bool { let mut previous : u32 = 0 ; if cards . len ( ) >= 6 && cards . len ( ) % 2 == 0 { for i in ( 0 .. cards . len ( ) ) . step_by ( 2 ) { if Pair :: is_pair ( & cards [ i .. i + 2 ] ) { if previous == 0 { previous = cards [ i ] . value ; } else if cards [ i ] . value != previous + 1 { return false ; } else { previous = cards [ i ] . value ; } } else { return false ; } } true } else { false } }
cards' value has already sorted in ascending
cards ' value has already sorted in ascending
cards
&[Card]
cards
&[Card]