From 0257f6ec78bbde04a10a746cbe03b799a76ed38a Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:25:40 +0100 Subject: [PATCH] Remove unwrap --- client/src/transport.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/transport.rs b/client/src/transport.rs index 34b15832..cc876133 100644 --- a/client/src/transport.rs +++ b/client/src/transport.rs @@ -20,7 +20,7 @@ impl ReqwestTransport { R: for<'a> serde::de::Deserialize<'a>, { let response = self.client.post(self.url.clone()).json(&req).send().await?; - Ok(response.json().await?) + response.json().await } } @@ -30,7 +30,7 @@ impl Transport for ReqwestTransport { &self, r: jsonrpc_async::Request<'_>, ) -> Result { - Ok(self.request(r).await.unwrap()) + Ok(self.request(r).await.map_err(|e| jsonrpc_async::Error::Transport(e.into()))?) } async fn send_batch(