diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 06952253ef3b0..70b514afd035f 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -1874,6 +1874,27 @@ impl<'a> From for Cow<'a, str> { } } +#[stable(feature = "cow_str_from_iter", since = "1.12.0")] +impl<'a> FromIterator for Cow<'a, str> { + fn from_iter>(it: I) -> Cow<'a, str> { + Cow::Owned(FromIterator::from_iter(it)) + } +} + +#[stable(feature = "cow_str_from_iter", since = "1.12.0")] +impl<'a, 'b> FromIterator<&'b str> for Cow<'a, str> { + fn from_iter>(it: I) -> Cow<'a, str> { + Cow::Owned(FromIterator::from_iter(it)) + } +} + +#[stable(feature = "cow_str_from_iter", since = "1.12.0")] +impl<'a> FromIterator for Cow<'a, str> { + fn from_iter>(it: I) -> Cow<'a, str> { + Cow::Owned(FromIterator::from_iter(it)) + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl Into> for String { fn into(self) -> Vec {