author | Michael Layzell <michael@thelayzells.com> |
Wed, 27 Sep 2017 12:19:29 -0700 | |
changeset 383332 | 1e3c2c6f12d16798d2ca82f597205d854c7a5f82 |
parent 383331 | 76abb09a9d97478a4f3db5257d570000de818e27 |
child 383333 | 5d5d1d2271049d89c79f32b295b5859a5ffe7950 |
push id | 95539 |
push user | kwierso@gmail.com |
push date | Thu, 28 Sep 2017 00:01:12 +0000 |
treeherder | mozilla-inbound@72de90e66155 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | froydnj |
bugs | 1403545 |
milestone | 58.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
|
--- a/xpcom/rust/nsstring/src/lib.rs +++ b/xpcom/rust/nsstring/src/lib.rs @@ -979,17 +979,17 @@ impl From<String> for nsCString { fn from(s: String) -> nsCString { s.into_bytes().into() } } // Support for the write!() macro for appending to nsACStrings impl fmt::Write for nsACString { fn write_str(&mut self, s: &str) -> Result<(), fmt::Error> { - self.append(&nsCString::from(s)); + self.append(s); Ok(()) } } impl fmt::Display for nsACString { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { fmt::Display::fmt(&String::from_utf8_lossy(&self[..]), f) } @@ -1097,17 +1097,17 @@ impl<'a> From<&'a String> for nsString { } } // Support for the write!() macro for writing to nsStrings impl fmt::Write for nsAString { fn write_str(&mut self, s: &str) -> Result<(), fmt::Error> { // Directly invoke gecko's routines for appending utf8 strings to // nsAString values, to avoid as much overhead as possible - self.append_utf8(&nsCString::from(s)); + self.append_utf8(s); Ok(()) } } impl fmt::Display for nsAString { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { fmt::Display::fmt(&String::from_utf16_lossy(&self[..]), f) }