mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 15:23:26 +03:00
8ae1d444cb
Specialize Vec::from_iter for vec::IntoIter It's fairly common to expose an API which takes an `IntoIterator` and immediately collects that into a vector. It's also common to buffer a bunch of items into a vector and then pass that into one of these APIs. If the iterator hasn't been advanced, we can make this `from_iter` simply reassemble the original `Vec` with no actual iteration or reallocation. r? @aturon