Skip to content

Commit 76223fa

Browse files
committed
Add note to Vec::split_at_spare_mut docs that the method is low-level
1 parent 476a57a commit 76223fa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

library/alloc/src/vec/mod.rs

+15
Original file line numberDiff line numberDiff line change
@@ -1837,6 +1837,21 @@ impl<T, A: Allocator> Vec<T, A> {
18371837
///
18381838
/// [`set_len`]: Vec::set_len
18391839
///
1840+
/// Note that this is a low-level API, which should be used with care for
1841+
/// optimization purposes. If you need to append data to a `Vec`
1842+
/// you can use [`push`], [`extend`], [`extend_from_slice`],
1843+
/// [`extend_from_within`], [`insert`], [`append`], [`resize`] or
1844+
/// [`resize_with`], depending on your exact needs.
1845+
///
1846+
/// [`push`]: Vec::push
1847+
/// [`extend`]: Vec::extend
1848+
/// [`extend_from_slice`]: Vec::extend_from_slice
1849+
/// [`extend_from_within`]: Vec::extend_from_within
1850+
/// [`insert`]: Vec::insert
1851+
/// [`append`]: Vec::append
1852+
/// [`resize`]: Vec::resize
1853+
/// [`resize_with`]: Vec::resize_with
1854+
///
18401855
/// # Examples
18411856
///
18421857
/// ```

0 commit comments

Comments
 (0)