diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index f3fe1adebb141..f205835845e40 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -1772,6 +1772,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 { @@ -1815,6 +1824,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) {