From 47df1375c57d79c6328ffac31a9656ac9886e786 Mon Sep 17 00:00:00 2001 From: Michael Layzell Date: Wed, 27 Sep 2017 13:51:02 -0400 Subject: [PATCH] Stop allocating in fmt::Write for nsA[C]String --- components/style/gecko_bindings/nsstring_vendor/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/style/gecko_bindings/nsstring_vendor/src/lib.rs b/components/style/gecko_bindings/nsstring_vendor/src/lib.rs index 5cbcd5998ac..26975ae9a28 100644 --- a/components/style/gecko_bindings/nsstring_vendor/src/lib.rs +++ b/components/style/gecko_bindings/nsstring_vendor/src/lib.rs @@ -988,7 +988,7 @@ impl From for nsCString { // 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(()) } } @@ -1106,7 +1106,7 @@ 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(()) } }