From 77deb689a28474cc4ac79d1c77863db58630a1ef Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sat, 21 Nov 2020 16:52:38 +0100 Subject: [PATCH] Replace write!() with write_str() --- cairo/src/surface_macros.rs | 2 +- glib/src/gstring.rs | 2 +- glib/src/string.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cairo/src/surface_macros.rs b/cairo/src/surface_macros.rs index 94b116fed86d..79fd53587efd 100644 --- a/cairo/src/surface_macros.rs +++ b/cairo/src/surface_macros.rs @@ -94,7 +94,7 @@ macro_rules! declare_surface { impl fmt::Display for $surf_name { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", stringify!($surf_name)) + f.write_str(stringify!($surf_name)) } } }; diff --git a/glib/src/gstring.rs b/glib/src/gstring.rs index f926f0436e65..bdc00e1e2e34 100644 --- a/glib/src/gstring.rs +++ b/glib/src/gstring.rs @@ -101,7 +101,7 @@ impl Drop for GString { impl fmt::Display for GString { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.as_str()) + f.write_str(self.as_str()) } } diff --git a/glib/src/string.rs b/glib/src/string.rs index 83ec840081fb..30a6cb46cca8 100644 --- a/glib/src/string.rs +++ b/glib/src/string.rs @@ -112,13 +112,13 @@ impl Default for String { impl fmt::Debug for String { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.to_string_lossy()) + f.write_str(&self.to_string_lossy()) } } impl fmt::Display for String { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.to_string_lossy()) + f.write_str(&self.to_string_lossy()) } }