diff options
| author | liv <mokou@fastmail.com> | 2023-02-19 12:34:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-19 12:34:52 +0100 |
| commit | 701b4bef51b50d1fd3bb7fbfe3cc274f2bbdcb0c (patch) | |
| tree | 5ea2764c607eec747a84bfd564fc4b7459f69ee6 | |
| parent | bec7be05f55bc17732bbae529b85b476bb8c7448 (diff) | |
| parent | 045d86aa42cbdb81d2be123fc9a7379dd5e38b08 (diff) | |
Merge pull request #1386 from cyril-marpaud/cmp_arc1
refactor(arc1): improve readability by avoiding implicit dereference
| -rw-r--r-- | exercises/smart_pointers/arc1.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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); })); } |
