mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 21:21:11 +00:00
Simplify some Option / Result / ? operator patterns (#8653)
* Simplify some Option / Result / ? operator patterns When those match a combinator exactly. Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust). * adjust after review * adjust post-review
This commit is contained in:
committed by
GitHub
parent
541692c4a8
commit
052be8bbef
@@ -722,13 +722,10 @@ fn maybe_share_remote_request<Block: BlockT, Requests, V, IssueRequest, IssueReq
|
||||
fn display_error<F, T>(future: F) -> impl std::future::Future<Output=Result<T, ()>> where
|
||||
F: std::future::Future<Output=Result<T, Error>>
|
||||
{
|
||||
future.then(|result| ready(match result {
|
||||
Ok(result) => Ok(result),
|
||||
Err(err) => {
|
||||
future.then(|result| ready(result.or_else(|err| {
|
||||
warn!("Remote request for subscription data has failed with: {:?}", err);
|
||||
Err(())
|
||||
},
|
||||
}))
|
||||
})))
|
||||
}
|
||||
|
||||
/// Convert successful future result into Ok(Some(result)) and error into Ok(None),
|
||||
|
||||
Reference in New Issue
Block a user