Description
The documentation for FromIterator
https://doc.rust-lang.org/nightly/std/iter/trait.FromIterator.html says
FromIterator::from_iter() is rarely called explicitly, and is instead used through Iterator::collect() method. See Iterator::collect()’s documentation for more examples.
However, the trait is now in the rust_2021 prelude https://doc.rust-lang.org/nightly/core/prelude/rust_2021/index.html explicitly to allow it to be called more often.
This documentation should thus likely be updated to -- while still pointing at collect
-- mention why one may wish to call it explicitly. Perhaps something like VecDeque::from_iter(0..100)
would be a nice example.
One might also re-use some text from the RFC that added it to the prelude, https://rust-lang.github.io/rfcs/3114-prelude-2021.html#fromiterator