Skip to content

Commit 039e7d5

Browse files
carlosmnbilelmoussaoui
authored andcommitted
examples: add some docs to the example using the Properties macro
These will be used later on by the macro.
1 parent d8a6229 commit 039e7d5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/object_subclass/author.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ mod imp {
1414
#[derive(Properties, Default)]
1515
#[properties(wrapper_type = super::Author)]
1616
pub struct Author {
17+
/// The name of the author
18+
///
19+
/// Just their given name, not their surname.
1720
#[property(get, set)]
21+
/// A helpful name-surname combination.
22+
#[property(name = "name-surname", get = |author: &Self| format!("{} {}", author.name.borrow(), author.surname.borrow()))]
1823
name: RefCell<String>,
1924
#[property(get, set)]
2025
surname: RefCell<String>,

0 commit comments

Comments
 (0)