Skip to content

Commit d1bfd65

Browse files
committed
auto merge of #18273 : gamazeps/rust/issue18218, r=steveklabnik
Closes #18218
2 parents 58dc0a0 + b4697f0 commit d1bfd65

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/doc/guide.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -4545,9 +4545,10 @@ range(1i, 100i).map(|x| println!("{}", x));
45454545
If you are trying to execute a closure on an iterator for its side effects,
45464546
just use `for` instead.
45474547

4548-
There are tons of interesting iterator adapters. `take(n)` will get the
4549-
first `n` items out of an iterator, and return them as a list. Let's
4550-
try it out with our infinite iterator from before, `count()`:
4548+
There are tons of interesting iterator adapters. `take(n)` will return an
4549+
iterator over the next `n` elements of the original iterator, note that this
4550+
has no side effect on the original iterator. Let's try it out with our infinite
4551+
iterator from before, `count()`:
45514552

45524553
```{rust}
45534554
for i in std::iter::count(1i, 5i).take(5) {

0 commit comments

Comments
 (0)