mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 18:15:07 +03:00
3bfeffd55b
Add VecDeque::extend from vec::IntoIter and slice::Iter specializations Inspired from the [`Vec` `SpecExtend` implementation](https://github.com/rust-lang/rust/blob/027a232755fa9728e9699337267f6675dfd0a8ba/library/alloc/src/vec/spec_extend.rs), but without the specialization for `TrustedLen` which I'll look into in the future. Should help #95632 and https://github.com/KillingSpark/zstd-rs/pull/17 ## Benchmarks Before ``` test vec_deque::bench_extend_bytes ... bench: 862 ns/iter (+/- 10) test vec_deque::bench_extend_vec ... bench: 883 ns/iter (+/- 19) ``` After ``` test vec_deque::bench_extend_bytes ... bench: 8 ns/iter (+/- 0) test vec_deque::bench_extend_vec ... bench: 24 ns/iter (+/- 1) ```