We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents efb1e3d + aa594fe commit 4127632Copy full SHA for 4127632
library/alloc/src/string.rs
@@ -1735,8 +1735,10 @@ impl String {
1735
1736
/// Inserts a string slice into this `String` at a byte position.
1737
///
1738
- /// This is an *O*(*n*) operation as it requires copying every element in the
1739
- /// buffer.
+ /// Reallocates if `self.capacity()` is insufficient,
+ /// (which may involve copying all `self.capacity()` bytes).
1740
+ /// Makes space at the given position for the insertion,
1741
+ /// by moving the bytes, from the given position until the end, to new positions.
1742
1743
/// # Panics
1744
0 commit comments