From 825a3b1f09c1b2598aa9a0fdabe5ad051e5e1c98 Mon Sep 17 00:00:00 2001 From: JirCep Date: Sat, 27 Apr 2024 16:57:20 +0200 Subject: [PATCH 1/2] String.truncate calls Vec.truncate, in turn, and that states "is greater or equal to". Beside common sense. --- library/alloc/src/string.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 7c9f13e30ffb1..414486ed75f33 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -1382,7 +1382,7 @@ impl String { /// Shortens this `String` to the specified length. /// - /// If `new_len` is greater than the string's current length, this has no + /// If `new_len` is greater than or equal to the string's current length, this has no /// effect. /// /// Note that this method has no effect on the allocated capacity From f840da757f1e40c18b4627274046197ad46e4f50 Mon Sep 17 00:00:00 2001 From: JirCep Date: Sat, 27 Apr 2024 17:18:25 +0200 Subject: [PATCH 2/2] WS fix. --- library/alloc/src/string.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 414486ed75f33..2a859ad55eed2 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -1382,7 +1382,7 @@ impl String { /// Shortens this `String` to the specified length. /// - /// If `new_len` is greater than or equal to the string's current length, this has no + /// If `new_len` is greater than or equal to the string's current length, this has no /// effect. /// /// Note that this method has no effect on the allocated capacity