From f842b0fc733b48d83d127bf06b264a781e725116 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Sun, 30 Jun 2024 04:39:07 +0200 Subject: jsonrpc: minor tweak to support Rust 1.64.0 --- jsonrpc/src/server/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jsonrpc/src/server/mod.rs b/jsonrpc/src/server/mod.rs index 9d1f5b7..e2c3e3a 100644 --- a/jsonrpc/src/server/mod.rs +++ b/jsonrpc/src/server/mod.rs @@ -301,7 +301,8 @@ impl Server { // Check if the method exists within the service if let Some(method) = service.get_pubsub_method(&req.method_name) { let params = req.msg.params.unwrap_or(serde_json::json!(())); - response.result = match method(channel, req.msg.method, params).await { + let result = method(channel, req.msg.method, params); + response.result = match result.await { Ok(res) => Some(res), Err(err) => return err.to_response(Some(req.msg.id), None), }; @@ -315,7 +316,8 @@ impl Server { // Check if the method exists within the service if let Some(method) = service.get_method(&req.method_name) { let params = req.msg.params.unwrap_or(serde_json::json!(())); - response.result = match method(params).await { + let result = method(params); + response.result = match result.await { Ok(res) => Some(res), Err(err) => return err.to_response(Some(req.msg.id), None), }; -- cgit v1.2.3