Fix clippy

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2023-05-22 17:42:53 +03:00
parent 96b428c8b4
commit 5a04b21f7a
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -280,7 +280,7 @@ impl std::str::FromStr for RpcResponse {
}
// Check if the response can be mapped as an RPC method response.
let result: Result<Response, _> = serde_json::from_str(&response);
let result: Result<Response, _> = serde_json::from_str(response);
if let Ok(response) = result {
return Ok(RpcResponse::Method {
id: response.id,
@@ -288,7 +288,7 @@ impl std::str::FromStr for RpcResponse {
});
}
let notification: ResponseNotification = serde_json::from_str(&response)?;
let notification: ResponseNotification = serde_json::from_str(response)?;
Ok(RpcResponse::Subscription {
id: notification.params.subscription,
method: notification.method,
+3 -3
View File
@@ -282,7 +282,7 @@ impl RpcClientT for LightClient {
id, method, params
);
tracing::trace!(target: LOG_TARGET, "Submit request {:?}", request);
let chain_id = data.chain_id.clone();
let chain_id = data.chain_id;
data.client
.json_rpc_request(request, chain_id)
@@ -338,7 +338,7 @@ impl RpcClientT for LightClient {
id, sub, params
);
let chain_id = data.chain_id.clone();
let chain_id = data.chain_id;
data.client
.json_rpc_request(request, chain_id)
.map_err(|err| {
@@ -368,7 +368,7 @@ impl RpcClientT for LightClient {
let rpc_substription_stream: Pin<
Box<dyn Stream<Item = Result<Box<RawValue>, RpcError>> + Send + 'static>,
> = Box::pin(stream.map(|res| Ok(res)));
> = Box::pin(stream.map(Ok));
let rpc_subscription: RpcSubscription = RpcSubscription {
stream: rpc_substription_stream,