From 045d86aa42cbdb81d2be123fc9a7379dd5e38b08 Mon Sep 17 00:00:00 2001 From: Cyril MARPAUD Date: Sat, 18 Feb 2023 21:38:43 +0100 Subject: [PATCH] refactor(arc1): improve readability by avoiding implicit dereference --- exercises/smart_pointers/arc1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/smart_pointers/arc1.rs b/exercises/smart_pointers/arc1.rs index 93a2703..ffb306a 100644 --- a/exercises/smart_pointers/arc1.rs +++ b/exercises/smart_pointers/arc1.rs @@ -32,7 +32,7 @@ fn main() { for offset in 0..8 { let child_numbers = // TODO joinhandles.push(thread::spawn(move || { - let sum: u32 = child_numbers.iter().filter(|n| *n % 8 == offset).sum(); + let sum: u32 = child_numbers.iter().filter(|&&n| n % 8 == offset).sum(); println!("Sum of offset {} is {}", offset, sum); })); }