@@ -118,13 +118,13 @@ assert_eq!(result, vec![4, 16, 36, 64, 100]);
118118
119119| Combinator | What It Does | Example |
120120| -----------| -------------| ---------|
121- | ` .map(f) ` | Transform each element | `.map(| x | x * 2)` |
122- | ` .filter(p) ` | Keep elements where predicate is true | `.filter(| x | x > &5)` |
123- | ` .filter_map(f) ` | Map + filter in one step (returns ` Option ` ) | `.filter_map(| x | x.parse().ok())` |
124- | ` .flat_map(f) ` | Map then flatten nested iterators | `.flat_map(| s | s.chars())` |
125- | ` .fold(init, f) ` | Reduce to single value (like ` Aggregate ` in C#) | `.fold(0, | acc, x| acc + x)` |
126- | ` .any(p) ` / ` .all(p) ` | Short-circuit boolean check | `.any(| x | x > 100)` |
127- | ` .enumerate() ` | Add index | `.enumerate().map(| (i, x)| ...)` |
121+ | ` .map(f) ` | Transform each element | ` .map(\|x\ | x * 2) ` |
122+ | ` .filter(p) ` | Keep elements where predicate is true | ` .filter(\|x\ | x > &5) ` |
123+ | ` .filter_map(f) ` | Map + filter in one step (returns ` Option ` ) | ` .filter_map(\|x\ | x.parse().ok()) ` |
124+ | ` .flat_map(f) ` | Map then flatten nested iterators | ` .flat_map(\|s\ | s.chars()) ` |
125+ | ` .fold(init, f) ` | Reduce to single value (like ` Aggregate ` in C#) | ` .fold(0, \ |acc, x\ | acc + x) ` |
126+ | ` .any(p) ` / ` .all(p) ` | Short-circuit boolean check | ` .any(\|x\ | x > 100) ` |
127+ | ` .enumerate() ` | Add index | ` .enumerate().map(\ |(i, x)\ | ...) ` |
128128| ` .zip(other) ` | Pair with another iterator | ` .zip(labels.iter()) ` |
129129| ` .take(n) ` / ` .skip(n) ` | First/skip N elements | ` .take(10) ` |
130130| ` .chain(other) ` | Concatenate two iterators | ` .chain(extra.iter()) ` |
0 commit comments