diff options
| author | gamazeps <gamaz3ps@gmail.com> | 2014-10-24 13:36:05 +0200 |
|---|---|---|
| committer | gamazeps <gamaz3ps@gmail.com> | 2014-10-24 17:19:09 +0200 |
| commit | b4697f061232954608857af6a0deda14ac1b500e (patch) | |
| tree | 63229687409c790fc5cffa54958e4c74d181ef50 | |
| parent | 00cc6d24099eb93ecfeb9bf807ab9e5130a01749 (diff) | |
| download | rust-b4697f061232954608857af6a0deda14ac1b500e.tar.gz rust-b4697f061232954608857af6a0deda14ac1b500e.zip | |
Changes a little the description of take in the guide
Closes #18218
| -rw-r--r-- | src/doc/guide.md | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/doc/guide.md b/src/doc/guide.md index 81470a93e4c..617c73fa14c 100644 --- a/src/doc/guide.md +++ b/src/doc/guide.md @@ -4488,9 +4488,10 @@ range(1i, 100i).map(|x| println!("{}", x)); If you are trying to execute a closure on an iterator for its side effects, just use `for` instead. -There are tons of interesting iterator adapters. `take(n)` will get the -first `n` items out of an iterator, and return them as a list. Let's -try it out with our infinite iterator from before, `count()`: +There are tons of interesting iterator adapters. `take(n)` will return an +iterator over the next `n` elements of the original iterator, note that this +has no side effect on the original iterator. Let's try it out with our infinite +iterator from before, `count()`: ```{rust} for i in std::iter::count(1i, 5i).take(5) { |
