Skip to content

Commit

Permalink
rust: alloc: add missing comment on try_resize
Browse files Browse the repository at this point in the history
An update missing from Rust 1.57.0. The comment was added in upstream
commit e8e7f6e05cf6 ("Add truncate note to Vec::resize") to `resize`,
but not to our fallible version `try_resize`.

Fixes: 7aaec26 ("rust: alloc: upgrade to 1.57.0")
Reviewed-by: Björn Roy Baron <bjorn3_gh@protonmail.com>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Tested-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Reviewed-by: Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>
Tested-by: Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Tested-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
  • Loading branch information
ojeda committed Jan 11, 2023
1 parent 8122cdf commit c93ddbb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rust/alloc/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2582,6 +2582,7 @@ impl<T: Clone, A: Allocator> Vec<T, A> {
/// in order to be able to clone the passed value.
/// If you need more flexibility (or want to rely on [`Default`] instead of
/// [`Clone`]), use [`Vec::resize_with`].
/// If you only need to resize to a smaller size, use [`Vec::truncate`].
///
/// # Examples
///
Expand Down

0 comments on commit c93ddbb

Please sign in to comment.