mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-28 15:26:34 +00:00
quick fix for components w/ optional jar
We need tests!
This commit is contained in:
parent
9eed580f51
commit
d0b7046245
1 changed files with 4 additions and 4 deletions
|
@ -111,7 +111,7 @@ fn fn_configuration(args: &Args, item_fn: &syn::ItemFn) -> syn::Result<Configura
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ingredients_for_impl(args: &Args, struct_ty: &syn::Type) -> syn::ItemImpl {
|
fn ingredients_for_impl(args: &Args, struct_ty: &syn::Type) -> syn::ItemImpl {
|
||||||
let jar_ty = &args.jar_ty;
|
let jar_ty = args.jar_ty();
|
||||||
parse_quote! {
|
parse_quote! {
|
||||||
impl salsa::storage::IngredientsFor for #struct_ty {
|
impl salsa::storage::IngredientsFor for #struct_ty {
|
||||||
type Ingredients = Self;
|
type Ingredients = Self;
|
||||||
|
@ -202,7 +202,7 @@ fn ref_getter_fn(
|
||||||
item_fn: &syn::ItemFn,
|
item_fn: &syn::ItemFn,
|
||||||
struct_ty: &syn::Type,
|
struct_ty: &syn::Type,
|
||||||
) -> syn::Result<syn::ItemFn> {
|
) -> syn::Result<syn::ItemFn> {
|
||||||
let jar_ty = &args.jar_ty;
|
let jar_ty = args.jar_ty();
|
||||||
let mut ref_getter_fn = item_fn.clone();
|
let mut ref_getter_fn = item_fn.clone();
|
||||||
ref_getter_fn.sig.ident = syn::Ident::new("get", item_fn.sig.ident.span());
|
ref_getter_fn.sig.ident = syn::Ident::new("get", item_fn.sig.ident.span());
|
||||||
ref_getter_fn = make_fn_return_ref(ref_getter_fn)?;
|
ref_getter_fn = make_fn_return_ref(ref_getter_fn)?;
|
||||||
|
@ -226,7 +226,7 @@ fn setter_fn(
|
||||||
) -> syn::Result<syn::ImplItemMethod> {
|
) -> syn::Result<syn::ImplItemMethod> {
|
||||||
// The setter has *always* the same signature as the original:
|
// The setter has *always* the same signature as the original:
|
||||||
// but it takes a value arg and has no return type.
|
// but it takes a value arg and has no return type.
|
||||||
let jar_ty = &args.jar_ty;
|
let jar_ty = args.jar_ty();
|
||||||
let (db_var, arg_names) = fn_args(item_fn)?;
|
let (db_var, arg_names) = fn_args(item_fn)?;
|
||||||
let mut setter_sig = item_fn.sig.clone();
|
let mut setter_sig = item_fn.sig.clone();
|
||||||
let value_ty = configuration::value_ty(&item_fn.sig);
|
let value_ty = configuration::value_ty(&item_fn.sig);
|
||||||
|
@ -321,7 +321,7 @@ fn accumulated_fn(
|
||||||
item_fn: &syn::ItemFn,
|
item_fn: &syn::ItemFn,
|
||||||
struct_ty: &syn::Type,
|
struct_ty: &syn::Type,
|
||||||
) -> syn::Result<syn::ItemFn> {
|
) -> syn::Result<syn::ItemFn> {
|
||||||
let jar_ty = &args.jar_ty;
|
let jar_ty = args.jar_ty();
|
||||||
|
|
||||||
let mut accumulated_fn = item_fn.clone();
|
let mut accumulated_fn = item_fn.clone();
|
||||||
accumulated_fn.sig.ident = syn::Ident::new("accumulated", item_fn.sig.ident.span());
|
accumulated_fn.sig.ident = syn::Ident::new("accumulated", item_fn.sig.ident.span());
|
||||||
|
|
Loading…
Reference in a new issue