diff options
| author | Seo Sanghyeon <sanxiyn@gmail.com> | 2016-11-26 22:02:14 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-11-26 22:02:14 +0900 |
| commit | 5aceedf4d8ddf74c9d6972390dc86b4e1c1e2b35 (patch) | |
| tree | f8e67624a176ba63b64ac83fe931b6f4efb7ab30 /src/libcore | |
| parent | a809749fdf0fc283794a5132ea2f1b950b07f6fb (diff) | |
| parent | 557369ed2eadc3861ce32c53ef0c207bc112abc0 (diff) | |
| download | rust-5aceedf4d8ddf74c9d6972390dc86b4e1c1e2b35.tar.gz rust-5aceedf4d8ddf74c9d6972390dc86b4e1c1e2b35.zip | |
Rollup merge of #37963 - bluss:iterator-docs, r=alexcrichton
Fix two small issues in iterator docs - `collect()` is a regular method, not an adaptor (does not return an Iterator). I just randomly picked `filter` as a third common adaptor to mention instead. - Fix example in `Map`'s docs so that it uses the DoubleEndedIterator implementation
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/iter/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs index 2e08508de67..3999db0d63c 100644 --- a/src/libcore/iter/mod.rs +++ b/src/libcore/iter/mod.rs @@ -225,12 +225,12 @@ //! often called 'iterator adapters', as they're a form of the 'adapter //! pattern'. //! -//! Common iterator adapters include [`map()`], [`take()`], and [`collect()`]. +//! Common iterator adapters include [`map()`], [`take()`], and [`filter()`]. //! For more, see their documentation. //! //! [`map()`]: trait.Iterator.html#method.map //! [`take()`]: trait.Iterator.html#method.take -//! [`collect()`]: trait.Iterator.html#method.collect +//! [`filter()`]: trait.Iterator.html#method.filter //! //! # Laziness //! @@ -268,7 +268,7 @@ //! [`map()`]: trait.Iterator.html#method.map //! //! The two most common ways to evaluate an iterator are to use a `for` loop -//! like this, or using the [`collect()`] adapter to produce a new collection. +//! like this, or using the [`collect()`] method to produce a new collection. //! //! [`collect()`]: trait.Iterator.html#method.collect //! @@ -937,7 +937,7 @@ unsafe impl<A, B> TrustedLen for Zip<A, B> /// you can also [`map()`] backwards: /// /// ```rust -/// let v: Vec<i32> = vec![1, 2, 3].into_iter().rev().map(|x| x + 1).collect(); +/// let v: Vec<i32> = vec![1, 2, 3].into_iter().map(|x| x + 1).rev().collect(); /// /// assert_eq!(v, [4, 3, 2]); /// ``` |
