From 673c9299d5b46e6d498db6fa3d30d415ba78adfc Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Sun, 3 Dec 2023 13:13:23 +0100 Subject: [PATCH] day(01): format Signed-off-by: Matej Focko --- src/bin/day01.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/bin/day01.rs b/src/bin/day01.rs index 9988174..5167c35 100644 --- a/src/bin/day01.rs +++ b/src/bin/day01.rs @@ -39,17 +39,13 @@ impl Solution for Day01 { digits.push(d as i32); } - if let Some(d) = NUMBERS - .iter() - .enumerate() - .find_map(|(n, nstr)| { - if line[i..].starts_with(nstr) { - Some(n as i32 + 1) - } else { - None - } - }) - { + if let Some(d) = NUMBERS.iter().enumerate().find_map(|(n, nstr)| { + if line[i..].starts_with(nstr) { + Some(n as i32 + 1) + } else { + None + } + }) { digits.push(d) } }