Bug 1550556 - remove unnecessary `mut` markings for nsstring variables; r=mccr8
authorNathan Froyd <froydnj@mozilla.com>
Thu, 09 May 2019 20:08:53 +0000
changeset 532114 ff8ab3c73de5155f8ed095acffc3ab62f66fdc02
parent 532113 faddb8bb87a83a223a2e68f6c2b21f6e45ffb948
child 532115 dd551956b3329ccf67cd8d6f279b93f04f79eeab
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1550556
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1550556 - remove unnecessary `mut` markings for nsstring variables; r=mccr8 Newer versions of Rust have started complaining about this by default. Differential Revision: https://phabricator.services.mozilla.com/D30541
xpcom/rust/nsstring/src/conversions.rs
--- a/xpcom/rust/nsstring/src/conversions.rs
+++ b/xpcom/rust/nsstring/src/conversions.rs
@@ -349,17 +349,17 @@ impl nsACString {
         } else {
             // Started with non-ASCII. Compute worst case
             let needed = if let Some(n) = worst_case_needed {
                 n
             } else {
                 times_three(other.len()).ok_or(())?
             };
             let new_len = old_len.checked_add(needed).ok_or(())?;
-            let mut handle = unsafe { self.bulk_write(new_len, old_len, false)? };
+            let handle = unsafe { self.bulk_write(new_len, old_len, false)? };
             (old_len, 0, handle)
         };
         let written =
             convert_utf16_to_utf8(&other[read..], &mut handle.as_mut_slice()[filled..]);
         Ok(handle.finish(filled + written, true))
     }
 
     /// Convert a potentially-invalid UTF-16 string into valid UTF-8
@@ -621,17 +621,17 @@ impl nsACString {
             } else {
                 // Started with non-ASCII. Assume worst case.
                 let needed = if let Some(n) = worst_case_needed {
                     n
                 } else {
                     other.len().checked_mul(2).ok_or(())?
                 };
                 let new_len = old_len.checked_add(needed).ok_or(())?;
-                let mut handle = unsafe { self.bulk_write(new_len, old_len, false)? };
+                let handle = unsafe { self.bulk_write(new_len, old_len, false)? };
                 (old_len, 0, handle)
             }
         };
         let written =
             convert_latin1_to_utf8(&other[read..], &mut handle.as_mut_slice()[filled..]);
         Ok(handle.finish(filled + written, true))
     }