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

Commit

Permalink
Implement Clone and Debug on Property
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege committed Feb 7, 2019
1 parent d338131 commit b0f10fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/subclass/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use ffi;
use gobject_ffi;

use std::borrow::Borrow;
use std::fmt;
use std::mem;
use std::ptr;

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

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

impl<'a> fmt::Debug for Property<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
f.debug_tuple("Property").field(&self.0).finish()
}
}

/// Extension trait for `glib::Object`'s class struct.
///
/// This contains various class methods and allows subclasses to override the virtual methods.
Expand Down

0 comments on commit b0f10fd

Please sign in to comment.