Skip to content

Commit d3745a7

Browse files
Merge pull request #98 from DaividFrank/daivid/issue-97
ch12-colsures: Correct partition example to deref n
2 parents cda4f61 + 048bedc commit d3745a7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

c-cpp-book/src/ch12-closures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn main() {
140140
// Approach 2: Single pass with partition()
141141
let (evens, odds): (Vec<i32>, Vec<i32>) = numbers
142142
.into_iter()
143-
.partition(|n| n % 2 == 0);
143+
.partition(|n| *n % 2 == 0);
144144
println!("Evens (partition): {evens:?}");
145145
println!("Odds (partition): {odds:?}");
146146
}

0 commit comments

Comments
 (0)