diff options
| author | Kornel Lesiński <kornel@geekhood.net> | 2020-08-15 12:34:15 +0100 |
|---|---|---|
| committer | Kornel Lesiński <kornel@geekhood.net> | 2020-08-15 17:55:10 +0100 |
| commit | d5cb5eb08bc75cd9cd297b15cfac8bded9edc053 (patch) | |
| tree | 7ffb1f31966587520ba705dc915bd2ec8ea227b4 | |
| parent | 80fb3f3139c7dee7f211964c6a0b3ccb04b83d5e (diff) | |
| download | rust-d5cb5eb08bc75cd9cd297b15cfac8bded9edc053.tar.gz rust-d5cb5eb08bc75cd9cd297b15cfac8bded9edc053.zip | |
Doc: String isn't a collection
| -rw-r--r-- | library/core/src/iter/traits/iterator.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index 3ea3eeed6b0..f89b616c4e2 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -1543,11 +1543,10 @@ pub trait Iterator { /// collection into another. You take a collection, call [`iter`] on it, /// do a bunch of transformations, and then `collect()` at the end. /// - /// One of the keys to `collect()`'s power is that many things you might - /// not think of as 'collections' actually are. For example, a [`String`] - /// is a collection of [`char`]s. And a collection of - /// [`Result<T, E>`][`Result`] can be thought of as single - /// [`Result`]`<Collection<T>, E>`. See the examples below for more. + /// `collect()` can also create instances of types that are not typical + /// collections. For example, a [`String`] can be built from [`char`]s, + /// and an iterator of [`Result<T, E>`][`Result`] items can be collected + /// into `Result<Collection<T>, E>`. See the examples below for more. /// /// Because `collect()` is so general, it can cause problems with type /// inference. As such, `collect()` is one of the few times you'll see |
