diff options
author | hozan23 <hozan23@karyontech.net> | 2024-06-30 04:42:07 +0200 |
---|---|---|
committer | hozan23 <hozan23@karyontech.net> | 2024-06-30 04:42:07 +0200 |
commit | a45bbec25952a15cacb105b536432d6fbe3fb7b1 (patch) | |
tree | 280072dee7350b8a8deca081906f39f50e4dadba /jsonrpc/tests | |
parent | f842b0fc733b48d83d127bf06b264a781e725116 (diff) |
jsonrpc: remove unwrap() and use expect() for examples, docs, and tests
Diffstat (limited to 'jsonrpc/tests')
-rw-r--r-- | jsonrpc/tests/impl_rpc_service.rs | 7 | ||||
-rw-r--r-- | jsonrpc/tests/rpc_impl.rs | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/jsonrpc/tests/impl_rpc_service.rs b/jsonrpc/tests/impl_rpc_service.rs index bb42679..52c5c31 100644 --- a/jsonrpc/tests/impl_rpc_service.rs +++ b/jsonrpc/tests/impl_rpc_service.rs @@ -21,7 +21,10 @@ fn service() { let params = serde_json::json!("params"); smol::block_on(async { - let foo_method = f.get_method("foo").unwrap(); - assert_eq!(foo_method(params.clone()).await.unwrap(), params); + let foo_method = f.get_method("foo").expect("Get method foo"); + assert_eq!( + foo_method(params.clone()).await.expect("Call foo method"), + params + ); }); } diff --git a/jsonrpc/tests/rpc_impl.rs b/jsonrpc/tests/rpc_impl.rs index 64e3bb1..2a24bbf 100644 --- a/jsonrpc/tests/rpc_impl.rs +++ b/jsonrpc/tests/rpc_impl.rs @@ -20,7 +20,10 @@ fn rpc_impl_service() { let params = serde_json::json!("params"); smol::block_on(async { - let foo_method = f.get_method("foo").unwrap(); - assert_eq!(foo_method(params.clone()).await.unwrap(), params); + let foo_method = f.get_method("foo").expect("Get method foo"); + assert_eq!( + foo_method(params.clone()).await.expect("Call foo method"), + params + ); }); } |