Skip to content

Commit d236c04

Browse files
authored
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.
2 parents c167eee + e8e7f6e commit d236c04

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
@@ -2137,6 +2137,7 @@ impl<T: Clone, A: Allocator> Vec<T, A> {
21372137
/// in order to be able to clone the passed value.
21382138
/// If you need more flexibility (or want to rely on [`Default`] instead of
21392139
/// [`Clone`]), use [`Vec::resize_with`].
2140+
/// If you only need to resize to a smaller size, use [`Vec::truncate`].
21402141
///
21412142
/// # Examples
21422143
///

0 commit comments

Comments
 (0)