chore: cargo +nightly clippy --fix -Z unstable-options

This commit is contained in:
Alexander Meißner
2021-06-18 15:34:46 +02:00
committed by Michael Vines
parent 3570b00560
commit 6514096a67
177 changed files with 1021 additions and 1021 deletions

View File

@ -405,7 +405,7 @@ pub fn bigtable_process_command(ledger_path: &Path, matches: &ArgMatches<'_>) {
let allow_missing_metadata = arg_matches.is_present("allow_missing_metadata");
let force_reupload = arg_matches.is_present("force_reupload");
let blockstore =
crate::open_blockstore(&ledger_path, AccessType::TryPrimaryThenSecondary, None);
crate::open_blockstore(ledger_path, AccessType::TryPrimaryThenSecondary, None);
runtime.block_on(upload(
blockstore,

View File

@ -136,7 +136,7 @@ fn output_entry(
.map(|transaction_status| transaction_status.into());
solana_cli_output::display::println_transaction(
&transaction,
transaction,
&transaction_status,
" ",
None,
@ -455,7 +455,7 @@ fn graph_forks(bank_forks: &BankForks, include_all_votes: bool) -> String {
let mut lowest_total_stake = 0;
for (node_pubkey, (last_vote_slot, vote_state, stake, total_stake)) in &last_votes {
all_votes.entry(*node_pubkey).and_modify(|validator_votes| {
validator_votes.remove(&last_vote_slot);
validator_votes.remove(last_vote_slot);
});
dot.push(format!(
@ -475,7 +475,7 @@ fn graph_forks(bank_forks: &BankForks, include_all_votes: bool) -> String {
dot.push(format!(
r#" "last vote {}" -> "{}" [style=dashed,label="latest vote"];"#,
node_pubkey,
if styled_slots.contains(&last_vote_slot) {
if styled_slots.contains(last_vote_slot) {
last_vote_slot.to_string()
} else {
if *last_vote_slot < lowest_last_vote_slot {
@ -522,7 +522,7 @@ fn graph_forks(bank_forks: &BankForks, include_all_votes: bool) -> String {
r#" "{} vote {}" -> "{}" [style=dotted,label="vote"];"#,
node_pubkey,
vote_slot,
if styled_slots.contains(&vote_slot) {
if styled_slots.contains(vote_slot) {
vote_slot.to_string()
} else {
"...".to_string()
@ -714,8 +714,8 @@ fn load_bank_forks(
};
bank_forks_utils::load(
&genesis_config,
&blockstore,
genesis_config,
blockstore,
account_paths,
None,
snapshot_config.as_ref(),
@ -747,7 +747,7 @@ fn compute_slot_cost(blockstore: &Blockstore, slot: Slot) -> Result<(), String>
transactions += entry.transactions.len();
for transaction in &entry.transactions {
programs += transaction.message().instructions.len();
let tx_cost = cost_model.calculate_cost(&transaction);
let tx_cost = cost_model.calculate_cost(transaction);
if cost_tracker.try_add(tx_cost).is_err() {
println!(
"Slot: {}, CostModel rejected transaction {:?}, stats {:?}!",
@ -887,7 +887,7 @@ fn main() {
.long("maximum-snapshots-to-retain")
.value_name("NUMBER")
.takes_value(true)
.default_value(&default_max_snapshot_to_retain)
.default_value(default_max_snapshot_to_retain)
.help("Maximum number of snapshots to hold on to during snapshot purge");
let rent = Rent::default();
@ -1927,14 +1927,14 @@ fn main() {
let remove_stake_accounts = arg_matches.is_present("remove_stake_accounts");
let new_hard_forks = hardforks_of(arg_matches, "hard_forks");
let faucet_pubkey = pubkey_of(&arg_matches, "faucet_pubkey");
let faucet_pubkey = pubkey_of(arg_matches, "faucet_pubkey");
let faucet_lamports = value_t!(arg_matches, "faucet_lamports", u64).unwrap_or(0);
let rent_burn_percentage = value_t!(arg_matches, "rent_burn_percentage", u8);
let hashes_per_tick = arg_matches.value_of("hashes_per_tick");
let bootstrap_stake_authorized_pubkey =
pubkey_of(&arg_matches, "bootstrap_stake_authorized_pubkey");
pubkey_of(arg_matches, "bootstrap_stake_authorized_pubkey");
let bootstrap_validator_lamports =
value_t_or_exit!(arg_matches, "bootstrap_validator_lamports", u64);
let bootstrap_validator_stake_lamports =
@ -1948,9 +1948,9 @@ fn main() {
);
exit(1);
}
let bootstrap_validator_pubkeys = pubkeys_of(&arg_matches, "bootstrap_validator");
let bootstrap_validator_pubkeys = pubkeys_of(arg_matches, "bootstrap_validator");
let accounts_to_remove =
pubkeys_of(&arg_matches, "accounts_to_remove").unwrap_or_default();
pubkeys_of(arg_matches, "accounts_to_remove").unwrap_or_default();
let snapshot_version =
arg_matches
.value_of("snapshot_version")
@ -2105,9 +2105,9 @@ fn main() {
);
let vote_account = vote_state::create_account_with_authorized(
&identity_pubkey,
&identity_pubkey,
&identity_pubkey,
identity_pubkey,
identity_pubkey,
identity_pubkey,
100,
VoteState::get_rent_exempt_reserve(&rent).max(1),
);
@ -2117,8 +2117,8 @@ fn main() {
&stake_state::create_account(
bootstrap_stake_authorized_pubkey
.as_ref()
.unwrap_or(&identity_pubkey),
&vote_pubkey,
.unwrap_or(identity_pubkey),
vote_pubkey,
&vote_account,
&rent,
bootstrap_validator_stake_lamports,
@ -2544,7 +2544,7 @@ fn main() {
}
};
let warped_bank = Bank::new_from_parent_with_tracer(
&base_bank,
base_bank,
base_bank.collector_id(),
next_epoch,
tracer,
@ -2561,7 +2561,7 @@ fn main() {
println!("Slot: {} => {}", base_bank.slot(), warped_bank.slot());
println!("Epoch: {} => {}", base_bank.epoch(), warped_bank.epoch());
assert_capitalization(&base_bank);
assert_capitalization(base_bank);
assert_capitalization(&warped_bank);
let interest_per_epoch = ((warped_bank.capitalization() as f64)
/ (base_bank.capitalization() as f64)
@ -2589,7 +2589,7 @@ fn main() {
pubkey,
account,
base_bank
.get_account(&pubkey)
.get_account(pubkey)
.map(|a| a.lamports())
.unwrap_or_default(),
)
@ -2788,7 +2788,7 @@ fn main() {
);
}
assert_capitalization(&bank);
assert_capitalization(bank);
println!("Inflation: {:?}", bank.inflation());
println!("RentCollector: {:?}", bank.rent_collector());
println!("Capitalization: {}", Sol(bank.capitalization()));

View File

@ -39,11 +39,11 @@ fn nominal() {
let ledger_path = ledger_path.to_str().unwrap();
// Basic validation
let output = run_ledger_tool(&["-l", &ledger_path, "verify"]);
let output = run_ledger_tool(&["-l", ledger_path, "verify"]);
assert!(output.status.success());
// Print everything
let output = run_ledger_tool(&["-l", &ledger_path, "print", "-vvv"]);
let output = run_ledger_tool(&["-l", ledger_path, "print", "-vvv"]);
assert!(output.status.success());
assert_eq!(count_newlines(&output.stdout), ticks + meta_lines);
}