Day 21 some clippy cleanup

This commit is contained in:
Bill Thiede 2021-12-23 19:44:52 -08:00
parent e4e00517f7
commit 2400d34336

View File

@ -94,8 +94,7 @@ fn play_part2(p1: Player, p2: Player) -> (usize, usize) {
for x in [1, 2, 3] { for x in [1, 2, 3] {
for y in [1, 2, 3] { for y in [1, 2, 3] {
for z in [1, 2, 3] { for z in [1, 2, 3] {
let (p1s, p2s) = let (p1s, p2s) = play_part2_rec(p1, p2, i, j, k, x, y, z);
play_part2_rec(p1.clone(), p2.clone(), i, j, k, x, y, z);
p1_score += p1s; p1_score += p1s;
p2_score += p2s; p2_score += p2s;
} }
@ -116,8 +115,7 @@ fn play_part2(p1: Player, p2: Player) -> (usize, usize) {
for x in [1, 2, 3] { for x in [1, 2, 3] {
for y in [1, 2, 3] { for y in [1, 2, 3] {
for z in [1, 2, 3] { for z in [1, 2, 3] {
let (p1s, p2s) = let (p1s, p2s) = play_part2_rec(p1, p2, i, j, k, x, y, z);
play_part2_rec(p1.clone(), p2.clone(), i, j, k, x, y, z);
p1_score += p1s; p1_score += p1s;
p2_score += p2s; p2_score += p2s;
println!("Running score {} vs {}", p1_score, p2_score); println!("Running score {} vs {}", p1_score, p2_score);
@ -132,7 +130,7 @@ fn play_part2(p1: Player, p2: Player) -> (usize, usize) {
//#[aoc(day21, part2)] //#[aoc(day21, part2)]
fn part2(input: &str) -> Result<usize> { fn part2(input: &str) -> Result<usize> {
let mut p: Vec<_> = input let p: Vec<_> = input
.lines() .lines()
.map(|l| l.split_once(": ").unwrap()) .map(|l| l.split_once(": ").unwrap())
.map(|(_, space)| space.parse().expect("couldn't parse starting spaceition")) .map(|(_, space)| space.parse().expect("couldn't parse starting spaceition"))