From f9036b9e890a955b1a0e2fdde3bf9712360a8ca0 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Sat, 12 Oct 2024 22:31:49 +0200 Subject: fix jsonrpc/tests --- Cargo.toml | 3 +-- jsonrpc/impl/src/lib.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ddf7d4e..1cbc80e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ resolver = "2" # Please ensure that each crate comes before any other crate that depends on it -members = ["core", "net", "p2p", "jsonrpc"] +members = ["core", "net", "net/async_rustls", "jsonrpc", "jsonrpc/impl", "p2p"] [workspace.package] description = "A library for building p2p, decentralized, and collaborative software" @@ -24,7 +24,6 @@ karyon_jsonrpc_macro = { path = "jsonrpc/impl", version = "0.1.6", default-featu karyon_p2p = { path = "p2p", version = "0.1.6", default-features = false } - log = "0.4" thiserror = "1.0" chrono = "0.4" diff --git a/jsonrpc/impl/src/lib.rs b/jsonrpc/impl/src/lib.rs index 8814e61..d7ea466 100644 --- a/jsonrpc/impl/src/lib.rs +++ b/jsonrpc/impl/src/lib.rs @@ -54,9 +54,9 @@ pub fn rpc_impl(_attr: TokenStream, item: TokenStream) -> TokenStream { let item: TokenStream2 = item.into(); quote! { impl karyon_jsonrpc::RPCService for #self_ty { - fn get_method<'a>( - &'a self, - name: &'a str + fn get_method( + &self, + name: &str ) -> Option { match name { #(#impl_methods)* @@ -115,9 +115,9 @@ pub fn rpc_pubsub_impl(_attr: TokenStream, item: TokenStream) -> TokenStream { let item: TokenStream2 = item.into(); quote! { impl karyon_jsonrpc::PubSubRPCService for #self_ty { - fn get_pubsub_method<'a>( - &'a self, - name: &'a str + fn get_pubsub_method( + &self, + name: &str ) -> Option { match name { #(#impl_methods)* -- cgit v1.2.3