rust/library/alloc
Jacob Pratt 3cdc3b7e0b
Rollup merge of #126118 - jan-ferdinand:docs_for_vec_set_len, r=the8472
docs: Mention `spare_capacity_mut()` in `Vec::set_len`

I recently went down a small rabbit hole when trying to identify safe use of `Vec::set_len`. The solution was `Vec::spare_capacity_mut`. I think the docs on `Vec::set_len` benefit from mentioning this method.

A possible counter-argument could be that the [clippy lint `uninit_vec`](https://rust-lang.github.io/rust-clippy/master/index.html#/uninit_vec) already nudges people in the right direction. However, I think a working example on `Vec::set_len` is still beneficial.

Happy to hear your thoughts on the matter. 😊
2024-12-20 01:36:45 -05:00
..
benches update cfgs 2024-11-27 15:14:54 +00:00
src Rollup merge of #126118 - jan-ferdinand:docs_for_vec_set_len, r=the8472 2024-12-20 01:36:45 -05:00
tests Add a range argument to vec.extract_if 2024-12-16 22:06:52 +01:00
Cargo.toml Update compiler_builtins to 0.1.138 and pin it 2024-11-03 17:43:16 -06:00