We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d30011 commit 0e7f01cCopy full SHA for 0e7f01c
library/alloc/src/string.rs
@@ -1725,8 +1725,8 @@ impl String {
1725
1726
/// Inserts a string slice into this `String` at a byte position.
1727
///
1728
- /// This is an *O*(*n*) operation as it requires copying every element in the
1729
- /// buffer.
+ /// If there is space in `self` this will copy `self.len() - idx + string.len()` bytes,
+ /// otherwise will reallocate and copy `self.len() + string.len()` bytes.
1730
1731
/// # Panics
1732
0 commit comments