diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 13ef94dee2326..5b671b41b5bf6 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -1774,6 +1774,15 @@ impl FromIterator for String { } } +#[stable(feature = "box_str2", since = "1.45.0")] +impl FromIterator> for String { + fn from_iter>>(iter: I) -> String { + let mut buf = String::new(); + buf.extend(iter); + buf + } +} + #[stable(feature = "herd_cows", since = "1.19.0")] impl<'a> FromIterator> for String { fn from_iter>>(iter: I) -> String { @@ -1842,6 +1851,13 @@ impl<'a> Extend<&'a str> for String { } } +#[stable(feature = "box_str2", since = "1.45.0")] +impl Extend> for String { + fn extend>>(&mut self, iter: I) { + iter.into_iter().for_each(move |s| self.push_str(&s)); + } +} + #[stable(feature = "extend_string", since = "1.4.0")] impl Extend for String { fn extend>(&mut self, iter: I) {