Skip to content

Commit 45423ea

Browse files
jf2048sdroege
authored andcommitted
glib: implement Display for GStr
1 parent 25da37d commit 45423ea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

glib/src/gstring.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ impl Default for &GStr {
165165
}
166166
}
167167

168+
impl fmt::Display for GStr {
169+
#[inline]
170+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
171+
f.write_str(self.as_str())
172+
}
173+
}
174+
168175
impl<'a> TryFrom<&'a CStr> for &'a GStr {
169176
type Error = std::str::Utf8Error;
170177
#[inline]

0 commit comments

Comments
 (0)