Skip to content

Commit

Permalink
Fix docs of glib::derived_properties
Browse files Browse the repository at this point in the history
There was a typo and I think a clear example doesn't hurt either.
  • Loading branch information
Hofer-Julian authored and bilelmoussaoui committed Aug 1, 2023
1 parent 751e1dd commit 3fa1b3b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions glib-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1001,9 +1001,14 @@ pub fn derive_props(input: TokenStream) -> TokenStream {
properties::impl_derive_props(input)
}

/// This macro is shorteng for:
///
/// When applied to `ObjectImpl`
/// ```ignore
/// #[glib::derived_properties]
/// impl ObjectImpl for CustomObject
/// ```
/// this macro generates
/// ```ignore
/// impl ObjectImpl for CustomObject {
/// fn properties() -> &'static [glib::ParamSpec] {
/// Self::derived_properties()
/// }
Expand All @@ -1013,9 +1018,8 @@ pub fn derive_props(input: TokenStream) -> TokenStream {
/// fn property(&self, id: usize, pspec: &glib::ParamSpec) -> glib::Value {
/// self.derived_property(id, pspec)
/// }
/// }
/// ```
///
/// for ObjectImpl trait implementation
#[proc_macro_attribute]
#[proc_macro_error]
pub fn derived_properties(_attr: TokenStream, item: TokenStream) -> TokenStream {
Expand Down

0 comments on commit 3fa1b3b

Please sign in to comment.