Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit d0648fb

Browse files
committed
update pattern matching syntax for subcommand
1 parent 81dfff1 commit d0648fb

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

token/cli/src/bench.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub(crate) async fn bench_process_command(
3030
assert!(!config.sign_only);
3131

3232
match matches.subcommand() {
33-
("create-accounts", Some(arg_matches)) => {
33+
Some(("create-accounts", arg_matches)) => {
3434
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
3535
.unwrap()
3636
.unwrap();
@@ -42,7 +42,7 @@ pub(crate) async fn bench_process_command(
4242

4343
command_create_accounts(config, signers, &token, n, &owner).await?;
4444
}
45-
("close-accounts", Some(arg_matches)) => {
45+
Some(("close-accounts", arg_matches)) => {
4646
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
4747
.unwrap()
4848
.unwrap();
@@ -53,7 +53,7 @@ pub(crate) async fn bench_process_command(
5353

5454
command_close_accounts(config, signers, &token, n, &owner).await?;
5555
}
56-
("deposit-into", Some(arg_matches)) => {
56+
Some(("deposit-into", arg_matches)) => {
5757
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
5858
.unwrap()
5959
.unwrap();
@@ -68,7 +68,7 @@ pub(crate) async fn bench_process_command(
6868
)
6969
.await?;
7070
}
71-
("withdraw-from", Some(arg_matches)) => {
71+
Some(("withdraw-from", arg_matches)) => {
7272
let token = pubkey_of_signer(arg_matches, "token", wallet_manager)
7373
.unwrap()
7474
.unwrap();

token/cli/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ async fn main() -> Result<(), Error> {
1919
let mut wallet_manager = None;
2020
let mut bulk_signers: Vec<Arc<dyn Signer>> = Vec::new();
2121

22-
let (sub_command, sub_matches) = app_matches.subcommand();
22+
let (sub_command, matches) = app_matches.subcommand().unwrap();
2323
let sub_command = CommandName::from_str(sub_command).unwrap();
24-
let matches = sub_matches.unwrap();
2524

2625
let mut multisigner_ids = Vec::new();
2726
let config = Config::new(

token/cli/tests/command.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,8 @@ where
439439
&multisig_member_help,
440440
)
441441
.get_matches_from(args);
442-
let (sub_command, sub_matches) = app_matches.subcommand();
442+
let (sub_command, matches) = app_matches.subcommand().unwrap();
443443
let sub_command = CommandName::from_str(sub_command).unwrap();
444-
let matches = sub_matches.unwrap();
445444

446445
let wallet_manager = None;
447446
let bulk_signers: Vec<Arc<dyn Signer>> = vec![Arc::new(clone_keypair(payer))];
@@ -459,9 +458,8 @@ async fn exec_test_cmd<T: AsRef<OsStr>>(config: &Config<'_>, args: &[T]) -> Comm
459458
&multisig_member_help,
460459
)
461460
.get_matches_from(args);
462-
let (sub_command, sub_matches) = app_matches.subcommand();
461+
let (sub_command, matches) = app_matches.subcommand().unwrap();
463462
let sub_command = CommandName::from_str(sub_command).unwrap();
464-
let matches = sub_matches.unwrap();
465463

466464
let mut wallet_manager = None;
467465
let mut bulk_signers: Vec<Arc<dyn Signer>> = Vec::new();

0 commit comments

Comments
 (0)