From c51e31917d6608008479f9ffe60a7b8bf607fbc3 Mon Sep 17 00:00:00 2001 From: Thomas Heslin <13917706+tjheslin1@users.noreply.github.com> Date: Mon, 3 Jan 2022 07:19:10 +0000 Subject: [PATCH] Cargo clippy refactor --- 2021/day6/src/fish.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2021/day6/src/fish.rs b/2021/day6/src/fish.rs index dad37d4..fd7293a 100644 --- a/2021/day6/src/fish.rs +++ b/2021/day6/src/fish.rs @@ -33,8 +33,8 @@ pub fn simulate_spawn(input: &str, days_to_simulate: usize) -> u64 { (*spawned_fish).insert(DAYS_TO_CREATE_FISH, new_fish + *curr_count); } - if let Some(_) = (*spawned_fish).get(&NEW_FISH_AGE) { - (*spawned_fish).insert(NEW_FISH_AGE, new_fish /* + *curr_count*/); + if (*spawned_fish).get(&NEW_FISH_AGE).is_some() { + (*spawned_fish).insert(NEW_FISH_AGE, new_fish); } });