diff --git a/clients/client-core/src/client/cover_traffic_stream.rs b/clients/client-core/src/client/cover_traffic_stream.rs index 8e25357e00..0223635b81 100644 --- a/clients/client-core/src/client/cover_traffic_stream.rs +++ b/clients/client-core/src/client/cover_traffic_stream.rs @@ -136,7 +136,7 @@ impl LoopCoverTrafficStream { let cover_message = generate_loop_cover_packet( &mut self.rng, topology_ref, - &*self.ack_key, + &self.ack_key, &self.our_full_destination, self.average_ack_delay, self.average_packet_delay, diff --git a/clients/client-core/src/client/real_messages_control/real_traffic_stream.rs b/clients/client-core/src/client/real_messages_control/real_traffic_stream.rs index 5585044654..020a7c9e74 100644 --- a/clients/client-core/src/client/real_messages_control/real_traffic_stream.rs +++ b/clients/client-core/src/client/real_messages_control/real_traffic_stream.rs @@ -228,7 +228,7 @@ where generate_loop_cover_packet( &mut self.rng, topology_ref, - &*self.ack_key, + &self.ack_key, &self.our_full_destination, self.config.average_ack_delay, self.config.average_packet_delay, diff --git a/clients/native/src/commands/upgrade.rs b/clients/native/src/commands/upgrade.rs index c925b10f08..c84073200c 100644 --- a/clients/native/src/commands/upgrade.rs +++ b/clients/native/src/commands/upgrade.rs @@ -103,7 +103,7 @@ fn minor_0_12_upgrade( Version::new(0, 12, 0) }; - print_start_upgrade(&config_version, &to_version); + print_start_upgrade(config_version, &to_version); config .get_base_mut() @@ -111,7 +111,7 @@ fn minor_0_12_upgrade( config.save_to_file(None).unwrap_or_else(|err| { eprintln!("failed to overwrite config file! - {:?}", err); - print_failed_upgrade(&config_version, &to_version); + print_failed_upgrade(config_version, &to_version); process::exit(1); }); diff --git a/clients/socks5/src/commands/upgrade.rs b/clients/socks5/src/commands/upgrade.rs index 5e9517ac2e..ff41f3ce6e 100644 --- a/clients/socks5/src/commands/upgrade.rs +++ b/clients/socks5/src/commands/upgrade.rs @@ -102,7 +102,7 @@ fn minor_0_12_upgrade( Version::new(0, 12, 0) }; - print_start_upgrade(&config_version, &to_version); + print_start_upgrade(config_version, &to_version); config .get_base_mut() @@ -110,7 +110,7 @@ fn minor_0_12_upgrade( config.save_to_file(None).unwrap_or_else(|err| { eprintln!("failed to overwrite config file! - {:?}", err); - print_failed_upgrade(&config_version, &to_version); + print_failed_upgrade(config_version, &to_version); process::exit(1); }); diff --git a/common/client-libs/mixnet-client/src/client.rs b/common/client-libs/mixnet-client/src/client.rs index 4e089a30c3..181eac65ec 100644 --- a/common/client-libs/mixnet-client/src/client.rs +++ b/common/client-libs/mixnet-client/src/client.rs @@ -186,7 +186,7 @@ impl Client { address.into(), receiver, initial_connection_timeout, - &*current_reconnection_attempt, + ¤t_reconnection_attempt, ) .await }); diff --git a/common/client-libs/validator-client/src/nymd/wallet/mod.rs b/common/client-libs/validator-client/src/nymd/wallet/mod.rs index e071d48853..b22dfdd6f4 100644 --- a/common/client-libs/validator-client/src/nymd/wallet/mod.rs +++ b/common/client-libs/validator-client/src/nymd/wallet/mod.rs @@ -72,7 +72,7 @@ impl DirectSecp256k1HdWallet { } fn derive_keypair(&self, hd_path: &DerivationPath) -> Result { - let extended_private_key = XPrv::derive_from_path(&self.seed, hd_path)?; + let extended_private_key = XPrv::derive_from_path(self.seed, hd_path)?; let private_key: SigningKey = extended_private_key.into(); let public_key = private_key.public_key(); diff --git a/common/commands/src/validator/account/balance.rs b/common/commands/src/validator/account/balance.rs index 8ac24b273f..eb8e2dfa8f 100644 --- a/common/commands/src/validator/account/balance.rs +++ b/common/commands/src/validator/account/balance.rs @@ -51,7 +51,7 @@ pub async fn query_balance( return; } - let denom = args.denom.unwrap_or_else(|| "".to_string()); + let denom = args.denom.unwrap_or_default(); for coin in coins { if denom.is_empty() || denom.eq_ignore_ascii_case(&coin.denom) { diff --git a/common/commands/src/validator/mixnet/operators/gateway/vesting_bond_gateway.rs b/common/commands/src/validator/mixnet/operators/gateway/vesting_bond_gateway.rs index d82a01c0c5..6c26b09eeb 100644 --- a/common/commands/src/validator/mixnet/operators/gateway/vesting_bond_gateway.rs +++ b/common/commands/src/validator/mixnet/operators/gateway/vesting_bond_gateway.rs @@ -68,7 +68,7 @@ pub async fn vesting_bond_gateway(client: SigningClient, args: Args, denom: &str let coin = Coin::new(args.amount, denom); let res = client - .vesting_bond_gateway(gateway, &*args.signature, coin.into(), None) + .vesting_bond_gateway(gateway, &args.signature, coin.into(), None) .await .expect("failed to bond gateway!"); diff --git a/common/commands/src/validator/mixnet/operators/mixnode/vesting_bond_mixnode.rs b/common/commands/src/validator/mixnet/operators/mixnode/vesting_bond_mixnode.rs index 870676782d..6f20996460 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/vesting_bond_mixnode.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/vesting_bond_mixnode.rs @@ -95,7 +95,7 @@ pub async fn vesting_bond_mixnode(client: SigningClient, args: Args, denom: &str }; let res = client - .vesting_bond_mixnode(mixnode, cost_params, &*args.signature, coin.into(), None) + .vesting_bond_mixnode(mixnode, cost_params, &args.signature, coin.into(), None) .await .expect("failed to bond vesting mixnode!"); diff --git a/common/commands/src/validator/vesting/create_vesting_schedule.rs b/common/commands/src/validator/vesting/create_vesting_schedule.rs index 60f69e6f2b..65268d27ed 100644 --- a/common/commands/src/validator/vesting/create_vesting_schedule.rs +++ b/common/commands/src/validator/vesting/create_vesting_schedule.rs @@ -51,7 +51,7 @@ pub async fn create(args: Args, client: SigningClient, network_details: &NymNetw let res = client .create_periodic_vesting_account( - &*args.address, + &args.address, args.staking_address, Some(vesting), coin.into(), @@ -70,7 +70,7 @@ pub async fn create(args: Args, client: SigningClient, network_details: &NymNetw let send_coin_response = client .send( - &AccountId::from_str(&*args.address).unwrap(), + &AccountId::from_str(&args.address).unwrap(), vec![coin.into()], "payment made :)", None, diff --git a/common/credential-storage/build.rs b/common/credential-storage/build.rs index 0640039329..ad3cfe4bff 100644 --- a/common/credential-storage/build.rs +++ b/common/credential-storage/build.rs @@ -11,7 +11,7 @@ async fn main() { let out_dir = env::var("OUT_DIR").unwrap(); let database_path = format!("{}/coconut-credential-example.sqlite", out_dir); - let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path)) + let mut conn = SqliteConnection::connect(&format!("sqlite://{}?mode=rwc", database_path)) .await .expect("Failed to create SQLx database connection"); diff --git a/common/crypto/dkg/src/bte/mod.rs b/common/crypto/dkg/src/bte/mod.rs index f3b4445c54..cb3dd07fa4 100644 --- a/common/crypto/dkg/src/bte/mod.rs +++ b/common/crypto/dkg/src/bte/mod.rs @@ -144,7 +144,7 @@ impl Tau { let tau_mem = self.0.as_raw_slice(); assert_eq!(tau_mem.len(), 1, "tau length invariant was broken"); - random_oracle_builder.update(&tau_mem[0].to_be_bytes()); + random_oracle_builder.update(tau_mem[0].to_be_bytes()); let oracle_output = random_oracle_builder.finalize(); debug_assert_eq!(oracle_output.len() * 8, HASH_SECURITY_PARAM); diff --git a/common/ledger/src/lib.rs b/common/ledger/src/lib.rs index ec8b8c8082..2ff4a18956 100644 --- a/common/ledger/src/lib.rs +++ b/common/ledger/src/lib.rs @@ -74,7 +74,7 @@ impl CosmosLedger { /// Get the SECP265K1 address of the device. pub fn get_addr_secp265k1(&self, display: bool) -> Result { - let display = if display { 1 } else { 0 }; + let display = u8::from(display); let components = path_bytes(self.path.clone())?; let data: Vec = vec![ [self.prefix.len() as u8].as_slice(), diff --git a/gateway/src/commands/upgrade.rs b/gateway/src/commands/upgrade.rs index cc62c5219e..7d8e5481a6 100644 --- a/gateway/src/commands/upgrade.rs +++ b/gateway/src/commands/upgrade.rs @@ -101,13 +101,13 @@ fn minor_0_12_upgrade( Version::new(0, 12, 0) }; - print_start_upgrade(&config_version, &to_version); + print_start_upgrade(config_version, &to_version); let upgraded_config = config.with_custom_version(to_version.to_string().as_ref()); upgraded_config.save_to_file(None).unwrap_or_else(|err| { eprintln!("failed to overwrite config file! - {:?}", err); - print_failed_upgrade(&config_version, &to_version); + print_failed_upgrade(config_version, &to_version); process::exit(1); }); diff --git a/mixnode/src/commands/upgrade.rs b/mixnode/src/commands/upgrade.rs index 85352e77c3..d104d47988 100644 --- a/mixnode/src/commands/upgrade.rs +++ b/mixnode/src/commands/upgrade.rs @@ -101,13 +101,13 @@ fn minor_0_12_upgrade( Version::new(0, 12, 0) }; - print_start_upgrade(&config_version, &to_version); + print_start_upgrade(config_version, &to_version); let upgraded_config = config.with_custom_version(to_version.to_string().as_ref()); upgraded_config.save_to_file(None).unwrap_or_else(|err| { eprintln!("failed to overwrite config file! - {:?}", err); - print_failed_upgrade(&config_version, &to_version); + print_failed_upgrade(config_version, &to_version); process::exit(1); }); diff --git a/nym-wallet/nym-wallet-recovery-cli/src/main.rs b/nym-wallet/nym-wallet-recovery-cli/src/main.rs index 068745fcdd..e507581def 100644 --- a/nym-wallet/nym-wallet-recovery-cli/src/main.rs +++ b/nym-wallet/nym-wallet-recovery-cli/src/main.rs @@ -170,7 +170,7 @@ fn get_login_entry(login: &Value) -> Result<(&str, &str, &str)> { } fn base64_decode(ciphertext: &str, iv: &str, salt: &str) -> Result<(Vec, Vec, Vec)> { - let ciphertext = base64::decode(&ciphertext) + let ciphertext = base64::decode(ciphertext) .map_err(|err| anyhow!("Unable to base64 decode ciphertext: {}", err))?; let iv = base64::decode(iv).map_err(|err| anyhow!("Unable to base64 decode iv: {}", err))?; let salt = diff --git a/validator-api/src/network_monitor/monitor/processor.rs b/validator-api/src/network_monitor/monitor/processor.rs index 7fa72b55dd..28ef3ae900 100644 --- a/validator-api/src/network_monitor/monitor/processor.rs +++ b/validator-api/src/network_monitor/monitor/processor.rs @@ -140,7 +140,7 @@ impl ReceivedProcessor { self.permit_changer = Some(permit_sender); tokio::spawn(async move { - while let Some(permit) = wait_for_permit(&mut permit_receiver, &*inner).await { + while let Some(permit) = wait_for_permit(&mut permit_receiver, &inner).await { receive_or_release_permit(&mut permit_receiver, permit).await; }