Skip to content

Commit 7f9be49

Browse files
committed
glib: Implement Default for GString
1 parent 130b601 commit 7f9be49

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

glib/src/gstring.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,12 @@ impl GString {
433433
}
434434
}
435435

436+
impl Default for GString {
437+
fn default() -> Self {
438+
unsafe { GStr::from_bytes_with_nul_unchecked(b"\0") }.to_owned()
439+
}
440+
}
441+
436442
impl Clone for GString {
437443
fn clone(&self) -> GString {
438444
self.as_gstr().to_owned()

0 commit comments

Comments
 (0)