We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 06a0233 + 097398e commit 0a008b9Copy full SHA for 0a008b9
src/libcollections/string.rs
@@ -1483,6 +1483,15 @@ impl FromIterator<char> for String {
1483
}
1484
1485
1486
+#[stable(feature = "string_from_iter_by_ref", since = "1.17.0")]
1487
+impl<'a> FromIterator<&'a char> for String {
1488
+ fn from_iter<I: IntoIterator<Item = &'a char>>(iter: I) -> String {
1489
+ let mut buf = String::new();
1490
+ buf.extend(iter);
1491
+ buf
1492
+ }
1493
+}
1494
+
1495
#[stable(feature = "rust1", since = "1.0.0")]
1496
impl<'a> FromIterator<&'a str> for String {
1497
fn from_iter<I: IntoIterator<Item = &'a str>>(iter: I) -> String {
0 commit comments