Skip to content

Commit e8e7f6e

Browse files
committed
Add truncate note to Vec::resize
1 parent c6007fd commit e8e7f6e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/alloc/src/vec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2116,6 +2116,7 @@ impl<T: Clone, A: Allocator> Vec<T, A> {
21162116
/// in order to be able to clone the passed value.
21172117
/// If you need more flexibility (or want to rely on [`Default`] instead of
21182118
/// [`Clone`]), use [`Vec::resize_with`].
2119+
/// If you only need to resize to a smaller size, use [`Vec::truncate`].
21192120
///
21202121
/// # Examples
21212122
///

0 commit comments

Comments
 (0)