Clippy cleanup for all targets and nighly rust (also support 1.44.0) (#10445)
* address warnings from 'rustup run beta cargo clippy --workspace' minor refactoring in: - cli/src/cli.rs - cli/src/offline/blockhash_query.rs - logger/src/lib.rs - runtime/src/accounts_db.rs expect some performance improvement AccountsDB::clean_accounts() * address warnings from 'rustup run beta cargo clippy --workspace --tests' * address warnings from 'rustup run nightly cargo clippy --workspace --all-targets' * rustfmt * fix warning stragglers * properly fix clippy warnings test_vote_subscribe() replace ref-to-arc with ref parameters where arc not cloned * Remove lock around JsonRpcRequestProcessor (#10417) automerge * make ancestors parameter optional to avoid forcing construction of empty hash maps Co-authored-by: Greg Fitzgerald <greg@solana.com>
This commit is contained in:
committed by
GitHub
parent
fa3a6c5584
commit
e23340d89e
@@ -659,7 +659,7 @@ pub fn process_get_epoch_info(
|
||||
commitment_config: CommitmentConfig,
|
||||
) -> ProcessResult {
|
||||
let epoch_info: CliEpochInfo = rpc_client
|
||||
.get_epoch_info_with_commitment(commitment_config.clone())?
|
||||
.get_epoch_info_with_commitment(commitment_config)?
|
||||
.into();
|
||||
Ok(config.output_format.formatted_string(&epoch_info))
|
||||
}
|
||||
@@ -673,7 +673,7 @@ pub fn process_get_slot(
|
||||
rpc_client: &RpcClient,
|
||||
commitment_config: CommitmentConfig,
|
||||
) -> ProcessResult {
|
||||
let slot = rpc_client.get_slot_with_commitment(commitment_config.clone())?;
|
||||
let slot = rpc_client.get_slot_with_commitment(commitment_config)?;
|
||||
Ok(slot.to_string())
|
||||
}
|
||||
|
||||
@@ -681,7 +681,7 @@ pub fn process_get_epoch(
|
||||
rpc_client: &RpcClient,
|
||||
commitment_config: CommitmentConfig,
|
||||
) -> ProcessResult {
|
||||
let epoch_info = rpc_client.get_epoch_info_with_commitment(commitment_config.clone())?;
|
||||
let epoch_info = rpc_client.get_epoch_info_with_commitment(commitment_config)?;
|
||||
Ok(epoch_info.epoch.to_string())
|
||||
}
|
||||
|
||||
@@ -868,7 +868,7 @@ pub fn process_supply(
|
||||
commitment_config: CommitmentConfig,
|
||||
print_accounts: bool,
|
||||
) -> ProcessResult {
|
||||
let supply_response = rpc_client.supply_with_commitment(commitment_config.clone())?;
|
||||
let supply_response = rpc_client.supply_with_commitment(commitment_config)?;
|
||||
let mut supply: CliSupply = supply_response.value.into();
|
||||
supply.print_accounts = print_accounts;
|
||||
Ok(config.output_format.formatted_string(&supply))
|
||||
@@ -878,7 +878,7 @@ pub fn process_total_supply(
|
||||
rpc_client: &RpcClient,
|
||||
commitment_config: CommitmentConfig,
|
||||
) -> ProcessResult {
|
||||
let total_supply = rpc_client.total_supply_with_commitment(commitment_config.clone())?;
|
||||
let total_supply = rpc_client.total_supply_with_commitment(commitment_config)?;
|
||||
Ok(format!("{} SOL", lamports_to_sol(total_supply)))
|
||||
}
|
||||
|
||||
@@ -886,8 +886,7 @@ pub fn process_get_transaction_count(
|
||||
rpc_client: &RpcClient,
|
||||
commitment_config: CommitmentConfig,
|
||||
) -> ProcessResult {
|
||||
let transaction_count =
|
||||
rpc_client.get_transaction_count_with_commitment(commitment_config.clone())?;
|
||||
let transaction_count = rpc_client.get_transaction_count_with_commitment(commitment_config)?;
|
||||
Ok(transaction_count.to_string())
|
||||
}
|
||||
|
||||
@@ -952,10 +951,8 @@ pub fn process_ping(
|
||||
Ok(signature) => {
|
||||
let transaction_sent = Instant::now();
|
||||
loop {
|
||||
let signature_status = rpc_client.get_signature_status_with_commitment(
|
||||
&signature,
|
||||
commitment_config.clone(),
|
||||
)?;
|
||||
let signature_status = rpc_client
|
||||
.get_signature_status_with_commitment(&signature, commitment_config)?;
|
||||
let elapsed_time = Instant::now().duration_since(transaction_sent);
|
||||
if let Some(transaction_status) = signature_status {
|
||||
match transaction_status {
|
||||
|
Reference in New Issue
Block a user