Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
Improve Debug impl for Variant
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege committed Jun 10, 2019
1 parent 51f2c04 commit ea4c011
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,11 @@ unsafe impl Sync for Variant { }

impl fmt::Debug for Variant {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_fmt(format_args!("Variant {{ ptr: {:?}, type: \"{}\", value: {} }}",
self.to_glib_none().0, self.type_(), self))
f.debug_struct("Variant")
.field("ptr", &self.to_glib_none().0)
.field("type", &self.type_())
.field("value", &self.to_string())
.finish()
}
}

Expand Down

0 comments on commit ea4c011

Please sign in to comment.