mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 13:05:18 +03:00
ded9354dcf
Using `Vec::extend(std::iter::repeat_n(item, N))` allows to use the more natural number of elements to add `N`, as is probably done in the original loop, instead of computing the difference between the existing number of elements and the wanted one. Before MSRV 1.82, the older suggestion to use `Vec::resize()` is still issued.