WSL2-Linux-Kernel/rust/alloc/vec
Miguel Ojeda feadd06287 rust: alloc: add `Vec::try_with_capacity{,_in}()` constructors
Add `Vec::try_with_capacity()` and `Vec::try_with_capacity_in()` as
the fallible versions of `Vec::with_capacity()` and
`Vec::with_capacity_in()`, respectively.

The implementations follow the originals and use the previously
added `RawVec::try_with_capacity_in()`.

In turn, `Vec::try_with_capacity()` will be used to implement
the `CString` type (which wraps a `Vec<u8>`) in a later patch.

Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-12-04 01:59:15 +01:00
..
drain.rs rust: adapt `alloc` crate to the kernel 2022-09-28 08:57:01 +02:00
drain_filter.rs rust: adapt `alloc` crate to the kernel 2022-09-28 08:57:01 +02:00
into_iter.rs rust: adapt `alloc` crate to the kernel 2022-09-28 08:57:01 +02:00
is_zero.rs rust: adapt `alloc` crate to the kernel 2022-09-28 08:57:01 +02:00
mod.rs rust: alloc: add `Vec::try_with_capacity{,_in}()` constructors 2022-12-04 01:59:15 +01:00
partial_eq.rs rust: adapt `alloc` crate to the kernel 2022-09-28 08:57:01 +02:00