Skip to content

Commit

Permalink
Document args returned from Vec::into_raw_parts{,_with_alloc}
Browse files Browse the repository at this point in the history
  • Loading branch information
jieyouxu committed Feb 26, 2024
1 parent 26bdf29 commit dd24a46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ impl<T, A: Allocator> Vec<T, A> {
unsafe { Vec { buf: RawVec::from_raw_parts_in(ptr, capacity, alloc), len: length } }
}

/// Decomposes a `Vec<T>` into its raw components.
/// Decomposes a `Vec<T>` into its raw components: `(pointer, length, capacity)`.
///
/// Returns the raw pointer to the underlying data, the length of
/// the vector (in elements), and the allocated capacity of the
Expand Down Expand Up @@ -824,7 +824,7 @@ impl<T, A: Allocator> Vec<T, A> {
(me.as_mut_ptr(), me.len(), me.capacity())
}

/// Decomposes a `Vec<T>` into its raw components.
/// Decomposes a `Vec<T>` into its raw components: `(pointer, length, capacity, allocator)`.
///
/// Returns the raw pointer to the underlying data, the length of the vector (in elements),
/// the allocated capacity of the data (in elements), and the allocator. These are the same
Expand Down

0 comments on commit dd24a46

Please sign in to comment.