2022 rust day 2

This commit is contained in:
Maciej Jur 2022-12-02 10:29:37 +01:00
parent 5b38020265
commit 00d244377d

View file

@ -1,3 +1,4 @@
#![allow(dead_code)]
use crate::utils; use crate::utils;
@ -103,7 +104,7 @@ fn solve1(data: &Vec<(char, char)>) -> i32 {
}) })
} }
fn solve2(data: &Vec<(char, char)>) -> impl std::fmt::Display { fn solve2(data: &Vec<(char, char)>) -> i32 {
data.iter() data.iter()
.fold(0, |acc, (other, result)| { .fold(0, |acc, (other, result)| {
let result = MatchResult::from(result); let result = MatchResult::from(result);