Skip to content

Commit 000e812

Browse files
committed
Minor fix
1 parent f8cd3c2 commit 000e812

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,11 @@ println!("{:?}", nums);
288288
//output: [2, 4, 6, 8, 10]
289289
```
290290

291-
Typically, though, you wouldn't use syntax above. Now that you are fluent with iterators, you'd use `map()` instead, right?
291+
However, now that you are an iterator ninja, you wouldn't use the `for` loop syntax above. You'd go with a `map()` instead, right?
292292

293293
```rust
294294
let nums = vec![1, 2, 3, 4, 5];
295-
let nums = nums.iter().map(|x| x * x);
295+
let nums = nums.iter().map(|x| x * 2);
296296
println!("{:?}", nums);
297297
```
298298

0 commit comments

Comments
 (0)