diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index aa9628c535a99..31ab04e9f3b74 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -1604,6 +1604,15 @@ impl FromIterator for String { } } +#[stable(feature = "herd_cows", since = "1.19.0")] +impl<'a> FromIterator> for String { + fn from_iter>>(iter: I) -> String { + let mut buf = String::new(); + buf.extend(iter); + buf + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl Extend for String { fn extend>(&mut self, iter: I) { @@ -1641,6 +1650,15 @@ impl Extend for String { } } +#[stable(feature = "herd_cows", since = "1.19.0")] +impl<'a> Extend> for String { + fn extend>>(&mut self, iter: I) { + for s in iter { + self.push_str(&s) + } + } +} + /// A convenience impl that delegates to the impl for `&str` #[unstable(feature = "pattern", reason = "API not fully fleshed out and ready to be stabilized",