diff --git a/cli/src/program.rs b/cli/src/program.rs index 3a7880e322..8503e40f2e 100644 --- a/cli/src/program.rs +++ b/cli/src/program.rs @@ -2723,7 +2723,7 @@ mod tests { let program_pubkey = Pubkey::new_unique(); let new_authority_pubkey = Keypair::new(); let new_authority_pubkey_file = make_tmp_path("authority_keypair_file"); - write_keypair_file(&new_authority_pubkey, &new_authority_pubkey_file).unwrap(); + write_keypair_file(&new_authority_pubkey, new_authority_pubkey_file).unwrap(); let test_command = test_commands.clone().get_matches_from(vec![ "test", "program", @@ -3109,7 +3109,7 @@ mod tests { let program_keypair_location = program_location.with_file_name("noop-keypair.json"); std::fs::create_dir_all(deploy_path).unwrap(); std::fs::copy(pathbuf, program_location.as_os_str()).unwrap(); - write_keypair_file(&program_pubkey, &program_keypair_location).unwrap(); + write_keypair_file(&program_pubkey, program_keypair_location).unwrap(); let config = CliConfig { rpc_client: Some(Arc::new(RpcClient::new_mock("".to_string()))), diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs index f361d27fd6..dc3f08b402 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -3894,7 +3894,7 @@ pub fn create_new_ledger( blockstore_dir, ]; let output = std::process::Command::new("tar") - .args(&args) + .args(args) .output() .unwrap(); if !output.status.success() { diff --git a/ledger/src/blockstore_db.rs b/ledger/src/blockstore_db.rs index 7801babc93..f97d3c0268 100644 --- a/ledger/src/blockstore_db.rs +++ b/ledger/src/blockstore_db.rs @@ -1574,12 +1574,12 @@ where impl<'a> WriteBatch<'a> { pub fn put_bytes(&mut self, key: C::Index, bytes: &[u8]) -> Result<()> { self.write_batch - .put_cf(self.get_cf::(), &C::key(key), bytes); + .put_cf(self.get_cf::(), C::key(key), bytes); Ok(()) } pub fn delete(&mut self, key: C::Index) -> Result<()> { - self.write_batch.delete_cf(self.get_cf::(), &C::key(key)); + self.write_batch.delete_cf(self.get_cf::(), C::key(key)); Ok(()) } @@ -1590,7 +1590,7 @@ impl<'a> WriteBatch<'a> { ) -> Result<()> { let serialized_value = serialize(&value)?; self.write_batch - .put_cf(self.get_cf::(), &C::key(key), &serialized_value); + .put_cf(self.get_cf::(), C::key(key), serialized_value); Ok(()) } diff --git a/remote-wallet/src/ledger.rs b/remote-wallet/src/ledger.rs index f7bf8a0ec2..93b90098f4 100644 --- a/remote-wallet/src/ledger.rs +++ b/remote-wallet/src/ledger.rs @@ -632,7 +632,7 @@ pub fn get_ledger_from_info( let wallet_host_device_path = if host_device_paths.len() > 1 { let selection = Select::with_theme(&ColorfulTheme::default()) - .with_prompt(&format!( + .with_prompt(format!( "Multiple hardware wallets found. Please select a device for {keypair_name:?}" )) .default(0) diff --git a/runtime/src/append_vec/test_utils.rs b/runtime/src/append_vec/test_utils.rs index 99064add64..252044e755 100644 --- a/runtime/src/append_vec/test_utils.rs +++ b/runtime/src/append_vec/test_utils.rs @@ -29,7 +29,7 @@ pub fn get_append_vec_path(path: &str) -> TempFile { .collect(); let dir = format!("{out_dir}/{rand_string}"); let mut buf = PathBuf::new(); - buf.push(&format!("{dir}/{path}")); + buf.push(format!("{dir}/{path}")); std::fs::create_dir_all(dir).expect("Create directory failed"); TempFile { path: buf } } diff --git a/tokens/src/commands.rs b/tokens/src/commands.rs index 9dbfbe4159..d09b618c38 100644 --- a/tokens/src/commands.rs +++ b/tokens/src/commands.rs @@ -925,7 +925,7 @@ pub fn test_process_distribute_tokens_with_client( let input_csv = allocations_file.path().to_str().unwrap().to_string(); let mut wtr = csv::WriterBuilder::new().from_writer(allocations_file); wtr.write_record(["recipient", "amount"]).unwrap(); - wtr.write_record(&[ + wtr.write_record([ alice_pubkey.to_string(), lamports_to_sol(expected_amount).to_string(), ]) @@ -1026,7 +1026,7 @@ pub fn test_process_create_stake_with_client(client: &RpcClient, sender_keypair: let mut wtr = csv::WriterBuilder::new().from_writer(file); wtr.write_record(["recipient", "amount", "lockup_date"]) .unwrap(); - wtr.write_record(&[ + wtr.write_record([ alice_pubkey.to_string(), lamports_to_sol(expected_amount).to_string(), "".to_string(), @@ -1148,7 +1148,7 @@ pub fn test_process_distribute_stake_with_client(client: &RpcClient, sender_keyp let mut wtr = csv::WriterBuilder::new().from_writer(file); wtr.write_record(["recipient", "amount", "lockup_date"]) .unwrap(); - wtr.write_record(&[ + wtr.write_record([ alice_pubkey.to_string(), lamports_to_sol(expected_amount).to_string(), "".to_string(), @@ -1414,9 +1414,9 @@ mod tests { let input_csv = file.path().to_str().unwrap().to_string(); let mut wtr = csv::WriterBuilder::new().from_writer(file); wtr.serialize("recipient".to_string()).unwrap(); - wtr.serialize(&pubkey0.to_string()).unwrap(); - wtr.serialize(&pubkey1.to_string()).unwrap(); - wtr.serialize(&pubkey2.to_string()).unwrap(); + wtr.serialize(pubkey0.to_string()).unwrap(); + wtr.serialize(pubkey1.to_string()).unwrap(); + wtr.serialize(pubkey2.to_string()).unwrap(); wtr.flush().unwrap(); let amount = sol_to_lamports(1.5);