diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 6dadbc8e36428..1d3c04f7807ab 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -864,7 +864,7 @@ impl String { } } - /// Decomposes a `String` into its raw components. + /// Decomposes a `String` into its raw components: `(pointer, length, capacity)`. /// /// Returns the raw pointer to the underlying data, the length of /// the string (in bytes), and the allocated capacity of the data @@ -896,7 +896,7 @@ impl String { self.vec.into_raw_parts() } - /// Creates a new `String` from a length, capacity, and pointer. + /// Creates a new `String` from a pointer, a length and a capacity. /// /// # Safety /// diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index b59699219eb84..7bd19875584a3 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -481,7 +481,7 @@ impl Vec { Self::with_capacity_in(capacity, Global) } - /// Creates a `Vec` directly from a pointer, a capacity, and a length. + /// Creates a `Vec` directly from a pointer, a length, and a capacity. /// /// # Safety /// @@ -672,7 +672,7 @@ impl Vec { Vec { buf: RawVec::with_capacity_in(capacity, alloc), len: 0 } } - /// Creates a `Vec` directly from a pointer, a capacity, a length, + /// Creates a `Vec` directly from a pointer, a length, a capacity, /// and an allocator. /// /// # Safety @@ -786,7 +786,7 @@ impl Vec { unsafe { Vec { buf: RawVec::from_raw_parts_in(ptr, capacity, alloc), len: length } } } - /// Decomposes a `Vec` into its raw components. + /// Decomposes a `Vec` 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 Vec { (me.as_mut_ptr(), me.len(), me.capacity()) } - /// Decomposes a `Vec` into its raw components. + /// Decomposes a `Vec` 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