Simplify some pattern-matches (#16402)
When those match an exact combinator on Option / Result. Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust).
This commit is contained in:
committed by
GitHub
parent
bb9d2fd07a
commit
b08cff9e77
@ -48,10 +48,7 @@ pub fn get_account_with_commitment(
|
||||
.value
|
||||
.ok_or_else(|| Error::Client(format!("AccountNotFound: pubkey={}", nonce_pubkey)))
|
||||
})
|
||||
.and_then(|a| match account_identity_ok(&a) {
|
||||
Ok(()) => Ok(a),
|
||||
Err(e) => Err(e),
|
||||
})
|
||||
.and_then(|a| account_identity_ok(&a).map(|()| a))
|
||||
}
|
||||
|
||||
pub fn account_identity_ok<T: ReadableAccount>(account: &T) -> Result<(), Error> {
|
||||
|
Reference in New Issue
Block a user