rust/library/core
Yuki Okushi 785237d392
Rollup merge of #104435 - scottmcm:iter-repeat-n, r=thomcc
`VecDeque::resize` should re-use the buffer in the passed-in element

Today it always copies it for *every* appended element, but one of those clones is avoidable.

This adds `iter::repeat_n` (https://github.com/rust-lang/rust/issues/104434) as the primitive needed to do this.  If this PR is acceptable, I'll also use this in `Vec` rather than its custom `ExtendElement` type & infrastructure that is harder to share between multiple different containers:

101e1822c3/library/alloc/src/vec/mod.rs (L2479-L2492)
2022-11-20 13:15:59 +09:00
..
benches Rollup merge of #103570 - lukas-code:stabilize-ilog, r=scottmcm 2022-11-09 19:21:21 +05:30
primitive_docs
src Rollup merge of #104435 - scottmcm:iter-repeat-n, r=thomcc 2022-11-20 13:15:59 +09:00
tests Rollup merge of #104435 - scottmcm:iter-repeat-n, r=thomcc 2022-11-20 13:15:59 +09:00
Cargo.toml Avoid use of rand::thread_rng in stdlib benchmarks 2022-05-02 00:08:21 -07:00