1
Fork 0

Doc: String isn't a collection

This commit is contained in:
Kornel Lesiński 2020-08-15 12:34:15 +01:00
parent 80fb3f3139
commit d5cb5eb08b

View file

@ -1543,11 +1543,10 @@ pub trait Iterator {
/// collection into another. You take a collection, call [`iter`] on it, /// collection into another. You take a collection, call [`iter`] on it,
/// do a bunch of transformations, and then `collect()` at the end. /// 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 /// `collect()` can also create instances of types that are not typical
/// not think of as 'collections' actually are. For example, a [`String`] /// collections. For example, a [`String`] can be built from [`char`]s,
/// is a collection of [`char`]s. And a collection of /// and an iterator of [`Result<T, E>`][`Result`] items can be collected
/// [`Result<T, E>`][`Result`] can be thought of as single /// into `Result<Collection<T>, E>`. See the examples below for more.
/// [`Result`]`<Collection<T>, E>`. See the examples below for more.
/// ///
/// Because `collect()` is so general, it can cause problems with type /// Because `collect()` is so general, it can cause problems with type
/// inference. As such, `collect()` is one of the few times you'll see /// inference. As such, `collect()` is one of the few times you'll see