Document args returned from Vec::into_raw_parts{,_with_alloc}

This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-02-26 19:26:49 +00:00
parent 26bdf2900a
commit dd24a462d5
No known key found for this signature in database
GPG Key ID: 95DDEBD74A1DC2C0

View File

@ -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
@ -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