use super for macro

This commit is contained in:
2022-12-02 15:30:36 -05:00
parent 8dbc7961b4
commit 85d01d6f4f
2 changed files with 1 additions and 2 deletions
-2
View File
@@ -55,11 +55,9 @@ advent_of_code_macro::solve_problem!(
input.lines().map(|line| line.split(' ').map(|s| s.chars().next().unwrap()).collect()).collect()
},
part one |data: Input| {
use super::Shape;
data.iter().map(|round| Shape::from_char(round[1]).result(&Shape::from_char(round[0]))).sum()
},
part two |data: Input| {
use super::Shape;
data.iter().map(|round| match round[1] {
'X' => Shape::from_char(round[0]).wins_to().as_int(),
'Y' => Shape::from_char(round[0]).as_int() + 3,