String.truncate calls Vec.truncate, in turn, and that states

"is greater or equal to". Beside common sense.
This commit is contained in:
JirCep 2024-04-27 16:57:20 +02:00
parent 261823eee7
commit 825a3b1f09

View File

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