Skip to content

Commit

Permalink
examples: add some docs to the example using the Properties macro
Browse files Browse the repository at this point in the history
These will be used later on by the macro.
  • Loading branch information
carlosmn committed Aug 26, 2024
1 parent a9c1b6a commit 98201f9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/object_subclass/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ mod imp {
#[derive(Properties, Default)]
#[properties(wrapper_type = super::Author)]
pub struct Author {
/// The name of the author
///
/// Just their given name, not their surname.
#[property(get, set)]
/// A helpful name-surname combination.
#[property(name = "name-surname", get = |author: &Self| format!("{} {}", author.name.borrow(), author.surname.borrow()))]
name: RefCell<String>,
#[property(get, set)]
surname: RefCell<String>,
Expand Down

0 comments on commit 98201f9

Please sign in to comment.