mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 04:11:07 +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
@@ -183,10 +183,7 @@ impl HttpApi {
|
||||
) -> Result<(), HttpError> {
|
||||
// Extract the request from the list.
|
||||
// Don't forget to add it back if necessary when returning.
|
||||
let mut request = match self.requests.remove(&request_id) {
|
||||
None => return Err(HttpError::Invalid),
|
||||
Some(r) => r,
|
||||
};
|
||||
let mut request = self.requests.remove(&request_id).ok_or_else(|| HttpError::Invalid)?;
|
||||
|
||||
let mut deadline = timestamp::deadline_to_future(deadline);
|
||||
// Closure that writes data to a sender, taking the deadline into account. Can return `Ok`
|
||||
|
||||
Reference in New Issue
Block a user