Skip to content

Commit b4697f0

Browse files
committed
Changes a little the description of take in the guide
Closes #18218
1 parent 00cc6d2 commit b4697f0

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
@@ -4488,9 +4488,10 @@ range(1i, 100i).map(|x| println!("{}", x));
44884488
If you are trying to execute a closure on an iterator for its side effects,
44894489
just use `for` instead.
44904490

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

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

0 commit comments

Comments
 (0)