impl FromIter<&char> for String
This commit is contained in:
parent
fc6f092c21
commit
097398e383
1 changed files with 9 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue