about summary refs log tree commit diff
path: root/src/liballoc/string.rs
diff options
context:
space:
mode:
authorNathan West <Lucretiel@gmail.com>2018-12-05 15:11:32 -0800
committerNathan West <Lucretiel@gmail.com>2018-12-05 15:11:32 -0800
commit823dd8ca334951962e8b192ca1362c08e33d6bcf (patch)
tree3846dedd64476a493b88870e729f68138dcfae1a /src/liballoc/string.rs
parent180dcc3118998ebbe390f876df51f85f1b33407a (diff)
downloadrust-823dd8ca334951962e8b192ca1362c08e33d6bcf.tar.gz
rust-823dd8ca334951962e8b192ca1362c08e33d6bcf.zip
Fixed mutability
Diffstat (limited to 'src/liballoc/string.rs')
-rw-r--r--src/liballoc/string.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs
index ef9a34ec611..6962f2ba852 100644
--- a/src/liballoc/string.rs
+++ b/src/liballoc/string.rs
@@ -1732,11 +1732,11 @@ impl<'a> FromIterator<&'a str> for String {
 #[stable(feature = "extend_string", since = "1.4.0")]
 impl FromIterator<String> for String {
     fn from_iter<I: IntoIterator<Item = String>>(iter: I) -> String {
-        let iterator = iter.into_iter();
+        let mut iterator = iter.into_iter();
 
         match iterator.next() {
             None => String::new(),
-            Some(buf) => {
+            Some(mut buf) => {
                 buf.extend(iterator);
                 buf
             }
@@ -1747,12 +1747,12 @@ impl FromIterator<String> for String {
 #[stable(feature = "herd_cows", since = "1.19.0")]
 impl<'a> FromIterator<Cow<'a, str>> for String {
     fn from_iter<I: IntoIterator<Item = Cow<'a, str>>>(iter: I) -> String {
-        let iterator = iter.into_iter();
+        let mut iterator = iter.into_iter();
 
         match iterator.next() {
             None => String::new(),
             Some(cow) => {
-                let buf = cow.into_owned();
+                let mut buf = cow.into_owned();
                 buf.extend(iterator);
                 buf
             }