We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d30011 commit aa594feCopy full SHA for aa594fe
library/alloc/src/string.rs
@@ -1725,8 +1725,10 @@ 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.
+ /// Reallocates if `self.capacity()` is insufficient,
+ /// (which may involve copying all `self.capacity()` bytes).
1730
+ /// Makes space at the given position for the insertion,
1731
+ /// by moving the bytes, from the given position until the end, to new positions.
1732
1733
/// # Panics
1734
0 commit comments