rust/library/alloc/src
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
..
boxed replace placeholder version 2024-11-27 12:10:21 +00:00
collections remove bounds from vec and linkedlist ExtractIf 2024-12-16 22:06:52 +01:00
ffi Move some alloc tests to the alloctests crate 2024-12-04 14:32:04 +00:00
raw_vec Polymorphize RawVec 2024-08-09 20:06:26 -04:00
rc Use c"lit" for CStrings without unwrap 2024-12-02 18:16:36 +00:00
testing Reformat use declarations. 2024-07-29 08:26:52 +10:00
vec Rollup merge of #126118 - jan-ferdinand:docs_for_vec_set_len, r=the8472 2024-12-20 01:36:45 -05:00
alloc.rs Move some alloc tests to the alloctests crate 2024-12-04 14:32:04 +00:00
borrow.rs remove const_cow_is_borrowed feature gate 2024-10-12 19:48:28 +02:00
boxed.rs Stabilize async closures 2024-12-13 00:04:56 +00:00
fmt.rs Added struct fmt::FormattingOptions 2024-12-05 21:48:01 +01:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs Stabilize async closures 2024-12-13 00:04:56 +00:00
macros.rs Mark format! with must_use hint 2024-07-06 14:24:20 +02:00
raw_vec.rs Auto merge of #133533 - BoxyUwU:bump-boostrap, r=jieyouxu,Mark-Simulacrum 2024-11-29 22:39:10 +00:00
rc.rs Use field init shorthand where possible 2024-12-17 14:33:10 -08:00
slice.rs Change GetManyMutError to match T-libs-api decision 2024-11-28 23:34:47 +02:00
str.rs Inline str::repeat 2024-11-06 18:54:50 +00:00
string.rs Remove support for specializing ToString outside the standard library 2024-12-13 13:48:19 +00:00
sync.rs Use field init shorthand where possible 2024-12-17 14:33:10 -08:00
task.rs Stabilize noop_waker 2024-12-05 14:14:17 -08:00