Rollup merge of #89401 - owengage:master, r=joshtriplett

Add truncate note to Vec::resize

A very minor addition to the `Vec::resize` documentation to point out the `truncate` method.
When I was searching for something matching `truncate` I managed to miss it, along with some colleagues. We later found it by chance. We did find `resize` however, so I was hoping to point it out in the documentation.
This commit is contained in:
Manish Goregaokar 2021-10-03 23:13:22 -07:00 committed by GitHub
commit d236c04bbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2137,6 +2137,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
///