diff options
author | hozan23 <hozan23@karyontech.net> | 2024-06-30 04:39:07 +0200 |
---|---|---|
committer | hozan23 <hozan23@karyontech.net> | 2024-06-30 04:39:07 +0200 |
commit | f842b0fc733b48d83d127bf06b264a781e725116 (patch) | |
tree | b6e23200098d2e6d51eedbb58fad2ea8da15a6f1 /jsonrpc | |
parent | 4dc6ae61c66d2ecedb3dbd519dde89e8afc727a9 (diff) |
jsonrpc: minor tweak to support Rust 1.64.0
Diffstat (limited to 'jsonrpc')
-rw-r--r-- | jsonrpc/src/server/mod.rs | 6 |
1 files 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), }; |