Skip to content

Commit dc3630a

Browse files
committed
glib: implement Display for GStr
1 parent 94d26e7 commit dc3630a

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
@@ -140,6 +140,13 @@ impl Default for &GStr {
140140
}
141141
}
142142

143+
impl fmt::Display for GStr {
144+
#[inline]
145+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
146+
f.write_str(self.as_str())
147+
}
148+
}
149+
143150
impl<'a> TryFrom<&'a CStr> for &'a GStr {
144151
type Error = std::str::Utf8Error;
145152
#[inline]

0 commit comments

Comments
 (0)