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:
François Garillot
2021-04-08 14:40:37 -04:00
committed by GitHub
parent bb9d2fd07a
commit b08cff9e77
18 changed files with 60 additions and 110 deletions

View File

@ -410,15 +410,16 @@ fn parse_distribute_stake_args(
)?;
let lockup_authority_str = value_t!(matches, "lockup_authority", String).ok();
let lockup_authority = match lockup_authority_str {
Some(path) => Some(signer_from_path(
&signer_matches,
&path,
"lockup authority",
&mut wallet_manager,
)?),
None => None,
};
let lockup_authority = lockup_authority_str
.map(|path| {
signer_from_path(
&signer_matches,
&path,
"lockup authority",
&mut wallet_manager,
)
})
.transpose()?;
let stake_args = StakeArgs {
stake_account_address,