From 26bdf2900acad2091ab7e59296d3a457011ea770 Mon Sep 17 00:00:00 2001 From: "许杰友 Jieyou Xu (Joe)" Date: Mon, 26 Feb 2024 19:24:49 +0000 Subject: Rearrange `String::from_raw_parts` doc argument order to match code argument order --- library/alloc/src/string.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'library/alloc/src/string.rs') diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 6dadbc8e364..955438f49a1 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -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 /// -- cgit 1.4.1-3-g733a5 From bfeea294cc01c295ca5b54dcbfb59ee6953b4fc6 Mon Sep 17 00:00:00 2001 From: "许杰友 Jieyou Xu (Joe)" Date: Mon, 26 Feb 2024 19:31:51 +0000 Subject: Document args returned from `String::into_raw_parts` --- library/alloc/src/string.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'library/alloc/src/string.rs') diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 955438f49a1..1d3c04f7807 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 -- cgit 1.4.1-3-g733a5