Skip to content

Commit

Permalink
Document some alternatives to Vec::split_off
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalathar committed Jan 21, 2024
1 parent 4cb17b4 commit 6f1944d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2167,6 +2167,12 @@ impl<T, A: Allocator> Vec<T, A> {
/// `[at, len)`. After the call, the original vector will be left containing
/// the elements `[0, at)` with its previous capacity unchanged.
///
/// - If you want to take ownership of the entire contents and capacity of
/// the vector, see [`mem::take`] or [`mem::replace`].
/// - If you don't need the returned vector at all, see [`Vec::truncate`].
/// - If you want to take ownership of an arbitrary subslice, or you don't
/// necessarily want to store the removed items in a vector, see [`Vec::drain`].
///
/// # Panics
///
/// Panics if `at > len`.
Expand Down

0 comments on commit 6f1944d

Please sign in to comment.