diff options
| author | 许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com> | 2024-02-26 19:26:49 +0000 |
|---|---|---|
| committer | 许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com> | 2024-02-26 19:32:32 +0000 |
| commit | dd24a462d517cf2a0667adf92aaa38502b71b61c (patch) | |
| tree | dac8e0ed664a4d1577226a081bd81f898a4260ac | |
| parent | 26bdf2900acad2091ab7e59296d3a457011ea770 (diff) | |
| download | rust-dd24a462d517cf2a0667adf92aaa38502b71b61c.tar.gz rust-dd24a462d517cf2a0667adf92aaa38502b71b61c.zip | |
Document args returned from `Vec::into_raw_parts{,_with_alloc}`
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 7e07a793a66..7bd19875584 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -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 |
