[rust] Day 5.0 refactoring

wip
Alpha Chen 9 years ago
parent 3e2cbb4454
commit 3aa6c39c1e

@ -21,12 +21,7 @@ impl Day05 {
}
fn has_double_letters(string: &String) -> bool {
for win in string.as_bytes().windows(2) {
if win[0] == win[1] {
return true;
}
}
false
string.as_bytes().windows(2).any(|win| win[0] == win[1])
}
fn has_no_substrings(string: &String) -> bool {

Loading…
Cancel
Save