From fcca447b5894ed2a96f71656afd77cbea353d428 Mon Sep 17 00:00:00 2001 From: Juris Date: Mon, 2 Dec 2024 21:52:52 +0200 Subject: [PATCH] 2024-02 Rust --- rust/y2024/src/bin/solution_2024_02.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rust/y2024/src/bin/solution_2024_02.rs b/rust/y2024/src/bin/solution_2024_02.rs index 9ee5d6ae..0fb017a9 100644 --- a/rust/y2024/src/bin/solution_2024_02.rs +++ b/rust/y2024/src/bin/solution_2024_02.rs @@ -24,9 +24,7 @@ fn valid_diffs_1(row: &[N], range: &RangeInclusive) -> bool { row.iter() .tuple_windows() .map(|(a, b)| b - a) - .filter(|diff| !range.contains(diff)) - .count() - == 0 + .all(|diff| range.contains(&diff)) } #[allow(dead_code)]