mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 04:41:03 +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
@@ -518,21 +518,13 @@ impl<T: Config> Module<T> {
|
||||
None
|
||||
} else {
|
||||
let session_index =
|
||||
if let Some(session_id) = Self::session_for_set(set_id - 1) {
|
||||
session_id
|
||||
} else {
|
||||
return Err(Error::<T>::InvalidEquivocationProof.into());
|
||||
};
|
||||
Self::session_for_set(set_id - 1).ok_or_else(|| Error::<T>::InvalidEquivocationProof)?;
|
||||
|
||||
Some(session_index)
|
||||
};
|
||||
|
||||
let set_id_session_index =
|
||||
if let Some(session_id) = Self::session_for_set(set_id) {
|
||||
session_id
|
||||
} else {
|
||||
return Err(Error::<T>::InvalidEquivocationProof.into());
|
||||
};
|
||||
Self::session_for_set(set_id).ok_or_else(|| Error::<T>::InvalidEquivocationProof)?;
|
||||
|
||||
// check that the session id for the membership proof is within the
|
||||
// bounds of the set id reported in the equivocation.
|
||||
|
||||
Reference in New Issue
Block a user