]> git.lizzy.rs Git - rust.git/commitdiff
Add truncate note to Vec::resize
authorOwen Gage <owengage@gmail.com>
Thu, 30 Sep 2021 16:21:03 +0000 (17:21 +0100)
committerOwen Gage <owengage@gmail.com>
Thu, 30 Sep 2021 16:21:03 +0000 (17:21 +0100)
library/alloc/src/vec/mod.rs

index c37ec37556157648b9986598487b396c1b709130..cc53df812bb5456bcd7fe232db8d9817ebe73d3f 100644 (file)
@@ -2116,6 +2116,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
     ///