-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.
Description
Proposed new str
or String
API
String::insert_str(&mut self, index: usize, s: &str)
Just likeinsert(&mut self, usize, char)
, but for a string piece. Insertion is inherently inefficient, but this impl will be better than the user having to create an entirely new String.String::splice<R>(&mut self, range: R, s: &str)
Combinedrain
andinsert_str
, allow both removing a range and replacing it with a new string in one operation. Removerange
, inserts
atrange.start
.str::repeat(&self, n: usize) -> String
Convenience to repeat a String. Will size the result correctly up front, so it's both simpler and faster than in-code iterator based solutions.
Metadata
Metadata
Assignees
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.