From d0b704624533e00c968c84908d6c52802f6efbc1 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 2 Aug 2022 07:28:13 +0300 Subject: [PATCH] quick fix for components w/ optional jar We need tests! --- components/salsa-entity-macros/src/component.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/salsa-entity-macros/src/component.rs b/components/salsa-entity-macros/src/component.rs index c30c2934..90161a47 100644 --- a/components/salsa-entity-macros/src/component.rs +++ b/components/salsa-entity-macros/src/component.rs @@ -111,7 +111,7 @@ fn fn_configuration(args: &Args, item_fn: &syn::ItemFn) -> syn::Result syn::ItemImpl { - let jar_ty = &args.jar_ty; + let jar_ty = args.jar_ty(); parse_quote! { impl salsa::storage::IngredientsFor for #struct_ty { type Ingredients = Self; @@ -202,7 +202,7 @@ fn ref_getter_fn( item_fn: &syn::ItemFn, struct_ty: &syn::Type, ) -> syn::Result { - let jar_ty = &args.jar_ty; + let jar_ty = args.jar_ty(); 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 = make_fn_return_ref(ref_getter_fn)?; @@ -226,7 +226,7 @@ fn setter_fn( ) -> syn::Result { // The setter has *always* the same signature as the original: // 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 mut setter_sig = item_fn.sig.clone(); let value_ty = configuration::value_ty(&item_fn.sig); @@ -321,7 +321,7 @@ fn accumulated_fn( item_fn: &syn::ItemFn, struct_ty: &syn::Type, ) -> syn::Result { - let jar_ty = &args.jar_ty; + let jar_ty = args.jar_ty(); let mut accumulated_fn = item_fn.clone(); accumulated_fn.sig.ident = syn::Ident::new("accumulated", item_fn.sig.ident.span());