From d98b6799671e33a44adc35f651b6d45577747e79 Mon Sep 17 00:00:00 2001 From: attila Date: Mon, 3 Dec 2018 20:33:35 +0100 Subject: [PATCH] Bugfix for day2 --- day2/src/main.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/day2/src/main.rs b/day2/src/main.rs index 2ecf125..5f6b8a0 100644 --- a/day2/src/main.rs +++ b/day2/src/main.rs @@ -52,8 +52,6 @@ fn find_common_letters(lines: &Vec<&str>) -> Result , 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 = line.chars().collect(); let candidate2: Vec = line2.chars().collect(); @@ -65,7 +63,7 @@ fn find_common_letters(lines: &Vec<&str>) -> Result , std::io::Error> } } - return Ok(test); + return Ok(result); } } }