Skip to content

Commit 3fa1b3b

Browse files
Hofer-Julianbilelmoussaoui
authored andcommitted
Fix docs of glib::derived_properties
There was a typo and I think a clear example doesn't hurt either.
1 parent 751e1dd commit 3fa1b3b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

glib-macros/src/lib.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,9 +1001,14 @@ pub fn derive_props(input: TokenStream) -> TokenStream {
10011001
properties::impl_derive_props(input)
10021002
}
10031003

1004-
/// This macro is shorteng for:
1005-
///
1004+
/// When applied to `ObjectImpl`
1005+
/// ```ignore
1006+
/// #[glib::derived_properties]
1007+
/// impl ObjectImpl for CustomObject
1008+
/// ```
1009+
/// this macro generates
10061010
/// ```ignore
1011+
/// impl ObjectImpl for CustomObject {
10071012
/// fn properties() -> &'static [glib::ParamSpec] {
10081013
/// Self::derived_properties()
10091014
/// }
@@ -1013,9 +1018,8 @@ pub fn derive_props(input: TokenStream) -> TokenStream {
10131018
/// fn property(&self, id: usize, pspec: &glib::ParamSpec) -> glib::Value {
10141019
/// self.derived_property(id, pspec)
10151020
/// }
1021+
/// }
10161022
/// ```
1017-
///
1018-
/// for ObjectImpl trait implementation
10191023
#[proc_macro_attribute]
10201024
#[proc_macro_error]
10211025
pub fn derived_properties(_attr: TokenStream, item: TokenStream) -> TokenStream {

0 commit comments

Comments
 (0)