Skip to content

Commit

Permalink
Changes a little the description of take in the guide
Browse files Browse the repository at this point in the history
Closes #18218
  • Loading branch information
gamazeps committed Oct 24, 2014
1 parent 00cc6d2 commit b4697f0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/doc/guide.md
Expand Up @@ -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) {
Expand Down

5 comments on commit b4697f0

@bors
Copy link
Contributor

@bors bors commented on b4697f0 Oct 28, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from steveklabnik
at gamazeps@b4697f0

@bors
Copy link
Contributor

@bors bors commented on b4697f0 Oct 28, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging gamazeps/rust/issue18218 = b4697f0 into auto

@bors
Copy link
Contributor

@bors bors commented on b4697f0 Oct 28, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gamazeps/rust/issue18218 = b4697f0 merged ok, testing candidate = d1bfd65

@bors
Copy link
Contributor

@bors bors commented on b4697f0 Oct 28, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on b4697f0 Oct 28, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = d1bfd65

Please sign in to comment.