Skip to content

Commit

Permalink
Nit macro
Browse files Browse the repository at this point in the history
  • Loading branch information
grandizzy committed Feb 22, 2024
1 parent 6474ca3 commit a9cd6ad
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions crates/cast/bin/cmd/wallet/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl ListArgs {

// macro to print senders for a list of signers
macro_rules! list_senders {
($signers:ident, $label: ident) => {
($signers:expr, $label:literal) => {
match $signers.await {
Ok(signers) => {
for signer in signers.unwrap_or_default().iter() {
Expand All @@ -73,17 +73,9 @@ impl ListArgs {
};
}

let label = "Ledger";
let signers = list_opts.ledgers();
list_senders!(signers, label);

let label = "Trezor";
let signers = list_opts.trezors();
list_senders!(signers, label);

let label = "AWS";
let signers = list_opts.aws_signers();
list_senders!(signers, label);
list_senders!(list_opts.ledgers(), "Ledger");
list_senders!(list_opts.trezors(), "Trezor");
list_senders!(list_opts.aws_signers(), "AWS");

Ok(())
}
Expand Down

0 comments on commit a9cd6ad

Please sign in to comment.