Closed
Description
Lines 1720 to 1727 in 07c415c
Basically the idea is that, for impl FromIterator<String> for String
, we reimplement it slightly so that newly returned string reuses and reallocates the buffer of the first string in the iterator. It would look something like this:
fn from_iter(iter: I) -> String {
match iter.next() {
None => String::new(),
Some(base) => { base.extend(iter); base }
}
}
Of course, this might not be worth the added complexity– in particular, I'm not sure what the implications are for added branching– so I'm writing this issue to solicit any feedback before creating a PR.
Metadata
Metadata
Assignees
Labels
No labels