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

Commit b0f10fd

Browse files
committed
Implement Clone and Debug on Property
1 parent d338131 commit b0f10fd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/subclass/object.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use ffi;
99
use gobject_ffi;
1010

1111
use std::borrow::Borrow;
12+
use std::fmt;
1213
use std::mem;
1314
use std::ptr;
1415

@@ -134,8 +135,15 @@ unsafe extern "C" fn constructed<T: ObjectSubclass>(obj: *mut gobject_ffi::GObje
134135
}
135136

136137
/// Definition of a property.
138+
#[derive(Clone)]
137139
pub struct Property<'a>(pub &'a str, pub fn(&str) -> ::ParamSpec);
138140

141+
impl<'a> fmt::Debug for Property<'a> {
142+
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
143+
f.debug_tuple("Property").field(&self.0).finish()
144+
}
145+
}
146+
139147
/// Extension trait for `glib::Object`'s class struct.
140148
///
141149
/// This contains various class methods and allows subclasses to override the virtual methods.

0 commit comments

Comments
 (0)