Skip to content

Commit

Permalink
fix lifetime signature for provider proc-macro for method not handled. (
Browse files Browse the repository at this point in the history
#90)

(applies to HttpServer provider, which doesn't receive messages from
    acrots)

Signed-off-by: stevelr <[email protected]>
  • Loading branch information
stevelr authored Mar 2, 2022
1 parent 2c9abde commit c9004af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
12 changes: 6 additions & 6 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Message<'msg>, RpcError> {
async fn dispatch<'disp__,'ctx__,'msg__>(
&'disp__ self,
ctx: &'ctx__ Context,
message: Message<'msg__>,
) -> std::result::Result<Message<'msg__>, RpcError> {
let (trait_name, trait_method) = message
.method
.rsplit_once('.')
Expand Down Expand Up @@ -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<Message<'_>, RpcError> {
async fn dispatch<'disp__,'ctx__,'msg__>(&'disp__ self, _ctx: &'ctx__ Context, message: wasmbus_rpc::common::Message<'msg__>) -> std::result::Result<Message<'msg__>, RpcError> {
Err(RpcError::MethodNotHandled(message.method.to_string()))
}
}
Expand Down

0 comments on commit c9004af

Please sign in to comment.