Bugfix for day2

This commit is contained in:
attila 2018-12-03 20:33:35 +01:00
parent f5ab8bba97
commit d98b679967

View File

@ -52,8 +52,6 @@ fn find_common_letters(lines: &Vec<&str>) -> Result<Vec<char> , std::io::Error>
let mismatches = line.chars().zip(line2.chars()).filter(|&(a, b)| a != b).count();
if mismatches == 1 {
let result: Vec<(char,char)> = line.chars().zip(line2.chars()).filter(|&(a, b)| a == b).collect();
let candidate1: Vec<char> = line.chars().collect();
let candidate2: Vec<char> = line2.chars().collect();
@ -65,7 +63,7 @@ fn find_common_letters(lines: &Vec<&str>) -> Result<Vec<char> , std::io::Error>
}
}
return Ok(test);
return Ok(result);
}
}
}