Skip to content

Commit

Permalink
resolve lifetime mismatch for inputs to validator(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
samkim-crypto committed Sep 3, 2023
1 parent 6bb8531 commit 03e8f88
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 81 deletions.
16 changes: 8 additions & 8 deletions token/cli/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl BenchSubCommand for App<'_> {
.about("Create multiple token accounts for benchmarking")
.arg(
Arg::with_name("token")
.validator(is_valid_pubkey)
.validator(|s| is_valid_pubkey(s))
.value_name("TOKEN_ADDRESS")
.takes_value(true)
.index(1)
Expand All @@ -63,7 +63,7 @@ impl BenchSubCommand for App<'_> {
.about("Close multiple token accounts used for benchmarking")
.arg(
Arg::with_name("token")
.validator(is_valid_pubkey)
.validator(|s| is_valid_pubkey(s))
.value_name("TOKEN_ADDRESS")
.takes_value(true)
.index(1)
Expand All @@ -86,7 +86,7 @@ impl BenchSubCommand for App<'_> {
.about("Deposit tokens into multiple accounts")
.arg(
Arg::with_name("token")
.validator(is_valid_pubkey)
.validator(|s| is_valid_pubkey(s))
.value_name("TOKEN_ADDRESS")
.takes_value(true)
.index(1)
Expand All @@ -104,7 +104,7 @@ impl BenchSubCommand for App<'_> {
)
.arg(
Arg::with_name("amount")
.validator(is_amount)
.validator(|s| is_amount(s))
.value_name("TOKEN_AMOUNT")
.takes_value(true)
.index(3)
Expand All @@ -114,7 +114,7 @@ impl BenchSubCommand for App<'_> {
.arg(
Arg::with_name("from")
.long("from")
.validator(is_valid_pubkey)
.validator(|s| is_valid_pubkey(s))
.value_name("SOURCE_TOKEN_ACCOUNT_ADDRESS")
.takes_value(true)
.help("The source token account address [default: associated token account for --owner]")
Expand All @@ -126,7 +126,7 @@ impl BenchSubCommand for App<'_> {
.about("Withdraw tokens from multiple accounts")
.arg(
Arg::with_name("token")
.validator(is_valid_pubkey)
.validator(|s| is_valid_pubkey(s))
.value_name("TOKEN_ADDRESS")
.takes_value(true)
.index(1)
Expand All @@ -144,7 +144,7 @@ impl BenchSubCommand for App<'_> {
)
.arg(
Arg::with_name("amount")
.validator(is_amount)
.validator(|s| is_amount(s))
.value_name("TOKEN_AMOUNT")
.takes_value(true)
.index(3)
Expand All @@ -154,7 +154,7 @@ impl BenchSubCommand for App<'_> {
.arg(
Arg::with_name("to")
.long("to")
.validator(is_valid_pubkey)
.validator(|s| is_valid_pubkey(s))
.value_name("RECIPIENT_TOKEN_ACCOUNT_ADDRESS")
.takes_value(true)
.help("The recipient token account address [default: associated token account for --owner]")
Expand Down
Loading

0 comments on commit 03e8f88

Please sign in to comment.