Skip to content

Commit f3799c2

Browse files
committed
glib-macros: add some generic comments for property notifications
1 parent 3581e84 commit f3799c2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

glib-macros/src/properties.rs

+4
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,9 @@ fn expand_impl_connect_prop_notify(props: &[PropDesc]) -> Vec<syn::ImplItemFn> {
676676
let stripped_name = strip_raw_prefix_from_name(name);
677677
let fn_ident = format_ident!("connect_{}_notify", name_to_ident(name));
678678
let span = p.attrs_span;
679+
let doc = format!("Listen for notifications of a change in the `{}` property", name.value());
679680
parse_quote_spanned!(span=>
681+
#[doc = #doc]
680682
#[allow(dead_code)]
681683
pub fn #fn_ident<F: Fn(&Self) + 'static>(&self, f: F) -> #crate_ident::SignalHandlerId {
682684
self.connect_notify_local(::core::option::Option::Some(#stripped_name), move |this, _| {
@@ -695,7 +697,9 @@ fn expand_impl_notify_prop(wrapper_type: &syn::Path, props: &[PropDesc]) -> Vec<
695697
let fn_ident = format_ident!("notify_{}", name_to_ident(&name));
696698
let span = p.attrs_span;
697699
let enum_ident = name_to_enum_ident(name.value());
700+
let doc = format!("Notify listeners of a change in the `{}` property", name.value());
698701
parse_quote_spanned!(span=>
702+
#[doc = #doc]
699703
#[allow(dead_code)]
700704
pub fn #fn_ident(&self) {
701705
self.notify_by_pspec(

0 commit comments

Comments
 (0)