Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clients/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ fn signers_of(
name: &str,
wallet_manager: &mut Option<Rc<RemoteWalletManager>>,
) -> Result<Option<SignersOf>, Box<dyn std::error::Error>> {
if let Some(values) = matches.values_of(name) {
if let Some(values) = matches.try_get_many(name).ok().flatten() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if let Some(values) = matches.try_get_many(name).ok().flatten() {
if let Some(values) = matches.try_get_many::<String>(name).ok().flatten() {

In clap-v3, we generally always have to specify the type that we are parsing for. We should parse this to a proper type rather than a String, but that will require update the updating the validation function is_valid_signer, which will follow after solana-labs/solana-program-library#7447. So let's just update it to String here for now.

let mut results = Vec::new();
for (i, value) in values.enumerate() {
for (i, value) in values.copied().enumerate() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (i, value) in values.copied().enumerate() {
for (i, value) in values.enumerate() {

We are parsing for an owned String type, so we can remove the copied().

let name = format!("{}-{}", name, i.saturating_add(1));
let signer = signer_from_path(matches, value, &name, wallet_manager)?;
let signer_pubkey = signer.pubkey();
Expand Down
Loading