Created
January 8, 2016 05:24
-
-
Save ryanmr/94926129d8eb958f1622 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn rank_reason(criteria: &mut HashMap<&str, bool>) -> String { | |
let reason; | |
let passes = rank_passes(criteria); | |
if passes == 0 { | |
reason = "none".to_string(); | |
} else { | |
let mut ss = Vec::new(); | |
for (&k, &v) in criteria.iter() { | |
if v { | |
ss.push(k.clone()); | |
} | |
} | |
let joined = ss.join(" | "); | |
reason = joined.to_string(); | |
} | |
return reason; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment