Skip to content

Commit

Permalink
auto merge of #18273 : gamazeps/rust/issue18218, r=steveklabnik
Browse files Browse the repository at this point in the history
Closes #18218
  • Loading branch information
bors committed Oct 28, 2014
2 parents 58dc0a0 + b4697f0 commit d1bfd65
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/doc/guide.md
Expand Up @@ -4545,9 +4545,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) {
Expand Down

0 comments on commit d1bfd65

Please sign in to comment.