Clippy work towards rust 1.38 (#6219)
This commit is contained in:
@@ -61,9 +61,11 @@ impl RpcClient {
|
||||
Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
"Received result of an unexpected type",
|
||||
))?;
|
||||
)
|
||||
.into())
|
||||
} else {
|
||||
Ok(signature.as_str().unwrap().to_string())
|
||||
}
|
||||
Ok(signature.as_str().unwrap().to_string())
|
||||
}
|
||||
|
||||
pub fn get_signature_status(
|
||||
@@ -195,14 +197,11 @@ impl RpcClient {
|
||||
send_retries - 1
|
||||
};
|
||||
if send_retries == 0 {
|
||||
if status.is_some() {
|
||||
status.unwrap()?
|
||||
} else {
|
||||
Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
format!("Transaction {:?} failed: {:?}", signature_str, status),
|
||||
))?;
|
||||
}
|
||||
return Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
format!("Transaction {:?} failed: {:?}", signature_str, status),
|
||||
)
|
||||
.into());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -262,7 +261,7 @@ impl RpcClient {
|
||||
}
|
||||
|
||||
if send_retries == 0 {
|
||||
Err(io::Error::new(io::ErrorKind::Other, "Transactions failed"))?;
|
||||
return Err(io::Error::new(io::ErrorKind::Other, "Transactions failed").into());
|
||||
}
|
||||
send_retries -= 1;
|
||||
|
||||
|
@@ -53,10 +53,11 @@ impl GenericRpcClientRequest for RpcClientRequest {
|
||||
Ok(mut response) => {
|
||||
let json: serde_json::Value = serde_json::from_str(&response.text()?)?;
|
||||
if json["error"].is_object() {
|
||||
Err(RpcError::RpcRequestError(format!(
|
||||
return Err(RpcError::RpcRequestError(format!(
|
||||
"RPC Error response: {}",
|
||||
serde_json::to_string(&json["error"]).unwrap()
|
||||
)))?
|
||||
))
|
||||
.into());
|
||||
}
|
||||
return Ok(json["result"].clone());
|
||||
}
|
||||
@@ -66,7 +67,7 @@ impl GenericRpcClientRequest for RpcClientRequest {
|
||||
request, retries, e
|
||||
);
|
||||
if retries == 0 {
|
||||
Err(e)?;
|
||||
return Err(e.into());
|
||||
}
|
||||
retries -= 1;
|
||||
|
||||
|
@@ -339,7 +339,7 @@ impl SyncClient for ThinClient {
|
||||
}
|
||||
Err(e) => {
|
||||
self.optimizer.report(index, std::u64::MAX);
|
||||
Err(e)?
|
||||
Err(e.into())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -380,7 +380,7 @@ impl SyncClient for ThinClient {
|
||||
}
|
||||
Err(e) => {
|
||||
self.optimizer.report(index, std::u64::MAX);
|
||||
Err(e)?
|
||||
Err(e.into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user