mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-02-05 19:30:41 +00:00
Improve doc comments
This commit is contained in:
parent
c39ce43050
commit
01c03b85b1
1 changed files with 24 additions and 15 deletions
|
@ -208,24 +208,33 @@ pub(crate) fn query_group(args: TokenStream, input: TokenStream) -> TokenStream
|
||||||
let set_constant_fn_name =
|
let set_constant_fn_name =
|
||||||
Ident::new(&format!("set_constant_{}", fn_name), fn_name.span());
|
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! {
|
query_fn_declarations.extend(quote! {
|
||||||
/// Set the value of the `#fn_name` input.
|
# [doc = #set_fn_docs]
|
||||||
///
|
|
||||||
/// 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 #set_fn_name(&mut self, #(#key_names: #keys,)* value__: #value);
|
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.
|
# [doc = #set_constant_fn_docs]
|
||||||
///
|
|
||||||
/// 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 #set_constant_fn_name(&mut self, #(#key_names: #keys,)* value__: #value);
|
fn #set_constant_fn_name(&mut self, #(#key_names: #keys,)* value__: #value);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue