From c9004af99981c83d097b593b0489f9caf42a3887 Mon Sep 17 00:00:00 2001 From: stevelr Date: Tue, 1 Mar 2022 17:22:45 -0800 Subject: [PATCH] fix lifetime signature for provider proc-macro for method not handled. (#90) (applies to HttpServer provider, which doesn't receive messages from acrots) Signed-off-by: stevelr --- macros/Cargo.toml | 2 +- macros/src/lib.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/macros/Cargo.toml b/macros/Cargo.toml index b9c060d..aa2d8ab 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wasmbus-macros" -version = "0.1.8" +version = "0.1.9" edition = "2021" authors = [ "wasmcloud Team" ] license = "Apache-2.0" diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 3dbcf70..1c596b1 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -195,11 +195,11 @@ fn gen_dispatch(traits: &[syn::Path], ident: &Ident) -> TokenStream2 { quote!( #[async_trait] impl MessageDispatch for #ident { - async fn dispatch<'disp,'ctx,'msg>( - &'disp self, - ctx: &'ctx Context, - message: Message<'msg>, - ) -> std::result::Result, RpcError> { + async fn dispatch<'disp__,'ctx__,'msg__>( + &'disp__ self, + ctx: &'ctx__ Context, + message: Message<'msg__>, + ) -> std::result::Result, RpcError> { let (trait_name, trait_method) = message .method .rsplit_once('.') @@ -227,7 +227,7 @@ fn gen_empty_dispatch(ident: &Ident) -> TokenStream2 { quote!( #[async_trait] impl MessageDispatch for #ident { - async fn dispatch(&self,_ctx: &Context,message: Message<'_>)->std::result::Result, RpcError> { + async fn dispatch<'disp__,'ctx__,'msg__>(&'disp__ self, _ctx: &'ctx__ Context, message: wasmbus_rpc::common::Message<'msg__>) -> std::result::Result, RpcError> { Err(RpcError::MethodNotHandled(message.method.to_string())) } }