From 6f851be1331b72cada41d0a4462f3f8ba0e022d5 Mon Sep 17 00:00:00 2001 From: Sam Kim Date: Thu, 8 Jun 2023 09:58:26 +0900 Subject: [PATCH] update for ui change to `subcommand()` --- token/cli/src/bench.rs | 11 ++++++----- token/cli/src/main.rs | 12 ++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/token/cli/src/bench.rs b/token/cli/src/bench.rs index c0745bf504a..8d7d42860b3 100644 --- a/token/cli/src/bench.rs +++ b/token/cli/src/bench.rs @@ -173,8 +173,9 @@ pub(crate) async fn bench_process_command( ) -> CommandResult { assert!(!config.sign_only); - match matches.subcommand() { - ("create-accounts", Some(arg_matches)) => { + let subcommand = matches.subcommand().unwrap(); + match subcommand { + ("create-accounts", arg_matches) => { let token = pubkey_of_signer(arg_matches, "token", wallet_manager) .unwrap() .unwrap(); @@ -186,7 +187,7 @@ pub(crate) async fn bench_process_command( command_create_accounts(config, signers, &token, n, &owner).await?; } - ("close-accounts", Some(arg_matches)) => { + ("close-accounts", arg_matches) => { let token = pubkey_of_signer(arg_matches, "token", wallet_manager) .unwrap() .unwrap(); @@ -197,7 +198,7 @@ pub(crate) async fn bench_process_command( command_close_accounts(config, signers, &token, n, &owner).await?; } - ("deposit-into", Some(arg_matches)) => { + ("deposit-into", arg_matches) => { let token = pubkey_of_signer(arg_matches, "token", wallet_manager) .unwrap() .unwrap(); @@ -212,7 +213,7 @@ pub(crate) async fn bench_process_command( ) .await?; } - ("withdraw-from", Some(arg_matches)) => { + ("withdraw-from", arg_matches) => { let token = pubkey_of_signer(arg_matches, "token", wallet_manager) .unwrap() .unwrap(); diff --git a/token/cli/src/main.rs b/token/cli/src/main.rs index 612c3219957..20db5a50a4d 100644 --- a/token/cli/src/main.rs +++ b/token/cli/src/main.rs @@ -3653,9 +3653,9 @@ async fn main() -> Result<(), Error> { let mut wallet_manager = None; let mut bulk_signers: Vec> = Vec::new(); - let (sub_command, sub_matches) = app_matches.subcommand(); + let (sub_command, sub_matches) = app_matches.subcommand().unwrap(); let sub_command = CommandName::from_str(sub_command).unwrap(); - let matches = sub_matches.unwrap(); + let matches = sub_matches; let mut multisigner_ids = Vec::new(); let config = Config::new( @@ -4689,9 +4689,9 @@ mod tests { &multisig_member_help, ) .get_matches_from(args); - let (sub_command, sub_matches) = app_matches.subcommand(); + let (sub_command, sub_matches) = app_matches.subcommand().unwrap(); let sub_command = CommandName::from_str(sub_command).unwrap(); - let matches = sub_matches.unwrap(); + let matches = sub_matches; let wallet_manager = None; let bulk_signers: Vec> = vec![Arc::new(clone_keypair(payer))]; @@ -4709,9 +4709,9 @@ mod tests { &multisig_member_help, ) .get_matches_from(args); - let (sub_command, sub_matches) = app_matches.subcommand(); + let (sub_command, sub_matches) = app_matches.subcommand().unwrap(); let sub_command = CommandName::from_str(sub_command).unwrap(); - let matches = sub_matches.unwrap(); + let matches = sub_matches; let mut wallet_manager = None; let mut bulk_signers: Vec> = Vec::new();