use cards::Card;

// All these functions need sorted vectors of Cards
pub fn has_pair<'r>(card_vec: &'r Vec<&Card>) -> Option<&'r Card> {
    has_set(2, card_vec)
}

fn has_set<'r>(set_size: u8, card_vec: &'r Vec<&Card>) -> Option<&'r Card> {
    let mut prev: &&Card = match card_vec.last() {
        Some(x) => x,
        None => return None
    };

    let mut count: u8 = 1;
    for card in card_vec.iter().rev().skip(1) {
        if card == prev {
            count += 1;
            if count == set_size {
                return Some(*prev)
            }
            continue;
        }
        prev = card;
        count = 1;
    }
    None
}


use cards::Card;

// All these functions need reverse sorted vectors of Cards
pub fn has_pair(card_vec: &Vec<&Card>) -> bool {
    has_set(2, card_vec)
}

fn has_set(set_size: u8, card_vec: &Vec<&Card>) -> bool {
    let mut prev: &Card = card_vec[0];
    let mut count: u8 = 1;
    for card in card_vec.iter().skip(1) {
        if *card == prev {
            count += 1;
            if count == set_size {
                return true
            }
            continue;
        }
        prev = *card;
        count = 1;
    }
    false
}

--- 
+++ 
@@ -1,28 +1,23 @@
 use cards::Card;
 
-// All these functions need sorted vectors of Cards
-pub fn has_pair<'r>(card_vec: &'r Vec<&Card>) -> Option<&'r Card> {
+// All these functions need reverse sorted vectors of Cards
+pub fn has_pair(card_vec: &Vec<&Card>) -> bool {
     has_set(2, card_vec)
 }
 
-fn has_set<'r>(set_size: u8, card_vec: &'r Vec<&Card>) -> Option<&'r Card> {
-    let mut prev: &&Card = match card_vec.last() {
-        Some(x) => x,
-        None => return None
-    };
-
+fn has_set(set_size: u8, card_vec: &Vec<&Card>) -> bool {
+    let mut prev: &Card = card_vec[0];
     let mut count: u8 = 1;
-    for card in card_vec.iter().rev().skip(1) {
-        if card == prev {
+    for card in card_vec.iter().skip(1) {
+        if *card == prev {
             count += 1;
             if count == set_size {
-                return Some(*prev)
+                return true
             }
             continue;
         }
-        prev = card;
+        prev = *card;
         count = 1;
     }
-    None
+    false
 }
-
Change has_set to return an option with the found set
