Improve doc comments

This commit is contained in:
Roberto Vidal 2019-04-06 14:22:31 +02:00
parent c39ce43050
commit 01c03b85b1

View file

@ -208,24 +208,33 @@ pub(crate) fn query_group(args: TokenStream, input: TokenStream) -> TokenStream
let set_constant_fn_name =
Ident::new(&format!("set_constant_{}", fn_name), fn_name.span());
let set_fn_docs = format!("
Set the value of the `{fn_name}` input.
See `{fn_name}` for details.
*Note:* Setting values will trigger cancellation
of any ongoing queries; this method blocks until
those queries have been cancelled.
", fn_name = fn_name);
let set_constant_fn_docs = format!("
Set the value of the `{fn_name}` input and promise
that its value will never change again.
See `{fn_name}` for details.
*Note:* Setting values will trigger cancellation
of any ongoing queries; this method blocks until
those queries have been cancelled.
", fn_name = fn_name);
query_fn_declarations.extend(quote! {
/// Set the value of the `#fn_name` input.
///
/// See [`#fn_name()`][] for details.
///
/// *Note:* Setting values will trigger cancellation
/// of any ongoing queries; this method blocks until
/// those queries have been cancelled.
# [doc = #set_fn_docs]
fn #set_fn_name(&mut self, #(#key_names: #keys,)* value__: #value);
/// Set the value of the `#fn_name` input and promise
/// that its value will never change again.
///
/// See [`#fn_name()`][] for details.
///
/// *Note:* Setting values will trigger cancellation
/// of any ongoing queries; this method blocks until
/// those queries have been cancelled.
# [doc = #set_constant_fn_docs]
fn #set_constant_fn_name(&mut self, #(#key_names: #keys,)* value__: #value);
});