diff --git a/sylvia-derive/src/contract/communication/reply.rs b/sylvia-derive/src/contract/communication/reply.rs index 78dadd86..7c403501 100644 --- a/sylvia-derive/src/contract/communication/reply.rs +++ b/sylvia-derive/src/contract/communication/reply.rs @@ -161,15 +161,15 @@ impl<'a> ReplyData<'a> { fn emit_match_arms(&self, contract: &Type, generics: &[&GenericParam]) -> TokenStream { let Self { reply_id, handlers } = self; - let contract_turbo: Type = if !generics.is_empty() { + let contract_turbofish: Type = if !generics.is_empty() { let contract_name = StripGenerics.fold_type((contract.clone()).clone()); parse_quote! { #contract_name :: < #(#generics),* > } } else { parse_quote! { #contract } }; - let success_match_arm = emit_success_match_arm(handlers, &contract_turbo); - let failure_match_arm = emit_failure_match_arm(handlers, &contract_turbo); + let success_match_arm = emit_success_match_arm(handlers, &contract_turbofish); + let failure_match_arm = emit_failure_match_arm(handlers, &contract_turbofish); quote! { #reply_id => { @@ -185,7 +185,10 @@ impl<'a> ReplyData<'a> { /// Emits match arm for [ReplyOn::Success]. /// In case neither [ReplyOn::Success] nor [ReplyOn::Always] is present, `Response::events` /// and `Response::data` are forwarded in the `Response` -fn emit_success_match_arm(handlers: &[(&Ident, ReplyOn)], contract_turbo: &Type) -> TokenStream { +fn emit_success_match_arm( + handlers: &[(&Ident, ReplyOn)], + contract_turbofish: &Type, +) -> TokenStream { let sylvia = crate_module(); match handlers @@ -196,12 +199,12 @@ fn emit_success_match_arm(handlers: &[(&Ident, ReplyOn)], contract_turbo: &Type) #sylvia ::cw_std::SubMsgResult::Ok(sub_msg_resp) => { #[allow(deprecated)] let #sylvia ::cw_std::SubMsgResponse { events, data, msg_responses} = sub_msg_resp; - #contract_turbo ::new(). #function_name ((deps, env, gas_used, events, msg_responses).into(), data, payload) + #contract_turbofish ::new(). #function_name ((deps, env, gas_used, events, msg_responses).into(), data, payload) } }, Some((function_name, reply_on)) if reply_on == &ReplyOn::Always => quote! { #sylvia ::cw_std::SubMsgResult::Ok(_) => { - #contract_turbo ::new(). #function_name ((deps, env, gas_used, vec![], vec![]).into(), result, payload) + #contract_turbofish ::new(). #function_name ((deps, env, gas_used, vec![], vec![]).into(), result, payload) } }, _ => quote! { @@ -222,7 +225,10 @@ fn emit_success_match_arm(handlers: &[(&Ident, ReplyOn)], contract_turbo: &Type) /// Emits match arm for [ReplyOn::Failure]. /// In case neither [ReplyOn::Failure] nor [ReplyOn::Always] is present, /// the error is forwarded. -fn emit_failure_match_arm(handlers: &[(&Ident, ReplyOn)], contract_turbo: &Type) -> TokenStream { +fn emit_failure_match_arm( + handlers: &[(&Ident, ReplyOn)], + contract_turbofish: &Type, +) -> TokenStream { let sylvia = crate_module(); match handlers @@ -231,12 +237,12 @@ fn emit_failure_match_arm(handlers: &[(&Ident, ReplyOn)], contract_turbo: &Type) { Some((function_name, reply_on)) if reply_on == &ReplyOn::Failure => quote! { #sylvia ::cw_std::SubMsgResult::Err(error) => { - #contract_turbo ::new(). #function_name ((deps, env, gas_used, vec![], vec![]).into(), error, payload) + #contract_turbofish ::new(). #function_name ((deps, env, gas_used, vec![], vec![]).into(), error, payload) } }, Some((function_name, reply_on)) if reply_on == &ReplyOn::Always => quote! { #sylvia ::cw_std::SubMsgResult::Err(_) => { - #contract_turbo ::new(). #function_name ((deps, env, gas_used, vec![], vec![]).into(), result, payload) + #contract_turbofish ::new(). #function_name ((deps, env, gas_used, vec![], vec![]).into(), result, payload) } }, _ => quote! { diff --git a/sylvia-derive/src/contract/mt.rs b/sylvia-derive/src/contract/mt.rs index 185614e6..2da8aa17 100644 --- a/sylvia-derive/src/contract/mt.rs +++ b/sylvia-derive/src/contract/mt.rs @@ -533,7 +533,7 @@ impl<'a> MtHelpers<'a> { .as_ref() .map(|_reply| { let contract_ident = get_ident_from_type(contract_name); - let contract_turbo = if !generic_params.is_empty() { + let contract_turbofish = if !generic_params.is_empty() { quote! { #contract_ident ::< #(#generic_params,)* > } } else { quote! { #contract_ident } @@ -541,7 +541,7 @@ impl<'a> MtHelpers<'a> { if cfg!(feature = "sv_replies") { quote! { - let contract = #contract_turbo ::new(); + let contract = #contract_turbofish ::new(); dispatch_reply(deps, env, msg, contract).map_err(Into::into) } } else { diff --git a/sylvia-derive/src/entry_points.rs b/sylvia-derive/src/entry_points.rs index 11591f2a..611c4aff 100644 --- a/sylvia-derive/src/entry_points.rs +++ b/sylvia-derive/src/entry_points.rs @@ -177,7 +177,7 @@ impl<'a> EntryPoints<'a> { let sylvia = crate_module(); let attr_generics = &attrs.generics; - let (contract, contract_turbo) = if attr_generics.is_empty() { + let (contract, contract_turbofish) = if attr_generics.is_empty() { (quote! { #name }, quote! { #name }) } else { ( @@ -202,14 +202,14 @@ impl<'a> EntryPoints<'a> { }; let dispatch = match msg_ty { MsgType::Reply if cfg!(feature = "sv_replies") => quote! { - let contract = #contract_turbo ::new(); + let contract = #contract_turbofish ::new(); sv::dispatch_reply(deps, env, msg, contract).map_err(Into::into) }, MsgType::Reply => quote! { - #contract_turbo ::new(). #reply((deps, env).into(), msg).map_err(Into::into) + #contract_turbofish ::new(). #reply((deps, env).into(), msg).map_err(Into::into) }, _ => quote! { - msg.dispatch(& #contract_turbo ::new() , ( #values )).map_err(Into::into) + msg.dispatch(& #contract_turbofish ::new() , ( #values )).map_err(Into::into) }, };