mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 14:01:02 +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
@@ -127,10 +127,7 @@ where
|
||||
}
|
||||
|
||||
let amount = token.calculate_amount(metadata);
|
||||
let new_value = match self.gas_left.checked_sub(amount) {
|
||||
None => None,
|
||||
Some(val) => Some(val),
|
||||
};
|
||||
let new_value = self.gas_left.checked_sub(amount);
|
||||
|
||||
// We always consume the gas even if there is not enough gas.
|
||||
self.gas_left = new_value.unwrap_or_else(Zero::zero);
|
||||
|
||||
Reference in New Issue
Block a user