about summary refs log tree commit diff
path: root/tests/rustdoc-ui/coverage/basic.rs
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2024-12-20 01:36:45 -0500
committerGitHub <noreply@github.com>2024-12-20 01:36:45 -0500
commit3cdc3b7e0b516791f4a95eac8a577c37fc75b6ca (patch)
tree3a98a73d2f308851c941413f2530a1dc162b859d /tests/rustdoc-ui/coverage/basic.rs
parent214587c89d527dd0ccbe1f2150c737d3bdee67b0 (diff)
parent07ba1fdd59cbf563536c40d82c5690008d67937f (diff)
downloadrust-3cdc3b7e0b516791f4a95eac8a577c37fc75b6ca.tar.gz
rust-3cdc3b7e0b516791f4a95eac8a577c37fc75b6ca.zip
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. :blush:
Diffstat (limited to 'tests/rustdoc-ui/coverage/basic.rs')
0 files changed, 0 insertions, 0 deletions