mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +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
@@ -2736,11 +2736,8 @@ impl<T: Config> Convert<T::AccountId, Option<Exposure<T::AccountId, BalanceOf<T>
|
||||
for ExposureOf<T>
|
||||
{
|
||||
fn convert(validator: T::AccountId) -> Option<Exposure<T::AccountId, BalanceOf<T>>> {
|
||||
if let Some(active_era) = <Module<T>>::active_era() {
|
||||
Some(<Module<T>>::eras_stakers(active_era.index, &validator))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
<Module<T>>::active_era()
|
||||
.map(|active_era| <Module<T>>::eras_stakers(active_era.index, &validator))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user