3 ms·
Here's the code performing the allocation reuse: https://github.com/rust-lang/rust/blob/25f8d01fd8bda339612d0c0a8844173a09205f7c/library/alloc/src/vec/spec_fro
by pornel 3y ago
Here's the code performing the allocation reuse:
https://github.com/rust-lang/rust/blob/25f8d01fd8bda339612d0c0a8844173a09205f7c/library/alloc/src/vec/spec_from_iter.rs#L43 https://github.com/rust-lang/rust/blob/25f8d01fd8bda339612d0...
It's not supposed to waste more space than a regular `collect()` or `push()` would when growing the capacity exponentially.