Skip to content

Commit

Permalink
impl FromIter<&char> for String
Browse files Browse the repository at this point in the history
  • Loading branch information
withoutboats committed Feb 22, 2017
1 parent fc6f092 commit 097398e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,15 @@ impl FromIterator<char> for String {
}
}

#[stable(feature = "string_from_iter_by_ref", since = "1.17.0")]
impl<'a> FromIterator<&'a char> for String {
fn from_iter<I: IntoIterator<Item = &'a char>>(iter: I) -> String {
let mut buf = String::new();
buf.extend(iter);
buf
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a> FromIterator<&'a str> for String {
fn from_iter<I: IntoIterator<Item = &'a str>>(iter: I) -> String {
Expand Down

0 comments on commit 097398e

Please sign in to comment.