Write CxxString fmt impls in terms of to_string_lossy
diff --git a/src/cxx_string.rs b/src/cxx_string.rs
index f2cca5b..6b69435 100644
--- a/src/cxx_string.rs
+++ b/src/cxx_string.rs
@@ -80,12 +80,12 @@
impl Display for CxxString {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- Display::fmt(&String::from_utf8_lossy(self.as_bytes()), f)
+ Display::fmt(self.to_string_lossy().as_ref(), f)
}
}
impl Debug for CxxString {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- Debug::fmt(&String::from_utf8_lossy(self.as_bytes()), f)
+ Debug::fmt(self.to_string_lossy().as_ref(), f)
}
}