diff --git a/Cargo.lock b/Cargo.lock index a1c0b125878..e20ac11d47a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6135,6 +6135,7 @@ dependencies = [ "futures", "mime", "serde", + "serde_json", "serde_yaml", "subtle 2.6.1", "time", @@ -6998,6 +6999,7 @@ dependencies = [ "tap", "tempfile", "thiserror 2.0.12", + "time", "tokio", "tokio-stream", "tokio-util", diff --git a/clients/native/src/websocket/handler.rs b/clients/native/src/websocket/handler.rs index 2df449385d6..761e2b9531c 100644 --- a/clients/native/src/websocket/handler.rs +++ b/clients/native/src/websocket/handler.rs @@ -318,7 +318,7 @@ impl Handler { async fn handle_text_message(&mut self, msg: String) -> Option { debug!("Handling text message request"); - trace!("Content: {:?}", msg); + trace!("Content: {msg:?}"); self.received_response_type = ReceivedResponseType::Text; let client_request = ClientRequest::try_from_text(msg); diff --git a/clients/native/src/websocket/listener.rs b/clients/native/src/websocket/listener.rs index cc36198d40a..a1b430a9301 100644 --- a/clients/native/src/websocket/listener.rs +++ b/clients/native/src/websocket/listener.rs @@ -68,9 +68,9 @@ impl Listener { new_conn = tcp_listener.accept() => { match new_conn { Ok((mut socket, remote_addr)) => { - debug!("Received connection from {:?}", remote_addr); + debug!("Received connection from {remote_addr:?}"); if self.state.is_connected() { - warn!("Tried to open a duplicate websocket connection. The request came from {}", remote_addr); + warn!("Tried to open a duplicate websocket connection. The request came from {remote_addr}"); // if we've already got a connection, don't allow another one // while we only ever want to accept a single connection, we don't want // to leave clients hanging (and also allow for reconnection if it somehow diff --git a/common/async-file-watcher/src/lib.rs b/common/async-file-watcher/src/lib.rs index 62bb895bcdb..0fdeb7da3a5 100644 --- a/common/async-file-watcher/src/lib.rs +++ b/common/async-file-watcher/src/lib.rs @@ -137,7 +137,7 @@ impl AsyncFileWatcher { log::error!("the file watcher receiver has been dropped!"); } } else { - log::debug!("will not propagate information about {:?}", event); + log::debug!("will not propagate information about {event:?}"); } } Err(err) => { diff --git a/common/bandwidth-controller/src/event.rs b/common/bandwidth-controller/src/event.rs index ee968dfd931..e5f78228dd1 100644 --- a/common/bandwidth-controller/src/event.rs +++ b/common/bandwidth-controller/src/event.rs @@ -11,7 +11,7 @@ impl std::fmt::Display for BandwidthStatusMessage { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { BandwidthStatusMessage::RemainingBandwidth(b) => { - write!(f, "remaining bandwidth: {}", b) + write!(f, "remaining bandwidth: {b}") } BandwidthStatusMessage::NoBandwidth => write!(f, "no bandwidth left"), } diff --git a/common/client-core/src/client/mix_traffic/mod.rs b/common/client-core/src/client/mix_traffic/mod.rs index 1114de9d896..0c277c15883 100644 --- a/common/client-core/src/client/mix_traffic/mod.rs +++ b/common/client-core/src/client/mix_traffic/mod.rs @@ -146,7 +146,7 @@ impl MixTrafficController { Some(client_request) => { match self.gateway_transceiver.send_client_request(client_request).await { Ok(_) => (), - Err(e) => error!("Failed to send client request: {}", e), + Err(e) => error!("Failed to send client request: {e}"), }; }, None => { diff --git a/common/client-core/src/client/real_messages_control/acknowledgement_control/acknowledgement_listener.rs b/common/client-core/src/client/real_messages_control/acknowledgement_control/acknowledgement_listener.rs index 4b5d483ee5a..10b129d817e 100644 --- a/common/client-core/src/client/real_messages_control/acknowledgement_control/acknowledgement_listener.rs +++ b/common/client-core/src/client/real_messages_control/acknowledgement_control/acknowledgement_listener.rs @@ -65,7 +65,7 @@ impl AcknowledgementListener { return; } - trace!("Received {} from the mix network", frag_id); + trace!("Received {frag_id} from the mix network"); self.stats_tx .report(PacketStatisticsEvent::RealAckReceived(ack_content.len()).into()); if let Err(err) = self diff --git a/common/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs b/common/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs index 6235b7c477d..4bdb7afcdaa 100644 --- a/common/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs +++ b/common/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs @@ -126,7 +126,7 @@ impl ActionController { fn handle_insert(&mut self, pending_acks: Vec) { for pending_ack in pending_acks { let frag_id = pending_ack.message_chunk.fragment_identifier(); - trace!("{} is inserted", frag_id); + trace!("{frag_id} is inserted"); if self .pending_acks_data @@ -161,22 +161,16 @@ impl ActionController { let new_queue_key = self.pending_acks_timers.insert(frag_id, timeout); *queue_key = Some(new_queue_key) } else { - debug!( - "Tried to START TIMER on pending ack that is already gone! - {}", - frag_id - ); + debug!("Tried to START TIMER on pending ack that is already gone! - {frag_id}"); } } fn handle_remove(&mut self, frag_id: FragmentIdentifier) { - trace!("{} is getting removed", frag_id); + trace!("{frag_id} is getting removed"); match self.pending_acks_data.remove(&frag_id) { None => { - debug!( - "Tried to REMOVE pending ack that is already gone! - {}", - frag_id - ); + debug!("Tried to REMOVE pending ack that is already gone! - {frag_id}"); } Some((_, queue_key)) => { if let Some(queue_key) = queue_key { @@ -188,10 +182,7 @@ impl ActionController { } else { // I'm not 100% sure if having a `None` key is even possible here // (REMOVE would have to be called before START TIMER), - debug!( - "Tried to REMOVE pending ack without TIMER active - {}", - frag_id - ); + debug!("Tried to REMOVE pending ack without TIMER active - {frag_id}"); } } } @@ -200,7 +191,7 @@ impl ActionController { // initiated basically as a first step of retransmission. At first data has its delay updated // (as new sphinx packet was created with new expected delivery time) fn handle_update_pending_ack(&mut self, frag_id: FragmentIdentifier, delay: SphinxDelay) { - trace!("{} is updating its delay", frag_id); + trace!("{frag_id} is updating its delay"); // TODO: is it possible to solve this without either locking or temporarily removing the value? if let Some((pending_ack_data, queue_key)) = self.pending_acks_data.remove(&frag_id) { // this Action is triggered by `RetransmissionRequestListener` (for 'normal' packets) @@ -213,10 +204,7 @@ impl ActionController { self.pending_acks_data .insert(frag_id, (Arc::new(inner_data), queue_key)); } else { - debug!( - "Tried to UPDATE TIMER on pending ack that is already gone! - {}", - frag_id - ); + debug!("Tried to UPDATE TIMER on pending ack that is already gone! - {frag_id}"); } } diff --git a/common/client-core/src/client/real_messages_control/real_traffic_stream.rs b/common/client-core/src/client/real_messages_control/real_traffic_stream.rs index edc313990f0..0e36ce2571f 100644 --- a/common/client-core/src/client/real_messages_control/real_traffic_stream.rs +++ b/common/client-core/src/client/real_messages_control/real_traffic_stream.rs @@ -202,7 +202,7 @@ where // well technically the message was not sent just yet, but now it's up to internal // queues and client load rather than the required delay. So realistically we can treat // whatever is about to happen as negligible additional delay. - trace!("{} is about to get sent to the mixnet", frag_id); + trace!("{frag_id} is about to get sent to the mixnet"); if let Err(err) = self.sent_notifier.unbounded_send(frag_id) { error!("Failed to notify about sent message: {err}"); } diff --git a/common/client-core/src/client/real_messages_control/real_traffic_stream/sending_delay_controller.rs b/common/client-core/src/client/real_messages_control/real_traffic_stream/sending_delay_controller.rs index d038ac624e4..234fdf91fb3 100644 --- a/common/client-core/src/client/real_messages_control/real_traffic_stream/sending_delay_controller.rs +++ b/common/client-core/src/client/real_messages_control/real_traffic_stream/sending_delay_controller.rs @@ -164,11 +164,11 @@ impl SendingDelayController { self.current_multiplier() ); if self.current_multiplier() > 0 { - log::debug!("{}", status_str); + log::debug!("{status_str}"); } else if self.current_multiplier() > 1 { - log::info!("{}", status_str); + log::info!("{status_str}"); } else if self.current_multiplier() > 2 { - log::warn!("{}", status_str); + log::warn!("{status_str}"); } self.time_when_logged_about_elevated_multiplier = now; } diff --git a/common/client-core/src/client/received_buffer.rs b/common/client-core/src/client/received_buffer.rs index 380e5194603..7504a4d39a2 100644 --- a/common/client-core/src/client/received_buffer.rs +++ b/common/client-core/src/client/received_buffer.rs @@ -221,10 +221,7 @@ impl ReceivedMessagesBuffer { let stored_messages = std::mem::take(&mut guard.messages); if !stored_messages.is_empty() { if let Err(err) = sender.unbounded_send(stored_messages) { - error!( - "The sender channel we just received is already invalidated - {:?}", - err - ); + error!("The sender channel we just received is already invalidated - {err:?}"); // put the values back to the buffer // the returned error has two fields: err: SendError and val: T, // where val is the value that was failed to get sent; diff --git a/common/client-core/src/client/replies/reply_controller/mod.rs b/common/client-core/src/client/replies/reply_controller/mod.rs index c043af1bdfa..bd649f67e96 100644 --- a/common/client-core/src/client/replies/reply_controller/mod.rs +++ b/common/client-core/src/client/replies/reply_controller/mod.rs @@ -217,14 +217,14 @@ where .surbs_storage_ref() .contains_surbs_for(&recipient_tag) { - warn!("received reply request for {:?} but we don't have any surbs stored for that recipient!", recipient_tag); + warn!("received reply request for {recipient_tag:?} but we don't have any surbs stored for that recipient!"); return; } - trace!("handling reply to {:?}", recipient_tag); + trace!("handling reply to {recipient_tag:?}"); let mut fragments = self.message_handler.split_reply_message(data); let total_size = fragments.len(); - trace!("This reply requires {:?} SURBs", total_size); + trace!("This reply requires {total_size:?} SURBs"); let available_surbs = self .full_reply_storage @@ -327,10 +327,7 @@ where .await { let err = err.return_unused_surbs(self.full_reply_storage.surbs_storage_ref(), &target); - warn!( - "failed to request additional surbs from {:?} - {err}", - target - ); + warn!("failed to request additional surbs from {target:?} - {err}"); return Err(err); } else { self.full_reply_storage @@ -409,10 +406,7 @@ where err.return_unused_surbs(self.full_reply_storage.surbs_storage_ref(), &target); self.re_insert_pending_retransmission(&target, to_take); - warn!( - "failed to clear pending retransmission queue for {:?} - {err}", - target - ); + warn!("failed to clear pending retransmission queue for {target:?} - {err}"); return; } }; @@ -489,7 +483,7 @@ where let err = err.return_unused_surbs(self.full_reply_storage.surbs_storage_ref(), &target); self.re_insert_pending_replies(&target, to_send); - warn!("failed to clear pending queue for {:?} - {err}", target); + warn!("failed to clear pending queue for {target:?} - {err}"); } } else { trace!("the pending queue is empty"); @@ -816,7 +810,7 @@ where if diff > max_drop_wait { to_remove.push(*pending_reply_target) } else { - debug!("We haven't received any surbs in {:?} from {pending_reply_target}. Going to explicitly ask for more", diff); + debug!("We haven't received any surbs in {diff:?} from {pending_reply_target}. Going to explicitly ask for more"); to_request.push(*pending_reply_target); } } diff --git a/common/client-core/src/client/statistics_control.rs b/common/client-core/src/client/statistics_control.rs index 01f4d25f1b6..6a9b1f0b091 100644 --- a/common/client-core/src/client/statistics_control.rs +++ b/common/client-core/src/client/statistics_control.rs @@ -93,7 +93,7 @@ impl StatisticsControl { None, ); if let Err(err) = self.report_tx.send(report_message).await { - log::error!("Failed to report client stats: {:?}", err); + log::error!("Failed to report client stats: {err:?}"); } else { self.stats.reset(); } diff --git a/common/client-core/src/client/transmission_buffer.rs b/common/client-core/src/client/transmission_buffer.rs index e6eb7d68911..d110766c353 100644 --- a/common/client-core/src/client/transmission_buffer.rs +++ b/common/client-core/src/client/transmission_buffer.rs @@ -211,7 +211,7 @@ impl TransmissionBuffer { }; let msg = self.pop_front_from_lane(&lane)?; - log::trace!("picking to send from lane: {:?}", lane); + log::trace!("picking to send from lane: {lane:?}"); Some((lane, msg)) } diff --git a/common/client-core/src/init/helpers.rs b/common/client-core/src/init/helpers.rs index 748e39dbb1c..ada24117328 100644 --- a/common/client-core/src/init/helpers.rs +++ b/common/client-core/src/init/helpers.rs @@ -110,7 +110,7 @@ pub async fn gateways_for_init( let gateways = client.get_all_basic_entry_assigned_nodes_v2().await?.nodes; info!("nym api reports {} gateways", gateways.len()); - log::trace!("Gateways: {:#?}", gateways); + log::trace!("Gateways: {gateways:#?}"); // filter out gateways below minimum performance and ones that could operate as a mixnode // (we don't want instability) @@ -121,7 +121,7 @@ pub async fn gateways_for_init( .filter_map(|gateway| gateway.try_into().ok()) .collect::>(); log::debug!("After checking validity: {}", valid_gateways.len()); - log::trace!("Valid gateways: {:#?}", valid_gateways); + log::trace!("Valid gateways: {valid_gateways:#?}"); log::info!( "and {} after validity and performance filtering", @@ -286,7 +286,7 @@ pub(super) fn get_specified_gateway( gateways: &[RoutingNode], must_use_tls: bool, ) -> Result { - log::debug!("Requesting specified gateway: {}", gateway_identity); + log::debug!("Requesting specified gateway: {gateway_identity}"); let user_gateway = ed25519::PublicKey::from_base58_string(gateway_identity) .map_err(ClientCoreError::UnableToCreatePublicKeyFromGatewayId)?; diff --git a/common/commands/src/utils.rs b/common/commands/src/utils.rs index 0d6e40ffbc7..4223263e5ac 100644 --- a/common/commands/src/utils.rs +++ b/common/commands/src/utils.rs @@ -49,14 +49,14 @@ pub fn show_error(e: E) where E: Display, { - error!("{}", e); + error!("{e}"); } pub fn show_error_passthrough(e: E) -> E where E: Error + Display, { - error!("{}", e); + error!("{e}"); e } diff --git a/common/commands/src/validator/account/balance.rs b/common/commands/src/validator/account/balance.rs index 4e109ad7b37..26ebd86a520 100644 --- a/common/commands/src/validator/account/balance.rs +++ b/common/commands/src/validator/account/balance.rs @@ -42,7 +42,7 @@ pub async fn query_balance( .address .unwrap_or_else(|| address_from_mnemonic.expect("please provide a mnemonic")); - info!("Getting balance for {}...", address); + info!("Getting balance for {address}..."); match client.get_all_balances(&address).await { Ok(coins) => { diff --git a/common/commands/src/validator/account/pubkey.rs b/common/commands/src/validator/account/pubkey.rs index 6a7c3383d60..ed419c11013 100644 --- a/common/commands/src/validator/account/pubkey.rs +++ b/common/commands/src/validator/account/pubkey.rs @@ -57,17 +57,17 @@ pub fn get_pubkey_from_mnemonic(address: AccountId, prefix: &str, mnemonic: bip3 println!("{}", account.public_key().to_string()); } None => { - error!("Could not derive key that matches {}", address) + error!("Could not derive key that matches {address}") } }, Err(e) => { - error!("Failed to derive accounts. {}", e); + error!("Failed to derive accounts. {e}"); } } } pub async fn get_pubkey_from_chain(address: AccountId, client: &QueryClient) { - info!("Getting public key for address {} from chain...", address); + info!("Getting public key for address {address} from chain..."); match client.get_account(&address).await { Ok(Some(account)) => { if let Ok(base_account) = account.try_get_base_account() { diff --git a/common/commands/src/validator/account/send_multiple.rs b/common/commands/src/validator/account/send_multiple.rs index 585aa896f37..762efdb8ab4 100644 --- a/common/commands/src/validator/account/send_multiple.rs +++ b/common/commands/src/validator/account/send_multiple.rs @@ -37,7 +37,7 @@ pub async fn send_multiple(args: Args, client: &SigningClient) { let rows = InputFileReader::new(&args.input); if let Err(e) = rows { - error!("Failed to read input file: {}", e); + error!("Failed to read input file: {e}"); return; } let rows = rows.unwrap(); @@ -67,7 +67,7 @@ pub async fn send_multiple(args: Args, client: &SigningClient) { .prompt(); if let Err(e) = ans { - info!("Aborting, {}...", e); + info!("Aborting, {e}..."); return; } if let Ok(false) = ans { @@ -100,13 +100,10 @@ pub async fn send_multiple(args: Args, client: &SigningClient) { println!("Transaction hash: {}", &res.hash); if let Some(output_filename) = args.output { - println!("\nWriting output log to {}", output_filename); + println!("\nWriting output log to {output_filename}"); if let Err(e) = write_output_file(rows, res, &output_filename) { - error!( - "Failed to write output file {} with error {}", - output_filename, e - ); + error!("Failed to write output file {output_filename} with error {e}"); } } } @@ -136,7 +133,7 @@ fn write_output_file( .collect::>() .join("\n"); - Ok(file.write_all(format!("{}\n", data).as_bytes())?) + Ok(file.write_all(format!("{data}\n").as_bytes())?) } #[derive(Debug)] @@ -171,7 +168,7 @@ impl InputFileReader { // multiply when a whole token amount, e.g. 50nym (50.123456nym is not allowed, that must be input as 50123456unym) let (amount, denom) = if !denom.starts_with('u') { - (amount * 1_000_000u128, format!("u{}", denom)) + (amount * 1_000_000u128, format!("u{denom}")) } else { (amount, denom) }; diff --git a/common/commands/src/validator/cosmwasm/execute_contract.rs b/common/commands/src/validator/cosmwasm/execute_contract.rs index 0dfc547430e..e5faa5cd036 100644 --- a/common/commands/src/validator/cosmwasm/execute_contract.rs +++ b/common/commands/src/validator/cosmwasm/execute_contract.rs @@ -55,6 +55,6 @@ pub async fn execute(args: Args, client: SigningClient) { .await { Ok(res) => info!("SUCCESS ✅\n{}", json!(res)), - Err(e) => error!("FAILURE ❌\n{}", e), + Err(e) => error!("FAILURE ❌\n{e}"), } } diff --git a/common/commands/src/validator/cosmwasm/generators/coconut_dkg.rs b/common/commands/src/validator/cosmwasm/generators/coconut_dkg.rs index 3a80ff4ca56..5f1b57b019e 100644 --- a/common/commands/src/validator/cosmwasm/generators/coconut_dkg.rs +++ b/common/commands/src/validator/cosmwasm/generators/coconut_dkg.rs @@ -43,7 +43,7 @@ pub struct Args { pub async fn generate(args: Args) { info!("Starting to generate vesting contract instantiate msg"); - debug!("Received arguments: {:?}", args); + debug!("Received arguments: {args:?}"); let multisig_addr = args.multisig_addr.unwrap_or_else(|| { let address = std::env::var(nym_network_defaults::var_names::REWARDING_VALIDATOR_ADDRESS) @@ -97,7 +97,7 @@ pub async fn generate(args: Args) { key_size: DEFAULT_DEALINGS as u32, }; - debug!("instantiate_msg: {:?}", instantiate_msg); + debug!("instantiate_msg: {instantiate_msg:?}"); let res = serde_json::to_string(&instantiate_msg).expect("failed to convert instantiate msg to json"); diff --git a/common/commands/src/validator/cosmwasm/generators/ecash_bandwidth.rs b/common/commands/src/validator/cosmwasm/generators/ecash_bandwidth.rs index f13bb65151b..52244d761b1 100644 --- a/common/commands/src/validator/cosmwasm/generators/ecash_bandwidth.rs +++ b/common/commands/src/validator/cosmwasm/generators/ecash_bandwidth.rs @@ -28,7 +28,7 @@ pub struct Args { pub async fn generate(args: Args) { info!("Starting to generate vesting contract instantiate msg"); - debug!("Received arguments: {:?}", args); + debug!("Received arguments: {args:?}"); let group_addr = args.group_addr.unwrap_or_else(|| { let address = std::env::var(nym_network_defaults::var_names::GROUP_CONTRACT_ADDRESS) @@ -51,7 +51,7 @@ pub async fn generate(args: Args) { deposit_amount: args.deposit_amount, }; - debug!("instantiate_msg: {:?}", instantiate_msg); + debug!("instantiate_msg: {instantiate_msg:?}"); let res = serde_json::to_string(&instantiate_msg).expect("failed to convert instantiate msg to json"); diff --git a/common/commands/src/validator/cosmwasm/generators/mixnet.rs b/common/commands/src/validator/cosmwasm/generators/mixnet.rs index 8a8081400e9..9226a02653c 100644 --- a/common/commands/src/validator/cosmwasm/generators/mixnet.rs +++ b/common/commands/src/validator/cosmwasm/generators/mixnet.rs @@ -88,7 +88,7 @@ pub struct Args { pub async fn generate(args: Args) { info!("Starting to generate mixnet contract instantiate msg"); - debug!("Received arguments: {:?}", args); + debug!("Received arguments: {args:?}"); let initial_rewarding_params = InitialRewardingParams { initial_reward_pool: Decimal::from_atomics(args.initial_reward_pool, 0) @@ -114,7 +114,7 @@ pub async fn generate(args: Args) { }, }; - debug!("initial_rewarding_params: {:?}", initial_rewarding_params); + debug!("initial_rewarding_params: {initial_rewarding_params:?}"); let rewarding_validator_address = args.rewarding_validator_address.unwrap_or_else(|| { let address = std::env::var(nym_network_defaults::var_names::REWARDING_VALIDATOR_ADDRESS) @@ -160,7 +160,7 @@ pub async fn generate(args: Args) { key_validity_in_epochs: None, }; - debug!("instantiate_msg: {:?}", instantiate_msg); + debug!("instantiate_msg: {instantiate_msg:?}"); let res = serde_json::to_string(&instantiate_msg).expect("failed to convert instantiate msg to json"); diff --git a/common/commands/src/validator/cosmwasm/generators/multisig.rs b/common/commands/src/validator/cosmwasm/generators/multisig.rs index 90abae9e28b..8b0b79e4fe5 100644 --- a/common/commands/src/validator/cosmwasm/generators/multisig.rs +++ b/common/commands/src/validator/cosmwasm/generators/multisig.rs @@ -31,7 +31,7 @@ pub struct Args { pub async fn generate(args: Args) { info!("Starting to generate vesting contract instantiate msg"); - debug!("Received arguments: {:?}", args); + debug!("Received arguments: {args:?}"); let ecash_contract_address = args.ecash_contract_address.unwrap_or_else(|| { let address = std::env::var(nym_network_defaults::var_names::ECASH_CONTRACT_ADDRESS) @@ -60,7 +60,7 @@ pub async fn generate(args: Args) { coconut_dkg_contract_address: coconut_dkg_contract_address.to_string(), }; - debug!("instantiate_msg: {:?}", instantiate_msg); + debug!("instantiate_msg: {instantiate_msg:?}"); let res = serde_json::to_string(&instantiate_msg).expect("failed to convert instantiate msg to json"); diff --git a/common/commands/src/validator/cosmwasm/generators/vesting.rs b/common/commands/src/validator/cosmwasm/generators/vesting.rs index 94f5cda0b2d..536520fa9c0 100644 --- a/common/commands/src/validator/cosmwasm/generators/vesting.rs +++ b/common/commands/src/validator/cosmwasm/generators/vesting.rs @@ -21,7 +21,7 @@ pub struct Args { pub async fn generate(args: Args) { info!("Starting to generate vesting contract instantiate msg"); - debug!("Received arguments: {:?}", args); + debug!("Received arguments: {args:?}"); let mixnet_contract_address = args.mixnet_contract_address.unwrap_or_else(|| { let address = std::env::var(nym_network_defaults::var_names::MIXNET_CONTRACT_ADDRESS) @@ -39,7 +39,7 @@ pub async fn generate(args: Args) { mix_denom, }; - debug!("instantiate_msg: {:?}", instantiate_msg); + debug!("instantiate_msg: {instantiate_msg:?}"); let res = serde_json::to_string(&instantiate_msg).expect("failed to convert instantiate msg to json"); diff --git a/common/commands/src/validator/cosmwasm/init_contract.rs b/common/commands/src/validator/cosmwasm/init_contract.rs index 430440be442..ca239d8f1a1 100644 --- a/common/commands/src/validator/cosmwasm/init_contract.rs +++ b/common/commands/src/validator/cosmwasm/init_contract.rs @@ -72,7 +72,7 @@ pub async fn init(args: Args, client: SigningClient, network_details: &NymNetwor .await .expect("failed to instantiate the contract!"); - info!("Init result: {:?}", res); + info!("Init result: {res:?}"); println!("{}", res.contract_address) } diff --git a/common/commands/src/validator/cosmwasm/migrate_contract.rs b/common/commands/src/validator/cosmwasm/migrate_contract.rs index f106ae8b17a..2dd38ccdd84 100644 --- a/common/commands/src/validator/cosmwasm/migrate_contract.rs +++ b/common/commands/src/validator/cosmwasm/migrate_contract.rs @@ -47,5 +47,5 @@ pub async fn migrate(args: Args, client: SigningClient) { .expect("failed to migrate the contract!") }; - info!("Migrate result: {:?}", res); + info!("Migrate result: {res:?}"); } diff --git a/common/commands/src/validator/cosmwasm/upload_contract.rs b/common/commands/src/validator/cosmwasm/upload_contract.rs index 96d01741eea..5a17b66013d 100644 --- a/common/commands/src/validator/cosmwasm/upload_contract.rs +++ b/common/commands/src/validator/cosmwasm/upload_contract.rs @@ -31,7 +31,7 @@ pub async fn upload(args: Args, client: SigningClient) { .await .expect("failed to upload the contract!"); - info!("Upload result: {:?}", res); + info!("Upload result: {res:?}"); println!("{}", res.code_id) } diff --git a/common/commands/src/validator/mixnet/delegators/delegate_to_mixnode.rs b/common/commands/src/validator/mixnet/delegators/delegate_to_mixnode.rs index dc8a2d591f4..f3b99513f76 100644 --- a/common/commands/src/validator/mixnet/delegators/delegate_to_mixnode.rs +++ b/common/commands/src/validator/mixnet/delegators/delegate_to_mixnode.rs @@ -47,5 +47,5 @@ pub async fn delegate_to_mixnode(args: Args, client: SigningClient) { .await .expect("failed to delegate to mixnode!"); - info!("delegating to mixnode: {:?}", res); + info!("delegating to mixnode: {res:?}"); } diff --git a/common/commands/src/validator/mixnet/delegators/delegate_to_multiple_mixnodes.rs b/common/commands/src/validator/mixnet/delegators/delegate_to_multiple_mixnodes.rs index 96bf95be04d..70eb85e7cd0 100644 --- a/common/commands/src/validator/mixnet/delegators/delegate_to_multiple_mixnodes.rs +++ b/common/commands/src/validator/mixnet/delegators/delegate_to_multiple_mixnodes.rs @@ -196,7 +196,7 @@ pub async fn delegate_to_multiple_mixnodes(args: Args, client: SigningClient) { let records = match InputFileReader::new(&args.input) { Ok(records) => records, Err(e) => { - println!("Error reading input file: {}", e); + println!("Error reading input file: {e}"); return; } }; @@ -262,11 +262,11 @@ pub async fn delegate_to_multiple_mixnodes(args: Args, client: SigningClient) { } if !undelegation_msgs.is_empty() { - println!("Undelegation records : \n{}\n\n", undelegation_table); + println!("Undelegation records : \n{undelegation_table}\n\n"); } if !delegation_msgs.is_empty() { - println!("Delegation records : \n{}\n\n", delegation_table); + println!("Delegation records : \n{delegation_table}\n\n"); } let ans = inquire::Confirm::new("Do you want to continue with the shown operations?") @@ -275,7 +275,7 @@ pub async fn delegate_to_multiple_mixnodes(args: Args, client: SigningClient) { .prompt(); if let Err(e) = ans { - info!("Aborting, {}...", e); + info!("Aborting, {e}..."); return; } @@ -348,7 +348,7 @@ pub async fn delegate_to_multiple_mixnodes(args: Args, client: SigningClient) { if args.output.is_some() { if let Err(e) = write_to_csv(output_details, args.output) { - info!("Failed to write to CSV, {}", e); + info!("Failed to write to CSV, {e}"); } } } diff --git a/common/commands/src/validator/mixnet/delegators/migrate_vested_delegation.rs b/common/commands/src/validator/mixnet/delegators/migrate_vested_delegation.rs index 8ac1ab9c07d..66a2a5d659f 100644 --- a/common/commands/src/validator/mixnet/delegators/migrate_vested_delegation.rs +++ b/common/commands/src/validator/mixnet/delegators/migrate_vested_delegation.rs @@ -38,5 +38,5 @@ pub async fn migrate_vested_delegation(args: Args, client: SigningClient) { .await .expect("failed to migrate delegation!"); - info!("migration result: {:?}", res) + info!("migration result: {res:?}") } diff --git a/common/commands/src/validator/mixnet/delegators/rewards/claim_delegator_reward.rs b/common/commands/src/validator/mixnet/delegators/rewards/claim_delegator_reward.rs index 83426a316e8..8b876831afb 100644 --- a/common/commands/src/validator/mixnet/delegators/rewards/claim_delegator_reward.rs +++ b/common/commands/src/validator/mixnet/delegators/rewards/claim_delegator_reward.rs @@ -40,5 +40,5 @@ pub async fn claim_delegator_reward(args: Args, client: SigningClient) { .await .expect("failed to claim delegator-reward"); - info!("Claiming delegator reward: {:?}", res) + info!("Claiming delegator reward: {res:?}") } diff --git a/common/commands/src/validator/mixnet/delegators/rewards/vesting_claim_delegator_reward.rs b/common/commands/src/validator/mixnet/delegators/rewards/vesting_claim_delegator_reward.rs index d36c4a7b174..b0e9df21bdd 100644 --- a/common/commands/src/validator/mixnet/delegators/rewards/vesting_claim_delegator_reward.rs +++ b/common/commands/src/validator/mixnet/delegators/rewards/vesting_claim_delegator_reward.rs @@ -40,5 +40,5 @@ pub async fn vesting_claim_delegator_reward(args: Args, client: SigningClient) { .await .expect("failed to claim vesting delegator-reward"); - info!("Claiming vesting delegator reward: {:?}", res) + info!("Claiming vesting delegator reward: {res:?}") } diff --git a/common/commands/src/validator/mixnet/delegators/undelegate_from_mixnode.rs b/common/commands/src/validator/mixnet/delegators/undelegate_from_mixnode.rs index 19593ed5ce5..edcd646e90b 100644 --- a/common/commands/src/validator/mixnet/delegators/undelegate_from_mixnode.rs +++ b/common/commands/src/validator/mixnet/delegators/undelegate_from_mixnode.rs @@ -40,5 +40,5 @@ pub async fn undelegate_from_mixnode(args: Args, client: SigningClient) { .await .expect("failed to remove stake from mixnode!"); - info!("removing stake from mixnode: {:?}", res) + info!("removing stake from mixnode: {res:?}") } diff --git a/common/commands/src/validator/mixnet/delegators/vesting_delegate_to_mixnode.rs b/common/commands/src/validator/mixnet/delegators/vesting_delegate_to_mixnode.rs index 3fa3fd7cee0..28351541f51 100644 --- a/common/commands/src/validator/mixnet/delegators/vesting_delegate_to_mixnode.rs +++ b/common/commands/src/validator/mixnet/delegators/vesting_delegate_to_mixnode.rs @@ -53,5 +53,5 @@ pub async fn vesting_delegate_to_mixnode(args: Args, client: SigningClient) { .await .expect("failed to delegate to mixnode!"); - info!("vesting delegating to mixnode: {:?}", res); + info!("vesting delegating to mixnode: {res:?}"); } diff --git a/common/commands/src/validator/mixnet/delegators/vesting_undelegate_from_mixnode.rs b/common/commands/src/validator/mixnet/delegators/vesting_undelegate_from_mixnode.rs index 9daf8691d3d..c02f87e055a 100644 --- a/common/commands/src/validator/mixnet/delegators/vesting_undelegate_from_mixnode.rs +++ b/common/commands/src/validator/mixnet/delegators/vesting_undelegate_from_mixnode.rs @@ -45,5 +45,5 @@ pub async fn vesting_undelegate_from_mixnode(args: Args, client: SigningClient) .await .expect("failed to remove stake from vesting account on mixnode!"); - info!("removing stake from vesting mixnode: {:?}", res) + info!("removing stake from vesting mixnode: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/gateway/bond_gateway.rs b/common/commands/src/validator/mixnet/operators/gateway/bond_gateway.rs index 28fe1600706..c11246c46e1 100644 --- a/common/commands/src/validator/mixnet/operators/gateway/bond_gateway.rs +++ b/common/commands/src/validator/mixnet/operators/gateway/bond_gateway.rs @@ -73,5 +73,5 @@ pub async fn bond_gateway(args: Args, client: SigningClient) { .await .expect("failed to bond gateway!"); - info!("Bonding result: {:?}", res) + info!("Bonding result: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/gateway/nymnode_migration.rs b/common/commands/src/validator/mixnet/operators/gateway/nymnode_migration.rs index a6b22a2d4b5..c1189f18859 100644 --- a/common/commands/src/validator/mixnet/operators/gateway/nymnode_migration.rs +++ b/common/commands/src/validator/mixnet/operators/gateway/nymnode_migration.rs @@ -52,5 +52,5 @@ pub async fn migrate_to_nymnode(args: Args, client: SigningClient) { .await .expect("failed to migrate gateway!"); - info!("migration result: {:?}", res) + info!("migration result: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/gateway/settings/update_config.rs b/common/commands/src/validator/mixnet/operators/gateway/settings/update_config.rs index c0cf8791475..a1b5a8d4bd6 100644 --- a/common/commands/src/validator/mixnet/operators/gateway/settings/update_config.rs +++ b/common/commands/src/validator/mixnet/operators/gateway/settings/update_config.rs @@ -56,5 +56,5 @@ pub async fn update_config(args: Args, client: SigningClient) { .await .expect("updating gateway config"); - info!("gateway config updated: {:?}", res) + info!("gateway config updated: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/gateway/settings/vesting_update_config.rs b/common/commands/src/validator/mixnet/operators/gateway/settings/vesting_update_config.rs index 346b652b2f1..8ebc9279bf7 100644 --- a/common/commands/src/validator/mixnet/operators/gateway/settings/vesting_update_config.rs +++ b/common/commands/src/validator/mixnet/operators/gateway/settings/vesting_update_config.rs @@ -57,5 +57,5 @@ pub async fn vesting_update_config(args: Args, client: SigningClient) { .await .expect("updating vesting gateway config"); - info!("gateway config updated: {:?}", res) + info!("gateway config updated: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/gateway/unbond_gateway.rs b/common/commands/src/validator/mixnet/operators/gateway/unbond_gateway.rs index af9c6c8bb45..cef6dbcf7f4 100644 --- a/common/commands/src/validator/mixnet/operators/gateway/unbond_gateway.rs +++ b/common/commands/src/validator/mixnet/operators/gateway/unbond_gateway.rs @@ -17,5 +17,5 @@ pub async fn unbond_gateway(client: SigningClient) { .await .expect("failed to unbond gateway!"); - info!("Unbonding result: {:?}", res) + info!("Unbonding result: {res:?}") } 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 91c2817be84..4f5f63d16ba 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 @@ -73,5 +73,5 @@ pub async fn vesting_bond_gateway(args: Args, client: SigningClient) { .await .expect("failed to bond gateway!"); - info!("Vesting bonding gateway result: {:?}", res) + info!("Vesting bonding gateway result: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/gateway/vesting_unbond_gateway.rs b/common/commands/src/validator/mixnet/operators/gateway/vesting_unbond_gateway.rs index 1c4312424c2..72b9357daba 100644 --- a/common/commands/src/validator/mixnet/operators/gateway/vesting_unbond_gateway.rs +++ b/common/commands/src/validator/mixnet/operators/gateway/vesting_unbond_gateway.rs @@ -17,5 +17,5 @@ pub async fn vesting_unbond_gateway(client: SigningClient) { .await .expect("failed to unbond vesting gateway!"); - info!("Unbonding vesting result: {:?}", res) + info!("Unbonding vesting result: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/bond_mixnode.rs b/common/commands/src/validator/mixnet/operators/mixnode/bond_mixnode.rs index 410ce91d289..b8de001f2df 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/bond_mixnode.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/bond_mixnode.rs @@ -106,5 +106,5 @@ pub async fn bond_mixnode(args: Args, client: SigningClient) { .await .expect("failed to bond mixnode!"); - info!("Bonding result: {:?}", res) + info!("Bonding result: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/decrease_pledge.rs b/common/commands/src/validator/mixnet/operators/mixnode/decrease_pledge.rs index 556021dcf9d..bd96aeb2709 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/decrease_pledge.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/decrease_pledge.rs @@ -25,5 +25,5 @@ pub async fn decrease_pledge(args: Args, client: SigningClient) { .await .expect("failed to decrease pledge!"); - info!("decreasing pledge: {:?}", res); + info!("decreasing pledge: {res:?}"); } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/migrate_vested_mixnode.rs b/common/commands/src/validator/mixnet/operators/mixnode/migrate_vested_mixnode.rs index 95bd9d0573c..ae2ec7395dd 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/migrate_vested_mixnode.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/migrate_vested_mixnode.rs @@ -15,5 +15,5 @@ pub async fn migrate_vested_mixnode(_args: Args, client: SigningClient) { .await .expect("failed to migrate mixnode!"); - info!("migration result: {:?}", res) + info!("migration result: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/nymnode_migration.rs b/common/commands/src/validator/mixnet/operators/mixnode/nymnode_migration.rs index fe46e2c11ac..3f736c86f49 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/nymnode_migration.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/nymnode_migration.rs @@ -15,5 +15,5 @@ pub async fn migrate_to_nymnode(_args: Args, client: SigningClient) { .await .expect("failed to migrate mixnode!"); - info!("migration result: {:?}", res) + info!("migration result: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/pledge_more.rs b/common/commands/src/validator/mixnet/operators/mixnode/pledge_more.rs index 19897259077..51ba9daa4d3 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/pledge_more.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/pledge_more.rs @@ -25,5 +25,5 @@ pub async fn pledge_more(args: Args, client: SigningClient) { .await .expect("failed to pledge more!"); - info!("pledging more: {:?}", res); + info!("pledging more: {res:?}"); } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/rewards/claim_operator_reward.rs b/common/commands/src/validator/mixnet/operators/mixnode/rewards/claim_operator_reward.rs index a5f8d652367..f3e97d0df21 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/rewards/claim_operator_reward.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/rewards/claim_operator_reward.rs @@ -17,5 +17,5 @@ pub async fn claim_operator_reward(_args: Args, client: SigningClient) { .await .expect("failed to claim operator reward"); - info!("Claiming operator reward: {:?}", res) + info!("Claiming operator reward: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/rewards/vesting_claim_operator_reward.rs b/common/commands/src/validator/mixnet/operators/mixnode/rewards/vesting_claim_operator_reward.rs index 3b88c6cf5ce..38c2ccf41c6 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/rewards/vesting_claim_operator_reward.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/rewards/vesting_claim_operator_reward.rs @@ -20,5 +20,5 @@ pub async fn vesting_claim_operator_reward(client: SigningClient) { .await .expect("failed to claim vesting operator reward"); - info!("Claiming vesting operator reward: {:?}", res) + info!("Claiming vesting operator reward: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/settings/update_config.rs b/common/commands/src/validator/mixnet/operators/mixnode/settings/update_config.rs index 733dea04a12..31db3435b24 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/settings/update_config.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/settings/update_config.rs @@ -64,5 +64,5 @@ pub async fn update_config(args: Args, client: SigningClient) { .await .expect("updating mix-node config"); - info!("mixnode config updated: {:?}", res) + info!("mixnode config updated: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/settings/vesting_update_config.rs b/common/commands/src/validator/mixnet/operators/mixnode/settings/vesting_update_config.rs index a495c8f4b5e..092aa54d821 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/settings/vesting_update_config.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/settings/vesting_update_config.rs @@ -65,5 +65,5 @@ pub async fn vesting_update_config(client: SigningClient, args: Args) { .await .expect("updating vesting mix-node config"); - info!("mixnode config updated: {:?}", res) + info!("mixnode config updated: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/unbond_mixnode.rs b/common/commands/src/validator/mixnet/operators/mixnode/unbond_mixnode.rs index fe6f3df2235..bf6864ef5ed 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/unbond_mixnode.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/unbond_mixnode.rs @@ -18,5 +18,5 @@ pub async fn unbond_mixnode(_args: Args, client: SigningClient) { .await .expect("failed to unbond mixnode!"); - info!("Unbonding result: {:?}", res) + info!("Unbonding result: {res:?}") } 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 d55d6463e7f..6813ea2dfde 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 @@ -106,5 +106,5 @@ pub async fn vesting_bond_mixnode(client: SigningClient, args: Args, denom: &str .await .expect("failed to bond vesting mixnode!"); - info!("Bonding vesting result: {:?}", res) + info!("Bonding vesting result: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/vesting_decrease_pledge.rs b/common/commands/src/validator/mixnet/operators/mixnode/vesting_decrease_pledge.rs index bb83e1ffaa4..1ffb1de3609 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/vesting_decrease_pledge.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/vesting_decrease_pledge.rs @@ -25,5 +25,5 @@ pub async fn vesting_decrease_pledge(args: Args, client: SigningClient) { .await .expect("failed to vesting decrease pledge!"); - info!("vesting decreasing pledge: {:?}", res); + info!("vesting decreasing pledge: {res:?}"); } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/vesting_pledge_more.rs b/common/commands/src/validator/mixnet/operators/mixnode/vesting_pledge_more.rs index 9917e02860c..e53c9b9cfe8 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/vesting_pledge_more.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/vesting_pledge_more.rs @@ -26,5 +26,5 @@ pub async fn vesting_pledge_more(args: Args, client: SigningClient) { .await .expect("failed to pledge more!"); - info!("vesting pledge more: {:?}", res); + info!("vesting pledge more: {res:?}"); } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/vesting_unbond_mixnode.rs b/common/commands/src/validator/mixnet/operators/mixnode/vesting_unbond_mixnode.rs index 3e63846430f..b3d52bdb734 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/vesting_unbond_mixnode.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/vesting_unbond_mixnode.rs @@ -20,5 +20,5 @@ pub async fn vesting_unbond_mixnode(client: SigningClient) { .await .expect("failed to unbond vesting mixnode!"); - info!("Unbonding vesting result: {:?}", res) + info!("Unbonding vesting result: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/nymnode/bond_nymnode.rs b/common/commands/src/validator/mixnet/operators/nymnode/bond_nymnode.rs index acde3d39e37..145e2458636 100644 --- a/common/commands/src/validator/mixnet/operators/nymnode/bond_nymnode.rs +++ b/common/commands/src/validator/mixnet/operators/nymnode/bond_nymnode.rs @@ -85,5 +85,5 @@ pub async fn bond_nymnode(args: Args, client: SigningClient) { .await .expect("failed to bond nymnode!"); - info!("Bonding result: {:?}", res) + info!("Bonding result: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/nymnode/pledge/decrease_pledge.rs b/common/commands/src/validator/mixnet/operators/nymnode/pledge/decrease_pledge.rs index a299ddbe659..4bb20b4a66c 100644 --- a/common/commands/src/validator/mixnet/operators/nymnode/pledge/decrease_pledge.rs +++ b/common/commands/src/validator/mixnet/operators/nymnode/pledge/decrease_pledge.rs @@ -25,5 +25,5 @@ pub async fn decrease_pledge(args: Args, client: SigningClient) { .await .expect("failed to decrease pledge!"); - info!("decreasing pledge: {:?}", res); + info!("decreasing pledge: {res:?}"); } diff --git a/common/commands/src/validator/mixnet/operators/nymnode/pledge/increase_pledge.rs b/common/commands/src/validator/mixnet/operators/nymnode/pledge/increase_pledge.rs index 09b94bc5d5c..31a0eb7a8dd 100644 --- a/common/commands/src/validator/mixnet/operators/nymnode/pledge/increase_pledge.rs +++ b/common/commands/src/validator/mixnet/operators/nymnode/pledge/increase_pledge.rs @@ -25,5 +25,5 @@ pub async fn increase_pledge(args: Args, client: SigningClient) { .await .expect("failed to pledge more!"); - info!("pledging more: {:?}", res); + info!("pledging more: {res:?}"); } diff --git a/common/commands/src/validator/mixnet/operators/nymnode/rewards/claim_operator_reward.rs b/common/commands/src/validator/mixnet/operators/nymnode/rewards/claim_operator_reward.rs index a8f157f6612..005e81f0695 100644 --- a/common/commands/src/validator/mixnet/operators/nymnode/rewards/claim_operator_reward.rs +++ b/common/commands/src/validator/mixnet/operators/nymnode/rewards/claim_operator_reward.rs @@ -17,5 +17,5 @@ pub async fn claim_operator_reward(_args: Args, client: SigningClient) { .await .expect("failed to claim operator reward"); - info!("Claiming operator reward: {:?}", res) + info!("Claiming operator reward: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/nymnode/settings/update_config.rs b/common/commands/src/validator/mixnet/operators/nymnode/settings/update_config.rs index 5ba5bf52fa6..fb59924c9ea 100644 --- a/common/commands/src/validator/mixnet/operators/nymnode/settings/update_config.rs +++ b/common/commands/src/validator/mixnet/operators/nymnode/settings/update_config.rs @@ -46,5 +46,5 @@ pub async fn update_config(args: Args, client: SigningClient) { .await .expect("updating nym node config"); - info!("nym node config updated: {:?}", res) + info!("nym node config updated: {res:?}") } diff --git a/common/commands/src/validator/mixnet/operators/nymnode/settings/update_cost_params.rs b/common/commands/src/validator/mixnet/operators/nymnode/settings/update_cost_params.rs index 5668c92e0d2..a513067a02a 100644 --- a/common/commands/src/validator/mixnet/operators/nymnode/settings/update_cost_params.rs +++ b/common/commands/src/validator/mixnet/operators/nymnode/settings/update_cost_params.rs @@ -68,6 +68,6 @@ pub async fn update_cost_params(args: Args, client: SigningClient) -> anyhow::Re .await .expect("failed to update cost params"); - info!("Cost params result: {:?}", res); + info!("Cost params result: {res:?}"); Ok(()) } diff --git a/common/commands/src/validator/mixnet/operators/nymnode/unbond_nymnode.rs b/common/commands/src/validator/mixnet/operators/nymnode/unbond_nymnode.rs index fbcef6bfd74..d60266a12d0 100644 --- a/common/commands/src/validator/mixnet/operators/nymnode/unbond_nymnode.rs +++ b/common/commands/src/validator/mixnet/operators/nymnode/unbond_nymnode.rs @@ -18,5 +18,5 @@ pub async fn unbond_nymnode(_args: Args, client: SigningClient) { .await .expect("failed to unbond Nym Node!"); - info!("Unbonding result: {:?}", res) + info!("Unbonding result: {res:?}") } diff --git a/common/commands/src/validator/signature/sign.rs b/common/commands/src/validator/signature/sign.rs index 424dfd184b6..7df1d12eb6b 100644 --- a/common/commands/src/validator/signature/sign.rs +++ b/common/commands/src/validator/signature/sign.rs @@ -52,7 +52,7 @@ pub fn sign(args: Args, prefix: &str, mnemonic: Option) { println!("{}", json!(output)); } Err(e) => { - error!("Failed to sign message. {}", e); + error!("Failed to sign message. {e}"); } } } @@ -61,7 +61,7 @@ pub fn sign(args: Args, prefix: &str, mnemonic: Option) { } }, Err(e) => { - error!("Failed to derive accounts. {}", e); + error!("Failed to derive accounts. {e}"); } } } diff --git a/common/commands/src/validator/signature/verify.rs b/common/commands/src/validator/signature/verify.rs index 391c5105d8c..7168b75b92b 100644 --- a/common/commands/src/validator/signature/verify.rs +++ b/common/commands/src/validator/signature/verify.rs @@ -38,7 +38,7 @@ pub async fn verify(args: Args, client: &QueryClient) { let public_key = match AccountId::from_str(&args.public_key_or_address) { Ok(address) => { - info!("Found account address instead of public key, so looking up public key for {} from chain", address); + info!("Found account address instead of public key, so looking up public key for {address} from chain"); match client.get_account_public_key(&address).await.ok() { Some(public_key) => { if let Some(k) = public_key { @@ -48,8 +48,7 @@ pub async fn verify(args: Args, client: &QueryClient) { } None => { error!( - "Address {} does not have a public key recorded on the chain. This is probably because the account has never signed a transaction.", - address + "Address {address} does not have a public key recorded on the chain. This is probably because the account has never signed a transaction." ); None } @@ -58,7 +57,7 @@ pub async fn verify(args: Args, client: &QueryClient) { Err(_) => match PublicKey::from_json(&args.public_key_or_address) { Ok(parsed) => Some(parsed), Err(e) => { - error!("Public key should be JSON. Unable to parse: {}", e); + error!("Public key should be JSON. Unable to parse: {e}"); None } }, @@ -78,7 +77,7 @@ pub async fn verify(args: Args, client: &QueryClient) { ) { Ok(()) => println!("SUCCESS ✅ signature verified"), Err(e) => { - error!("FAILURE ❌ Signature verification failed: {}", e); + error!("FAILURE ❌ Signature verification failed: {e}"); } } } diff --git a/common/commands/src/validator/vesting/create_vesting_schedule.rs b/common/commands/src/validator/vesting/create_vesting_schedule.rs index 35ee669dabe..b166202af08 100644 --- a/common/commands/src/validator/vesting/create_vesting_schedule.rs +++ b/common/commands/src/validator/vesting/create_vesting_schedule.rs @@ -86,6 +86,6 @@ pub async fn create(args: Args, client: SigningClient, network_details: &NymNetw .await .unwrap(); - info!("Vesting result: {:?}", res); - info!("Coin send result: {:?}", send_coin_response); + info!("Vesting result: {res:?}"); + info!("Coin send result: {send_coin_response:?}"); } diff --git a/common/commands/src/validator/vesting/query_vesting_schedule.rs b/common/commands/src/validator/vesting/query_vesting_schedule.rs index 0baca858f12..df3736b94d2 100644 --- a/common/commands/src/validator/vesting/query_vesting_schedule.rs +++ b/common/commands/src/validator/vesting/query_vesting_schedule.rs @@ -29,7 +29,7 @@ pub async fn query(args: Args, client: QueryClient, address_from_mnemonic: Optio .address .unwrap_or_else(|| address_from_mnemonic.expect("please provide a mnemonic")); - info!("Checking account {} for a vesting schedule...", account_id); + info!("Checking account {account_id} for a vesting schedule..."); let vesting_address = account_id.to_string(); let denom = client.current_chain_details().mix_denom.base.as_str(); diff --git a/common/credential-utils/src/utils.rs b/common/credential-utils/src/utils.rs index be7133b4c29..1aeab19ed8a 100644 --- a/common/credential-utils/src/utils.rs +++ b/common/credential-utils/src/utils.rs @@ -95,7 +95,7 @@ where } else if let Some(final_timestamp) = epoch.final_timestamp_secs() { // Use 1 additional second to not start the next iteration immediately and spam get_current_epoch queries let secs_until_final = final_timestamp.saturating_sub(current_timestamp_secs) + 1; - info!("Approximately {} seconds until coconut is available. Sleeping until then. You can safely kill the process at any moment.", secs_until_final); + info!("Approximately {secs_until_final} seconds until coconut is available. Sleeping until then. You can safely kill the process at any moment."); tokio::time::sleep(Duration::from_secs(secs_until_final)).await; } else if matches!(epoch.state, EpochState::WaitingInitialisation) { info!("dkg hasn't been initialised yet and it is not known when it will be. Going to check again later"); diff --git a/common/gateway-stats-storage/build.rs b/common/gateway-stats-storage/build.rs index 166349c67ad..cef40420c9c 100644 --- a/common/gateway-stats-storage/build.rs +++ b/common/gateway-stats-storage/build.rs @@ -7,9 +7,9 @@ use std::env; #[tokio::main] async fn main() { let out_dir = env::var("OUT_DIR").unwrap(); - let database_path = format!("{}/gateway-stats-example.sqlite", out_dir); + let database_path = format!("{out_dir}/gateway-stats-example.sqlite"); - let mut conn = SqliteConnection::connect(&format!("sqlite://{}?mode=rwc", database_path)) + let mut conn = SqliteConnection::connect(&format!("sqlite://{database_path}?mode=rwc")) .await .expect("Failed to create SQLx database connection"); diff --git a/common/gateway-storage/build.rs b/common/gateway-storage/build.rs index 27d55fccd29..9b46e078408 100644 --- a/common/gateway-storage/build.rs +++ b/common/gateway-storage/build.rs @@ -7,9 +7,9 @@ use std::env; #[tokio::main] async fn main() { let out_dir = env::var("OUT_DIR").unwrap(); - let database_path = format!("{}/gateway-example.sqlite", out_dir); + let database_path = format!("{out_dir}/gateway-example.sqlite"); - let mut conn = SqliteConnection::connect(&format!("sqlite://{}?mode=rwc", database_path)) + let mut conn = SqliteConnection::connect(&format!("sqlite://{database_path}?mode=rwc")) .await .expect("Failed to create SQLx database connection"); diff --git a/common/gateway-storage/src/clients.rs b/common/gateway-storage/src/clients.rs index 96b5f857eb0..8bee61e04b8 100644 --- a/common/gateway-storage/src/clients.rs +++ b/common/gateway-storage/src/clients.rs @@ -37,7 +37,7 @@ impl std::fmt::Display for ClientType { ClientType::EntryWireguard => "entry_wireguard", ClientType::ExitWireguard => "exit_wireguard", }; - write!(f, "{}", s) + write!(f, "{s}") } } diff --git a/common/http-api-client/src/user_agent.rs b/common/http-api-client/src/user_agent.rs index fee71752bb1..54fe6ac24e4 100644 --- a/common/http-api-client/src/user_agent.rs +++ b/common/http-api-client/src/user_agent.rs @@ -141,7 +141,7 @@ mod tests { }; assert_eq!( - format!("{}", user_agent), + format!("{user_agent}"), "nym-mixnode/0.11.0/x86_64-unknown-linux-gnu/abcdefg" ); } diff --git a/common/http-api-common/Cargo.toml b/common/http-api-common/Cargo.toml index 1de2a0a8c44..4a405c155ea 100644 --- a/common/http-api-common/Cargo.toml +++ b/common/http-api-common/Cargo.toml @@ -19,6 +19,7 @@ colored = { workspace = true, optional = true } futures = { workspace = true, optional = true } mime = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } serde_yaml = { workspace = true, optional = true } subtle = { workspace = true, optional = true } time = { workspace = true, optional = true, features = ["macros"] } diff --git a/common/http-api-common/src/response/json.rs b/common/http-api-common/src/response/json.rs index b2c904b7ee5..a1b46e7d50c 100644 --- a/common/http-api-common/src/response/json.rs +++ b/common/http-api-common/src/response/json.rs @@ -7,7 +7,6 @@ use axum::http::{header, HeaderValue}; use axum::response::{IntoResponse, Response}; use bytes::{BufMut, BytesMut}; use serde::Serialize; -use utoipa::gen::serde_json; // don't use axum's Json directly as we need to be able to define custom headers #[derive(Debug, Clone, Default)] diff --git a/common/ip-packet-requests/src/v8/request.rs b/common/ip-packet-requests/src/v8/request.rs index c5e49e83b75..964065578ba 100644 --- a/common/ip-packet-requests/src/v8/request.rs +++ b/common/ip-packet-requests/src/v8/request.rs @@ -191,7 +191,7 @@ impl fmt::Display for IpPacketRequestData { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { IpPacketRequestData::Data(_) => write!(f, "Data"), - IpPacketRequestData::Control(c) => write!(f, "Control({})", c), + IpPacketRequestData::Control(c) => write!(f, "Control({c})"), } } } diff --git a/common/network-defaults/build.rs b/common/network-defaults/build.rs index 64de45df773..2164bd2820d 100644 --- a/common/network-defaults/build.rs +++ b/common/network-defaults/build.rs @@ -30,7 +30,7 @@ fn main() { for var in variables_to_track { // if script fails, debug with `cargo check -vv`` - println!("Looking for {}", var); + println!("Looking for {var}"); // read pattern that looks like: // : &str = "" @@ -41,7 +41,7 @@ fn main() { .captures(source_of_truth) .and_then(|caps| caps.get(1).map(|match_| match_.as_str().to_string())) .expect("Couldn't find var in source file"); - println!("Storing {}={}", var, value); + println!("Storing {var}={value}"); replace_with.insert(var, value); } @@ -57,13 +57,11 @@ fn main() { // = let re = Regex::new(&pattern).unwrap(); contents = re - .replace(&contents, |_: ®ex::Captures| { - format!(r#"{}={}"#, var, value) - }) + .replace(&contents, |_: ®ex::Captures| format!(r#"{var}={value}"#)) .to_string(); } - println!("File contents to write:\n{}", contents); + println!("File contents to write:\n{contents}"); if output_path.exists() { fs::write(output_path, contents).unwrap(); } else { diff --git a/common/network-defaults/src/env_setup.rs b/common/network-defaults/src/env_setup.rs index 4ab07259a72..fb670563877 100644 --- a/common/network-defaults/src/env_setup.rs +++ b/common/network-defaults/src/env_setup.rs @@ -25,7 +25,7 @@ fn print_env_vars_with_keys_in_file + Copy>(config_env_file: P) { .expect("Invalid path to environment configuration file"); for item in items { let (key, val) = item.expect("Invalid item in environment configuration file"); - log::debug!("{}: {}", key, val); + log::debug!("{key}: {val}"); } } diff --git a/common/network-defaults/src/network.rs b/common/network-defaults/src/network.rs index 28cf7e23497..e8fd8fcfa8e 100644 --- a/common/network-defaults/src/network.rs +++ b/common/network-defaults/src/network.rs @@ -119,7 +119,7 @@ impl NymNetworkDetails { } } Err(VarError::NotPresent) => None, - err => panic!("Unable to set: {:?}", err), + err => panic!("Unable to set: {err:?}"), } } diff --git a/common/nym-metrics/src/lib.rs b/common/nym-metrics/src/lib.rs index dbe950e48a6..8694ea73d13 100644 --- a/common/nym-metrics/src/lib.rs +++ b/common/nym-metrics/src/lib.rs @@ -344,9 +344,9 @@ impl fmt::Display for MetricsController { let metrics = self.gather(); let output = match String::from_utf8(metrics) { Ok(output) => output, - Err(e) => return write!(f, "Error decoding metrics to String: {}", e), + Err(e) => return write!(f, "Error decoding metrics to String: {e}"), }; - write!(f, "{}", output) + write!(f, "{output}") } } @@ -597,7 +597,7 @@ mod tests { assert_eq!(literal, "nym_metrics_foo"); let bar = "bar"; - let format = format!("foomp_{}", bar); + let format = format!("foomp_{bar}"); let formatted = prepend_package_name!(format); assert_eq!(formatted, "nym_metrics_foomp_bar"); } diff --git a/common/nym_offline_compact_ecash/src/scheme/setup.rs b/common/nym_offline_compact_ecash/src/scheme/setup.rs index dd469fb0094..349706fe47c 100644 --- a/common/nym_offline_compact_ecash/src/scheme/setup.rs +++ b/common/nym_offline_compact_ecash/src/scheme/setup.rs @@ -26,7 +26,7 @@ impl GroupParameters { pub fn new(attributes: usize) -> GroupParameters { assert!(attributes > 0); let gammas = (1..=attributes) - .map(|i| hash_g1(format!("gamma{}", i))) + .map(|i| hash_g1(format!("gamma{i}"))) .collect(); let delta = hash_g1("delta"); diff --git a/common/socks5-client-core/src/lib.rs b/common/socks5-client-core/src/lib.rs index 9c112e7928c..17140d39fcc 100644 --- a/common/socks5-client-core/src/lib.rs +++ b/common/socks5-client-core/src/lib.rs @@ -197,7 +197,7 @@ where let res = tokio::select! { biased; message = receiver.next() => { - log::debug!("Received message: {:?}", message); + log::debug!("Received message: {message:?}"); match message { Some(Socks5ControlMessage::Stop) => { log::info!("Received stop message"); @@ -209,7 +209,7 @@ where Ok(()) } Some(msg) = shutdown.wait_for_error() => { - log::info!("Task error: {:?}", msg); + log::info!("Task error: {msg:?}"); Err(msg) } _ = tokio::signal::ctrl_c() => { diff --git a/common/socks5-client-core/src/socks/client.rs b/common/socks5-client-core/src/socks/client.rs index 572849d2962..5d79d663805 100644 --- a/common/socks5-client-core/src/socks/client.rs +++ b/common/socks5-client-core/src/socks/client.rs @@ -579,7 +579,7 @@ impl SocksClient { ); // Get valid auth methods let methods = self.get_available_methods().await?; - trace!("methods: {:?}", methods); + trace!("methods: {methods:?}"); let mut response = [0u8; 2]; diff --git a/common/socks5-client-core/src/socks/mixnet_responses.rs b/common/socks5-client-core/src/socks/mixnet_responses.rs index 05cb5bd48d5..f74681c8def 100644 --- a/common/socks5-client-core/src/socks/mixnet_responses.rs +++ b/common/socks5-client-core/src/socks/mixnet_responses.rs @@ -61,7 +61,7 @@ impl MixnetResponseListener { control_response: ControlResponse, ) -> Result<(), Socks5ClientCoreError> { error!("received a control response which we don't know how to handle yet!"); - error!("got: {:?}", control_response); + error!("got: {control_response:?}"); // I guess we'd need another channel here to forward those to where they need to go @@ -88,7 +88,7 @@ impl MixnetResponseListener { } Socks5ResponseContent::Query(response) => { error!("received a query response which we don't know how to handle yet!"); - error!("got: {:?}", response); + error!("got: {response:?}"); // I guess we'd need another channel here to forward those to where they need to go diff --git a/common/socks5/proxy-helpers/src/proxy_runner/inbound.rs b/common/socks5/proxy-helpers/src/proxy_runner/inbound.rs index e63df378514..6cdf0efa9cd 100644 --- a/common/socks5/proxy-helpers/src/proxy_runner/inbound.rs +++ b/common/socks5/proxy-helpers/src/proxy_runner/inbound.rs @@ -122,8 +122,7 @@ where biased; _ = &mut shutdown_future => { debug!( - "closing inbound proxy after outbound was closed {:?} ago", - SHUTDOWN_TIMEOUT + "closing inbound proxy after outbound was closed {SHUTDOWN_TIMEOUT:?} ago" ); // inform remote just in case it was closed because of lack of heartbeat. // worst case the remote will just have couple of false negatives @@ -169,7 +168,7 @@ where } } } - trace!("{} - inbound closed", connection_id); + trace!("{connection_id} - inbound closed"); shutdown_notify.notify_one(); shutdown_listener.disarm(); diff --git a/common/socks5/proxy-helpers/src/proxy_runner/outbound.rs b/common/socks5/proxy-helpers/src/proxy_runner/outbound.rs index 63d49fb3111..dddae8d894f 100644 --- a/common/socks5/proxy-helpers/src/proxy_runner/outbound.rs +++ b/common/socks5/proxy-helpers/src/proxy_runner/outbound.rs @@ -72,12 +72,12 @@ pub(super) async fn run_outbound( } } _ = &mut mix_timeout => { - warn!("didn't get anything from the client on {} mixnet in {:?}. Shutting down the proxy.", connection_id, MIX_TTL); + warn!("didn't get anything from the client on {connection_id} mixnet in {MIX_TTL:?}. Shutting down the proxy."); // If they were online it's kinda their fault they didn't send any heartbeat messages. break; } _ = &mut shutdown_future => { - debug!("closing outbound proxy after inbound was closed {:?} ago", SHUTDOWN_TIMEOUT); + debug!("closing outbound proxy after inbound was closed {SHUTDOWN_TIMEOUT:?} ago"); break; } _ = shutdown_listener.recv() => { @@ -87,7 +87,7 @@ pub(super) async fn run_outbound( } } - trace!("{} - outbound closed", connection_id); + trace!("{connection_id} - outbound closed"); shutdown_notify.notify_one(); shutdown_listener.disarm(); diff --git a/common/socks5/requests/src/request.rs b/common/socks5/requests/src/request.rs index 28a5182d001..32d9b4e9e24 100644 --- a/common/socks5/requests/src/request.rs +++ b/common/socks5/requests/src/request.rs @@ -360,7 +360,7 @@ impl Socks5RequestContent { let query_bytes: Vec = make_bincode_serializer() .serialize(&query) .tap_err(|err| { - log::error!("Failed to serialize query request: {:?}: {err}", query); + log::error!("Failed to serialize query request: {query:?}: {err}"); }) .unwrap_or_default(); std::iter::once(RequestFlag::Query as u8) diff --git a/common/socks5/requests/src/response.rs b/common/socks5/requests/src/response.rs index 584f39df5ba..08e45c1de91 100644 --- a/common/socks5/requests/src/response.rs +++ b/common/socks5/requests/src/response.rs @@ -213,7 +213,7 @@ impl Socks5ResponseContent { let query_bytes: Vec = make_bincode_serializer() .serialize(&query) .tap_err(|err| { - log::error!("Failed to serialize query response: {:?}: {err}", query); + log::error!("Failed to serialize query response: {query:?}: {err}"); }) .unwrap_or_default(); std::iter::once(ResponseFlag::Query as u8) diff --git a/common/statistics/src/clients/gateway_conn_statistics.rs b/common/statistics/src/clients/gateway_conn_statistics.rs index 961c7a0f7fb..bb42c676d58 100644 --- a/common/statistics/src/clients/gateway_conn_statistics.rs +++ b/common/statistics/src/clients/gateway_conn_statistics.rs @@ -77,7 +77,7 @@ impl GatewayStatsControl { fn report_counters(&self) { log::trace!("packet statistics: {:?}", &self.stats); let (summary_sent, summary_recv) = self.stats.summary(); - log::debug!("{}", summary_sent); - log::debug!("{}", summary_recv); + log::debug!("{summary_sent}"); + log::debug!("{summary_recv}"); } } diff --git a/common/statistics/src/clients/nym_api_statistics.rs b/common/statistics/src/clients/nym_api_statistics.rs index 9c3ee609c0c..ddba38c0a80 100644 --- a/common/statistics/src/clients/nym_api_statistics.rs +++ b/common/statistics/src/clients/nym_api_statistics.rs @@ -77,7 +77,7 @@ impl NymApiStatsControl { fn report_counters(&self) { log::trace!("packet statistics: {:?}", &self.stats); let (summary_sent, summary_recv) = self.stats.summary(); - log::debug!("{}", summary_sent); - log::debug!("{}", summary_recv); + log::debug!("{summary_sent}"); + log::debug!("{summary_recv}"); } } diff --git a/common/statistics/src/clients/packet_statistics.rs b/common/statistics/src/clients/packet_statistics.rs index 866215c7514..b2c6f56d5c5 100644 --- a/common/statistics/src/clients/packet_statistics.rs +++ b/common/statistics/src/clients/packet_statistics.rs @@ -529,8 +529,8 @@ impl PacketStatisticsControl { fn report_counters(&self) { log::trace!("packet statistics: {:?}", &self.stats); let (summary_sent, summary_recv) = self.stats.summary(); - log::debug!("{}", summary_sent); - log::debug!("{}", summary_recv); + log::debug!("{summary_sent}"); + log::debug!("{summary_recv}"); } fn check_for_notable_events(&self) { diff --git a/common/statistics/src/lib.rs b/common/statistics/src/lib.rs index 6eb1eea7ff4..ad105c9f45b 100644 --- a/common/statistics/src/lib.rs +++ b/common/statistics/src/lib.rs @@ -41,7 +41,7 @@ fn generate_stats_id>(prefix: &str, id_seed: M) -> String { hasher.update(prefix); hasher.update(&id_seed); let output = hasher.finalize(); - format!("{:x}", output) + format!("{output:x}") } pub fn hash_identifier>(identifier: M) -> String { diff --git a/common/task/src/connections.rs b/common/task/src/connections.rs index 8557b84676f..35f448c6221 100644 --- a/common/task/src/connections.rs +++ b/common/task/src/connections.rs @@ -94,7 +94,7 @@ impl LaneQueueLengths { log::warn!("Timeout reached while waiting for queue to clear"); break; } - log::trace!("Waiting for queue to clear ({} items left)", lane_length); + log::trace!("Waiting for queue to clear ({lane_length} items left)"); tokio::time::sleep(Duration::from_millis(100)).await; } } diff --git a/common/task/src/manager.rs b/common/task/src/manager.rs index ba605f5a559..d5af78fcc05 100644 --- a/common/task/src/manager.rs +++ b/common/task/src/manager.rs @@ -163,7 +163,7 @@ impl TaskManager { // Announce that we are operational. This means that in the application where this is used, // everything is up and running and ready to go. if let Err(msg) = sender.send(Box::new(start_status)).await { - log::error!("Error sending status message: {}", msg); + log::error!("Error sending status message: {msg}"); }; if let Some(mut task_status_rx) = self.task_status_rx.take() { diff --git a/common/task/src/signal.rs b/common/task/src/signal.rs index 483c7c630ba..ebaab7b20fe 100644 --- a/common/task/src/signal.rs +++ b/common/task/src/signal.rs @@ -49,7 +49,7 @@ pub async fn wait_for_signal_and_error(shutdown: &mut TaskManager) -> Result<(), Ok(()) } Some(msg) = shutdown.wait_for_error() => { - log::info!("Task error: {:?}", msg); + log::info!("Task error: {msg:?}"); Err(msg) } } @@ -63,7 +63,7 @@ pub async fn wait_for_signal_and_error(shutdown: &mut TaskManager) -> Result<(), Ok(()) }, Some(msg) = shutdown.wait_for_error() => { - log::info!("Task error: {:?}", msg); + log::info!("Task error: {msg:?}"); Err(msg) } } diff --git a/common/tun/src/linux/tun_device.rs b/common/tun/src/linux/tun_device.rs index ab3bbd71b7b..936a141b3f8 100644 --- a/common/tun/src/linux/tun_device.rs +++ b/common/tun/src/linux/tun_device.rs @@ -157,7 +157,7 @@ impl TunDevice { "-6", "addr", "add", - &format!("{}/{}", ipv6, netmaskv6), + &format!("{ipv6}/{netmaskv6}"), "dev", (tun.name()), ]) diff --git a/common/wireguard/src/lib.rs b/common/wireguard/src/lib.rs index 3858d476bc9..6b83c648d23 100644 --- a/common/wireguard/src/lib.rs +++ b/common/wireguard/src/lib.rs @@ -38,7 +38,7 @@ impl Drop for WgApiWrapper { fn drop(&mut self) { if let Err(e) = defguard_wireguard_rs::WireguardInterfaceApi::remove_interface(&self.inner) { - log::error!("Could not remove the wireguard interface: {:?}", e); + log::error!("Could not remove the wireguard interface: {e:?}"); } } } diff --git a/documentation/autodoc/src/main.rs b/documentation/autodoc/src/main.rs index 7f9513097cf..812677fb999 100644 --- a/documentation/autodoc/src/main.rs +++ b/documentation/autodoc/src/main.rs @@ -163,7 +163,7 @@ fn main() -> io::Result<()> { write_output_to_file(&mut file, output)?; for (subcommand, subsubcommands) in subcommands { - writeln!(file, "\n## `{}` ", subcommand)?; + writeln!(file, "\n## `{subcommand}` ")?; let output = Command::new(main_command) .arg(subcommand) .arg("--help") @@ -195,12 +195,12 @@ fn execute_command_own_file(main_command: &str, subcommand: &str) -> io::Result< || get_last_word_from_filepath(main_command).unwrap() == "nym-node") && subcommand == "run" { - info!("SKIPPING {} {}", main_command, subcommand); + info!("SKIPPING {main_command} {subcommand}"); } else { let last_word = get_last_word_from_filepath(main_command); let output = Command::new(main_command).arg(subcommand).output()?; if !output.stdout.is_empty() { - info!("creating own file for {} {}", main_command, subcommand,); + info!("creating own file for {main_command} {subcommand}",); if !fs::metadata(WRITE_PATH) .map(|metadata| metadata.is_dir()) .unwrap_or(false) @@ -216,10 +216,7 @@ fn execute_command_own_file(main_command: &str, subcommand: &str) -> io::Result< write_output_to_file(&mut file, output)?; // execute help - info!( - "creating own file for {} {} --help", - main_command, subcommand, - ); + info!("creating own file for {main_command} {subcommand} --help",); if !fs::metadata(COMMAND_PATH) .map(|metadata| metadata.is_dir()) .unwrap_or(false) @@ -243,10 +240,7 @@ fn execute_command_own_file(main_command: &str, subcommand: &str) -> io::Result< debug!("empty stdout - nothing to write"); } } else { - info!( - "creating own file for {} {} --help", - main_command, subcommand, - ); + info!("creating own file for {main_command} {subcommand} --help",); if !fs::metadata(COMMAND_PATH) .map(|metadata| metadata.is_dir()) .unwrap_or(false) @@ -281,7 +275,7 @@ fn execute_command( if subsubcommand.is_some() { writeln!(file, "\n## `{} {}`", subcommand, subsubcommand.unwrap())?; - info!("executing {} {} --help ", main_command, subcommand); + info!("executing {main_command} {subcommand} --help "); let output = Command::new(main_command) .arg(subcommand) .arg(subsubcommand.unwrap()) @@ -294,7 +288,7 @@ fn execute_command( } // just subcommands } else { - writeln!(file, "\n## `{}`", subcommand)?; + writeln!(file, "\n## `{subcommand}`")?; // execute help let output = Command::new(main_command) @@ -318,9 +312,9 @@ fn execute_command( || get_last_word_from_filepath(main_command).unwrap() == "nymvisor" && subcommand == "run" { - info!("SKIPPING {} {}", main_command, subcommand); + info!("SKIPPING {main_command} {subcommand}"); } else { - info!("executing {} {}", main_command, subcommand); + info!("executing {main_command} {subcommand}"); let output = Command::new(main_command).arg(subcommand).output()?; if !output.stdout.is_empty() { writeln!(file, "Example output:")?; diff --git a/nym-api/build.rs b/nym-api/build.rs index 10307c5dfdd..6bc476b72f6 100644 --- a/nym-api/build.rs +++ b/nym-api/build.rs @@ -9,14 +9,14 @@ const SQLITE_DB_FILENAME: &str = "nym-api-example.sqlite"; #[tokio::main] async fn main() { let out_dir = env::var("OUT_DIR").unwrap(); - let database_path = format!("{}/{}", out_dir, SQLITE_DB_FILENAME); + let database_path = format!("{out_dir}/{SQLITE_DB_FILENAME}"); #[cfg(target_family = "unix")] write_db_path_to_file(&out_dir, SQLITE_DB_FILENAME) .await .ok(); - let mut conn = SqliteConnection::connect(&format!("sqlite://{}?mode=rwc", database_path)) + let mut conn = SqliteConnection::connect(&format!("sqlite://{database_path}?mode=rwc")) .await .expect("Failed to create SQLx database connection"); @@ -87,8 +87,7 @@ async fn write_db_path_to_file(out_dir: &str, db_filename: &str) -> anyhow::Resu let mut file = File::create("enter_db.sh").await?; let contents = format!( "#!/bin/sh\n\ - sqlite3 -init settings.sql {}/{}", - out_dir, db_filename, + sqlite3 -init settings.sql {out_dir}/{db_filename}", ); file.write_all(contents.as_bytes()).await?; diff --git a/nym-api/src/ecash/dkg/state/serde_helpers.rs b/nym-api/src/ecash/dkg/state/serde_helpers.rs index 8057ef5d204..a19141e443c 100644 --- a/nym-api/src/ecash/dkg/state/serde_helpers.rs +++ b/nym-api/src/ecash/dkg/state/serde_helpers.rs @@ -19,7 +19,7 @@ pub(super) mod bte_pk_serde { { let vec: Vec = Deserialize::deserialize(deserializer)?; PublicKeyWithProof::try_from_bytes(&vec) - .map_err(|err| Error::custom(format_args!("{:?}", err))) + .map_err(|err| Error::custom(format_args!("{err:?}"))) .map(Box::new) } } @@ -55,7 +55,7 @@ pub(super) mod recovered_keys { .into_iter() .map(|(idx, rec)| { RecoveredVerificationKeys::try_from_bytes(&rec) - .map_err(|err| D::Error::custom(format_args!("{:?}", err))) + .map_err(|err| D::Error::custom(format_args!("{err:?}"))) .map(|vk| (idx, vk)) }) .collect() diff --git a/nym-api/src/epoch_operations/helpers.rs b/nym-api/src/epoch_operations/helpers.rs index d21fd1aadbd..f28021058c2 100644 --- a/nym-api/src/epoch_operations/helpers.rs +++ b/nym-api/src/epoch_operations/helpers.rs @@ -171,9 +171,9 @@ mod tests { }; if a > b { - assert!(a - b < epsilon, "{} != {}", a, b) + assert!(a - b < epsilon, "{a} != {b}") } else { - assert!(b - a < epsilon, "{} != {}", a, b) + assert!(b - a < epsilon, "{a} != {b}") } } diff --git a/nym-api/tests/public-api/network.rs b/nym-api/tests/public-api/network.rs index 62f2440011d..b6e1e3bc4c7 100644 --- a/nym-api/tests/public-api/network.rs +++ b/nym-api/tests/public-api/network.rs @@ -7,7 +7,7 @@ async fn test_get_chain_status() -> Result<(), String> { .get(&url) .send() .await - .map_err(|err| format!("Failed to send request to {}: {}", url, err))?; + .map_err(|err| format!("Failed to send request to {url}: {err}"))?; let json = validate_json_response(res).await?; let block_header = json @@ -35,7 +35,7 @@ async fn test_get_network_details() -> Result<(), String> { .get(&url) .send() .await - .map_err(|err| format!("Failed to send request to {}: {}", url, err))?; + .map_err(|err| format!("Failed to send request to {url}: {err}"))?; let json = validate_json_response(res).await?; assert!( @@ -60,7 +60,7 @@ async fn test_get_nym_contracts() -> Result<(), String> { .get(&url) .send() .await - .map_err(|err| format!("Failed to send request to {}: {}", url, err))?; + .map_err(|err| format!("Failed to send request to {url}: {err}"))?; let json = validate_json_response(res).await?; assert!( @@ -81,7 +81,7 @@ async fn test_get_nym_contracts_detailed() -> Result<(), String> { .get(&url) .send() .await - .map_err(|err| format!("Failed to send request to {}: {}", url, err))?; + .map_err(|err| format!("Failed to send request to {url}: {err}"))?; let json = validate_json_response(res).await?; let mixnet_contract = json diff --git a/nym-api/tests/public-api/nym_nodes.rs b/nym-api/tests/public-api/nym_nodes.rs index 63ff057d45b..dda646b3b82 100644 --- a/nym-api/tests/public-api/nym_nodes.rs +++ b/nym-api/tests/public-api/nym_nodes.rs @@ -90,7 +90,7 @@ async fn test_get_historical_performance() -> Result<(), String> { .query(&[("date", date)]) .send() .await - .map_err(|err| format!("Failed to send request to {}: {}", url, err))?; + .map_err(|err| format!("Failed to send request to {url}: {err}"))?; let json = validate_json_response(res).await?; assert!( diff --git a/nym-api/tests/public-api/unstable_status.rs b/nym-api/tests/public-api/unstable_status.rs index fe363296462..52a0084480a 100644 --- a/nym-api/tests/public-api/unstable_status.rs +++ b/nym-api/tests/public-api/unstable_status.rs @@ -87,7 +87,7 @@ async fn test_get_latest_network_monitor_run_details() -> Result<(), String> { .get(&follow_up_url) .send() .await - .map_err(|err| format!("Failed to follow up with URL {}: {}", follow_up_url, err))?; + .map_err(|err| format!("Failed to follow up with URL {follow_up_url}: {err}"))?; assert!(follow_up_res.status().is_success()); Ok(()) } diff --git a/nym-api/tests/public-api/utils.rs b/nym-api/tests/public-api/utils.rs index 96c8c3b61eb..ad0f61f6534 100644 --- a/nym-api/tests/public-api/utils.rs +++ b/nym-api/tests/public-api/utils.rs @@ -25,7 +25,7 @@ pub async fn make_request(url: &str) -> Result { .get(url) .send() .await - .map_err(|err| format!("Failed to send request to {}: {}", url, err))?; + .map_err(|err| format!("Failed to send request to {url}: {err}"))?; if res.status().is_success() { Ok(res) @@ -43,7 +43,7 @@ pub async fn validate_json_response(res: Response) -> Result { res.json::() .await - .map_err(|err| format!("Invalid JSON response: {}", err)) + .map_err(|err| format!("Invalid JSON response: {err}")) } #[allow(dead_code)] @@ -54,11 +54,11 @@ pub async fn get_any_node_id() -> Result { .get(&url) .send() .await - .map_err(|err| format!("Failed to send request to {}: {}", url, err))?; + .map_err(|err| format!("Failed to send request to {url}: {err}"))?; let json: Value = res .json() .await - .map_err(|err| format!("Failed to parse response as JSON: {}", err))?; + .map_err(|err| format!("Failed to parse response as JSON: {err}"))?; let id = json .get("data") @@ -80,11 +80,11 @@ pub async fn get_mixnode_node_id() -> Result { .get(&url) .send() .await - .map_err(|err| format!("Failed to send request to {}: {}", url, err))?; + .map_err(|err| format!("Failed to send request to {url}: {err}"))?; let json: Value = res .json() .await - .map_err(|err| format!("Failed to parse response as JSON: {}", err))?; + .map_err(|err| format!("Failed to parse response as JSON: {err}"))?; json.get("data") .and_then(|v| v.as_array()) @@ -110,11 +110,11 @@ pub async fn get_gateway_identity_key() -> Result { .get(&url) .send() .await - .map_err(|err| format!("Failed to send request to {}: {}", url, err))?; + .map_err(|err| format!("Failed to send request to {url}: {err}"))?; let json: Value = res .json() .await - .map_err(|err| format!("Failed to parse response as JSON: {}", err))?; + .map_err(|err| format!("Failed to parse response as JSON: {err}"))?; let key = json .get("data") diff --git a/nym-credential-proxy/nym-credential-proxy/src/storage/mod.rs b/nym-credential-proxy/nym-credential-proxy/src/storage/mod.rs index 5480f96d5b5..1759ccdfc3b 100644 --- a/nym-credential-proxy/nym-credential-proxy/src/storage/mod.rs +++ b/nym-credential-proxy/nym-credential-proxy/src/storage/mod.rs @@ -389,7 +389,7 @@ mod tests { let file = NamedTempFile::new()?; let path = file.into_temp_path(); - println!("Creating database at {:?}...", path); + println!("Creating database at {path:?}..."); Ok(StorageTestWrapper { inner: VpnApiStorage::init(&path).await?, @@ -455,11 +455,11 @@ mod tests { .insert_new_pending_async_shares_request(dummy_uuid, "1234", "1234") .await; if let Err(e) = &res { - println!("❌ {}", e); + println!("❌ {e}"); } assert!(res.is_ok()); let res = res.unwrap(); - println!("res = {:?}", res); + println!("res = {res:?}"); assert_eq!(res.status, BlindedSharesStatus::Pending); println!("🚀 update_pending_blinded_share_error..."); @@ -467,11 +467,11 @@ mod tests { .update_pending_async_blinded_shares_error(0, "1234", "1234", "this is an error") .await; if let Err(e) = &res { - println!("❌ {}", e); + println!("❌ {e}"); } assert!(res.is_ok()); let res = res.unwrap(); - println!("res = {:?}", res); + println!("res = {res:?}"); assert!(res.error_message.is_some()); assert_eq!(res.status, BlindedSharesStatus::Error); @@ -480,11 +480,11 @@ mod tests { .update_pending_async_blinded_shares_issued(42, "1234", "1234") .await; if let Err(e) = &res { - println!("❌ {}", e); + println!("❌ {e}"); } assert!(res.is_ok()); let res = res.unwrap(); - println!("res = {:?}", res); + println!("res = {res:?}"); assert_eq!(res.status, BlindedSharesStatus::Issued); assert!(res.error_message.is_none()); diff --git a/nym-network-monitor/src/accounting.rs b/nym-network-monitor/src/accounting.rs index 9132e582c0b..caddfe1db62 100644 --- a/nym-network-monitor/src/accounting.rs +++ b/nym-network-monitor/src/accounting.rs @@ -430,7 +430,7 @@ async fn db_connection(database_url: Option<&String>) -> Result) -> anyhow::Result<( pub async fn submit_metrics(database_url: Option<&String>) -> anyhow::Result<()> { if let Err(e) = submit_metrics_to_db(database_url).await { - error!("Error submitting metrics to db: {}", e); + error!("Error submitting metrics to db: {e}"); } if let Some(private_key) = PRIVATE_KEY.get() { diff --git a/nym-network-monitor/src/http.rs b/nym-network-monitor/src/http.rs index 72556563448..6608345242b 100644 --- a/nym-network-monitor/src/http.rs +++ b/nym-network-monitor/src/http.rs @@ -84,7 +84,7 @@ impl HttpServer { axum::serve(listener, app).with_graceful_shutdown(self.cancel.cancelled_owned()); info!("##########################################################################################"); - info!("######################### HTTP server running, with {} clients ############################################", n_clients); + info!("######################### HTTP server running, with {n_clients} clients ############################################"); info!("##########################################################################################"); server_future.await?; diff --git a/nym-network-monitor/src/main.rs b/nym-network-monitor/src/main.rs index 3442cfe7ea0..56702eb7b05 100644 --- a/nym-network-monitor/src/main.rs +++ b/nym-network-monitor/src/main.rs @@ -26,7 +26,7 @@ use tokio::{signal::ctrl_c, sync::RwLock}; use tokio_util::sync::CancellationToken; static NYM_API_URL: LazyLock = LazyLock::new(|| { - std::env::var(NYM_API).unwrap_or_else(|_| panic!("{} env var not set", NYM_API)) + std::env::var(NYM_API).unwrap_or_else(|_| panic!("{NYM_API} env var not set")) }); static MIXNET_TIMEOUT: OnceCell = OnceCell::const_new(); @@ -48,10 +48,10 @@ async fn make_clients( ) { loop { let spawned_clients = clients.read().await.len(); - info!("Currently spawned clients: {}", spawned_clients); + info!("Currently spawned clients: {spawned_clients}"); // If we have enough clients, sleep for a minute and remove the oldest one if spawned_clients >= n_clients { - info!("New client will be spawned in {} seconds", lifetime); + info!("New client will be spawned in {lifetime} seconds"); tokio::time::sleep(tokio::time::Duration::from_secs(lifetime)).await; info!("Removing oldest client"); if let Some(dropped_client) = clients.write().await.pop_front() { @@ -74,7 +74,7 @@ async fn make_clients( let client = match make_client(topology.clone()).await { Ok(client) => client, Err(err) => { - warn!("{}, moving on", err); + warn!("{err}, moving on"); continue; } }; diff --git a/nym-node-status-api/nym-node-status-agent/src/main.rs b/nym-node-status-api/nym-node-status-agent/src/main.rs index d3078753fac..0415864d9fd 100644 --- a/nym-node-status-api/nym-node-status-agent/src/main.rs +++ b/nym-node-status-api/nym-node-status-agent/src/main.rs @@ -51,7 +51,7 @@ pub(crate) fn setup_tracing() { "axum", ]; for crate_name in filter_crates { - filter = filter.add_directive(directive_checked(format!("{}=warn", crate_name))); + filter = filter.add_directive(directive_checked(format!("{crate_name}=warn"))); } filter = filter.add_directive(directive_checked("nym_bin_common=debug")); diff --git a/nym-node-status-api/nym-node-status-agent/src/probe.rs b/nym-node-status-api/nym-node-status-agent/src/probe.rs index 67e7e508c68..08d0a823aa9 100644 --- a/nym-node-status-api/nym-node-status-agent/src/probe.rs +++ b/nym-node-status-api/nym-node-status-agent/src/probe.rs @@ -30,7 +30,7 @@ impl GwProbe { } Err(e) => { error!("Failed to stat binary at {}: {}", &self.path, e); - return format!("Failed to access binary: {}", e); + return format!("Failed to access binary: {e}"); } } } @@ -55,17 +55,17 @@ impl GwProbe { output.status.code().unwrap_or(-1), stderr ); - format!("Command failed: {}", stderr) + format!("Command failed: {stderr}") } } Err(e) => { error!("Failed to get command output: {}", e); - format!("Failed to get command output: {}", e) + format!("Failed to get command output: {e}") } }, Err(e) => { error!("Failed to spawn process: {}", e); - format!("Failed to spawn process: {}", e) + format!("Failed to spawn process: {e}") } } } diff --git a/nym-node-status-api/nym-node-status-api/build.rs b/nym-node-status-api/nym-node-status-api/build.rs index 1032fcb691f..9da6d48d2ad 100644 --- a/nym-node-status-api/nym-node-status-api/build.rs +++ b/nym-node-status-api/nym-node-status-api/build.rs @@ -13,7 +13,7 @@ const SQLITE_DB_FILENAME: &str = "nym-node-status-api.sqlite"; #[tokio::main(flavor = "current_thread")] async fn main() -> Result<()> { let out_dir = read_env_var("OUT_DIR")?; - let database_path = format!("{}/{}?mode=rwc", out_dir, SQLITE_DB_FILENAME); + let database_path = format!("{out_dir}/{SQLITE_DB_FILENAME}?mode=rwc"); write_db_path_to_file(&out_dir, SQLITE_DB_FILENAME).await?; let mut conn = SqliteConnection::connect(&database_path).await?; @@ -44,8 +44,7 @@ async fn write_db_path_to_file(out_dir: &str, db_filename: &str) -> anyhow::Resu let mut file = File::create("enter_db.sh").await?; let contents = format!( "#!/bin/bash\n\ - sqlite3 -init settings.sql {}/{}", - out_dir, db_filename, + sqlite3 -init settings.sql {out_dir}/{db_filename}", ); file.write_all(contents.as_bytes()).await?; diff --git a/nym-node-status-api/nym-node-status-api/src/http/error.rs b/nym-node-status-api/nym-node-status-api/src/http/error.rs index ce0e0f4060e..0282958054e 100644 --- a/nym-node-status-api/nym-node-status-api/src/http/error.rs +++ b/nym-node-status-api/nym-node-status-api/src/http/error.rs @@ -44,7 +44,7 @@ impl HttpError { pub(crate) fn no_delegations_for_node(node_id: NodeId) -> Self { Self { - message: format!("No delegation data for node_id={}", node_id), + message: format!("No delegation data for node_id={node_id}"), status: axum::http::StatusCode::NOT_FOUND, } } diff --git a/nym-node-status-api/nym-node-status-api/src/http/models.rs b/nym-node-status-api/nym-node-status-api/src/http/models.rs index 2ddd8e19dfe..d99da2c6986 100644 --- a/nym-node-status-api/nym-node-status-api/src/http/models.rs +++ b/nym-node-status-api/nym-node-status-api/src/http/models.rs @@ -230,7 +230,7 @@ impl DVpnGateway { fn to_percent(performance: u8) -> String { let fraction = performance as f32 / 100.0; - format!("{:.2}", fraction) + format!("{fraction:.2}") } #[cfg(test)] diff --git a/nym-node-status-api/nym-node-status-api/src/http/server.rs b/nym-node-status-api/nym-node-status-api/src/http/server.rs index 36c55a787a6..548fc6206dd 100644 --- a/nym-node-status-api/nym-node-status-api/src/http/server.rs +++ b/nym-node-status-api/nym-node-status-api/src/http/server.rs @@ -35,7 +35,7 @@ pub(crate) async fn start_http_api( .await; let router = router_builder.with_state(state); - let bind_addr = format!("0.0.0.0:{}", http_port); + let bind_addr = format!("0.0.0.0:{http_port}"); tracing::info!("Binding server to {bind_addr}"); let server = router.build_server(bind_addr).await?; diff --git a/nym-node-status-api/nym-node-status-api/src/logging.rs b/nym-node-status-api/nym-node-status-api/src/logging.rs index 67913d28ae8..c4581af1698 100644 --- a/nym-node-status-api/nym-node-status-api/src/logging.rs +++ b/nym-node-status-api/nym-node-status-api/src/logging.rs @@ -39,7 +39,7 @@ pub(crate) fn setup_tracing_logger() -> anyhow::Result<()> { "hickory_resolver", ]; for crate_name in warn_crates { - filter = filter.add_directive(directive_checked(format!("{}=warn", crate_name))?); + filter = filter.add_directive(directive_checked(format!("{crate_name}=warn"))?); } let log_level_hint = filter.max_level_hint(); diff --git a/nym-node-status-api/nym-node-status-api/src/monitor/mod.rs b/nym-node-status-api/nym-node-status-api/src/monitor/mod.rs index 7461837fe05..0711299088c 100644 --- a/nym-node-status-api/nym-node-status-api/src/monitor/mod.rs +++ b/nym-node-status-api/nym-node-status-api/src/monitor/mod.rs @@ -299,7 +299,7 @@ impl Monitor { let mut log_lines: Vec = vec![]; for (key, value) in nodes_summary.iter() { - log_lines.push(format!("{} = {}", key, value)); + log_lines.push(format!("{key} = {value}")); } tracing::info!("Directory summary: \n{}", log_lines.join("\n")); diff --git a/nym-node-status-api/nym-node-status-api/src/testruns/queue.rs b/nym-node-status-api/nym-node-status-api/src/testruns/queue.rs index fa44a9ef940..e36dc548f81 100644 --- a/nym-node-status-api/nym-node-status-api/src/testruns/queue.rs +++ b/nym-node-status-api/nym-node-status-api/src/testruns/queue.rs @@ -85,10 +85,7 @@ pub(crate) async fn try_queue_testrun( // save test run // let status = TestRunStatus::Queued as u32; - let log = format!( - "Test for {identity_key} requested at {} UTC\n\n", - timestamp_pretty - ); + let log = format!("Test for {identity_key} requested at {timestamp_pretty} UTC\n\n"); let id = sqlx::query!( "INSERT INTO testruns (gateway_id, status, ip_address, created_utc, log) VALUES (?, ?, ?, ?, ?)", diff --git a/nym-node-status-api/nym-node-status-client/src/lib.rs b/nym-node-status-api/nym-node-status-client/src/lib.rs index 39e802cde95..00e260e6b5b 100644 --- a/nym-node-status-api/nym-node-status-client/src/lib.rs +++ b/nym-node-status-api/nym-node-status-client/src/lib.rs @@ -16,7 +16,7 @@ pub struct NsApiClient { impl NsApiClient { pub fn new(server_ip: &str, server_port: u16, auth_key: PrivateKey) -> Self { - let server_address = format!("{}:{}", server_ip, server_port); + let server_address = format!("{server_ip}:{server_port}"); let api = ApiPaths::new(server_address); let client = reqwest::Client::new(); diff --git a/nym-node/src/logging.rs b/nym-node/src/logging.rs index 332e2749444..4852b686358 100644 --- a/nym-node/src/logging.rs +++ b/nym-node/src/logging.rs @@ -16,7 +16,7 @@ pub(crate) fn granual_filtered_env() -> anyhow::Result anyhow::Result<()> { "nym_http_api_client", ]; for crate_name in warn_crates { - filter = filter.add_directive(directive_checked(format!("{}=warn", crate_name))?); + filter = filter.add_directive(directive_checked(format!("{crate_name}=warn"))?); } let log_level_hint = filter.max_level_hint(); diff --git a/nym-wallet/Cargo.lock b/nym-wallet/Cargo.lock index 2a3692d0567..a53976a9607 100644 --- a/nym-wallet/Cargo.lock +++ b/nym-wallet/Cargo.lock @@ -4229,6 +4229,7 @@ version = "0.1.0" dependencies = [ "bincode", "serde", + "serde_json", "tracing", ] diff --git a/nym-wallet/src-tauri/src/config/mod.rs b/nym-wallet/src-tauri/src/config/mod.rs index 548f135173d..b5c1ccdfbae 100644 --- a/nym-wallet/src-tauri/src/config/mod.rs +++ b/nym-wallet/src-tauri/src/config/mod.rs @@ -145,8 +145,8 @@ impl Config { .map_err(io::Error::other) .map(|toml| fs::write(location.clone(), toml)) { - Ok(_) => log::debug!("Writing to: {:#?}", location), - Err(err) => log::warn!("Failed to write to {:#?}: {err}", location), + Ok(_) => log::debug!("Writing to: {location:#?}"), + Err(err) => log::warn!("Failed to write to {location:#?}: {err}"), } } @@ -165,8 +165,8 @@ impl Config { .map_err(io::Error::other) .map(|toml| fs::write(location.clone(), toml)) { - Ok(_) => log::debug!("Writing to: {:#?}", location), - Err(err) => log::warn!("Failed to write to {:#?}: {err}", location), + Ok(_) => log::debug!("Writing to: {location:#?}"), + Err(err) => log::warn!("Failed to write to {location:#?}: {err}"), } } Ok(()) @@ -178,11 +178,11 @@ impl Config { let file = Self::config_file_path(None); match load_from_file::(file.clone()) { Ok(global) => { - log::debug!("Loaded from file {:#?}", file); + log::debug!("Loaded from file {file:#?}"); Some(global) } Err(err) => { - log::trace!("Not loading {:#?}: {err}", file); + log::trace!("Not loading {file:#?}: {err}"); None } } @@ -194,10 +194,10 @@ impl Config { let file = Self::config_file_path(Some(network)); match load_from_file::(file.clone()) { Ok(config) => { - log::trace!("Loaded from file {:#?}", file); + log::trace!("Loaded from file {file:#?}"); networks.insert(network.as_key(), config); } - Err(err) => log::trace!("Not loading {:#?}: {err}", file), + Err(err) => log::trace!("Not loading {file:#?}: {err}"), }; } diff --git a/nym-wallet/src-tauri/src/network_config.rs b/nym-wallet/src-tauri/src/network_config.rs index 6f75b6e5fac..c0f14a65bdc 100644 --- a/nym-wallet/src-tauri/src/network_config.rs +++ b/nym-wallet/src-tauri/src/network_config.rs @@ -33,7 +33,7 @@ pub async fn get_selected_nyxd_url( ) -> Result, BackendError> { let state = state.read().await; let url = state.get_selected_nyxd_url(&network).map(String::from); - log::info!("Selected nyxd url for {network}: {:?}", url); + log::info!("Selected nyxd url for {network}: {url:?}"); Ok(url) } @@ -44,7 +44,7 @@ pub async fn get_default_nyxd_url( ) -> Result { let state = state.read().await; let url = state.get_default_nyxd_url(&network).map(String::from); - log::info!("Default nyxd url for {network}: {:?}", url); + log::info!("Default nyxd url for {network}: {url:?}"); url.ok_or_else(|| BackendError::WalletNoDefaultValidator) } diff --git a/nym-wallet/src-tauri/src/operations/app/link.rs b/nym-wallet/src-tauri/src/operations/app/link.rs index fa41aa8f190..d238242633a 100644 --- a/nym-wallet/src-tauri/src/operations/app/link.rs +++ b/nym-wallet/src-tauri/src/operations/app/link.rs @@ -2,10 +2,10 @@ use tauri_plugin_opener::OpenerExt; #[tauri::command] pub async fn open_url(url: String, app_handle: tauri::AppHandle) -> Result<(), String> { - println!("Opening URL: {}", url); + println!("Opening URL: {url}"); match app_handle.opener().open_url(&url, None::<&str>) { Ok(_) => Ok(()), - Err(err) => Err(format!("Failed to open URL: {}", err)), + Err(err) => Err(format!("Failed to open URL: {err}")), } } diff --git a/nym-wallet/src-tauri/src/operations/app/version.rs b/nym-wallet/src-tauri/src/operations/app/version.rs index d904449cf05..d69a80f5e36 100644 --- a/nym-wallet/src-tauri/src/operations/app/version.rs +++ b/nym-wallet/src-tauri/src/operations/app/version.rs @@ -10,13 +10,13 @@ pub async fn check_version(handle: tauri::AppHandle) -> Result>> Getting app version info"); let updater = handle.updater().map_err(|e| { - log::error!("Failed to get updater: {}", e); + log::error!("Failed to get updater: {e}"); BackendError::CheckAppVersionError })?; // Then check for updates let update_info = updater.check().await.map_err(|e| { - log::error!("An error occurred while checking for app update {}", e); + log::error!("An error occurred while checking for app update {e}"); BackendError::CheckAppVersionError })?; @@ -35,10 +35,7 @@ pub async fn check_version(handle: tauri::AppHandle) -> Result Result<(), BackendError> { // create the new window first, to stop the app process from exiting - log::info!("Creating {} window...", new_window_label); + log::info!("Creating {new_window_label} window..."); match tauri::WebviewWindowBuilder::new( &app_handle, new_window_label, diff --git a/nym-wallet/src-tauri/src/operations/mixnet/account.rs b/nym-wallet/src-tauri/src/operations/mixnet/account.rs index 3750e21aee1..3319363be1d 100644 --- a/nym-wallet/src-tauri/src/operations/mixnet/account.rs +++ b/nym-wallet/src-tauri/src/operations/mixnet/account.rs @@ -108,7 +108,7 @@ async fn _connect_with_mnemonic( "{}", state.get_config_validator_entries(network).format(",\n") ); - log::debug!("List of validators for {network}: [\n{}\n]", f,); + log::debug!("List of validators for {network}: [\n{f}\n]",); } state.config().clone() @@ -598,7 +598,7 @@ pub async fn list_accounts( address: account.addresses[&network].to_string(), }) .map(|account| { - log::trace!("{:?}", account); + log::trace!("{account:?}"); account }) .collect(); diff --git a/nym-wallet/src-tauri/src/operations/mixnet/bond.rs b/nym-wallet/src-tauri/src/operations/mixnet/bond.rs index ee9e0e37423..881b54aa3cc 100644 --- a/nym-wallet/src-tauri/src/operations/mixnet/bond.rs +++ b/nym-wallet/src-tauri/src/operations/mixnet/bond.rs @@ -71,7 +71,7 @@ pub async fn bond_gateway( .bond_gateway(gateway, msg_signature, pledge_base, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -84,10 +84,10 @@ pub async fn unbond_gateway( ) -> Result { let guard = state.read().await; let fee_amount = guard.convert_tx_fee(fee.as_ref()); - log::info!(">>> Unbond gateway, fee = {:?}", fee); + log::info!(">>> Unbond gateway, fee = {fee:?}"); let res = guard.current_client()?.nyxd.unbond_gateway(fee).await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -136,7 +136,7 @@ pub async fn bond_mixnode( .bond_mixnode(mixnode, cost_params, msg_signature, pledge_base, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -184,7 +184,7 @@ pub async fn bond_nymnode( .bond_nymnode(nymnode, cost_params, msg_signature, pledge_base, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -232,7 +232,7 @@ pub async fn update_pledge( }; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, @@ -249,10 +249,7 @@ pub async fn pledge_more( let additional_pledge_base = guard.attempt_convert_to_base_coin(additional_pledge.clone())?; let fee_amount = guard.convert_tx_fee(fee.as_ref()); log::info!( - ">>> Pledge more, additional_pledge_display = {}, additional_pledge_base = {}, fee = {:?}", - additional_pledge, - additional_pledge_base, - fee, + ">>> Pledge more, additional_pledge_display = {additional_pledge}, additional_pledge_base = {additional_pledge_base}, fee = {fee:?}", ); let res = guard .current_client()? @@ -260,7 +257,7 @@ pub async fn pledge_more( .pledge_more(additional_pledge_base, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -276,10 +273,7 @@ pub async fn decrease_pledge( let decrease_by_base = guard.attempt_convert_to_base_coin(decrease_by.clone())?; let fee_amount = guard.convert_tx_fee(fee.as_ref()); log::info!( - ">>> Decrease pledge, pledge_decrease_display = {}, pledge_decrease_base = {}, fee = {:?}", - decrease_by, - decrease_by_base, - fee, + ">>> Decrease pledge, pledge_decrease_display = {decrease_by}, pledge_decrease_base = {decrease_by_base}, fee = {fee:?}", ); let res = guard .current_client()? @@ -287,7 +281,7 @@ pub async fn decrease_pledge( .decrease_pledge(decrease_by_base, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -300,10 +294,10 @@ pub async fn unbond_mixnode( ) -> Result { let guard = state.read().await; let fee_amount = guard.convert_tx_fee(fee.as_ref()); - log::info!(">>> Unbond mixnode, fee = {:?}", fee); + log::info!(">>> Unbond mixnode, fee = {fee:?}"); let res = guard.current_client()?.nyxd.unbond_mixnode(fee).await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -319,7 +313,7 @@ pub async fn unbond_nymnode( log::info!(">>> Unbond NymNode, fee = {fee:?}"); let res = guard.current_client()?.nyxd.unbond_nymnode(fee).await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, @@ -347,7 +341,7 @@ pub async fn update_mixnode_cost_params( .update_cost_params(cost_params, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -372,7 +366,7 @@ pub async fn update_mixnode_config( .update_mixnode_config(update, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -397,7 +391,7 @@ pub async fn update_gateway_config( .update_gateway_config(update, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -420,14 +414,14 @@ pub async fn get_mixnode_avg_uptime( match res.mixnode_details { Some(details) => { let id = details.mix_id(); - log::trace!(" >>> Get average uptime percentage: mix_id = {}", id); + log::trace!(" >>> Get average uptime percentage: mix_id = {id}"); let avg_uptime_percent = client .nym_api .get_mixnode_avg_uptime(id) .await .ok() .map(|r| r.avg_uptime); - log::trace!(" <<< {:?}", avg_uptime_percent); + log::trace!(" <<< {avg_uptime_percent:?}"); Ok(avg_uptime_percent) } None => Ok(None), @@ -461,7 +455,7 @@ pub async fn mixnode_bond_details( &r.bond_information.mix_node.identity_key )) ); - log::trace!("<<< {:?}", details); + log::trace!("<<< {details:?}"); Ok(details) } @@ -490,7 +484,7 @@ pub async fn gateway_bond_details( "<<< identity_key = {:?}", res.as_ref().map(|r| r.gateway.identity_key.to_string()) ); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(res) } @@ -521,7 +515,7 @@ pub async fn nym_node_bond_details( &r.bond_information.node.identity_key )) ); - log::trace!("<<< {:?}", details); + log::trace!("<<< {details:?}"); Ok(details) } @@ -530,7 +524,7 @@ pub async fn get_pending_operator_rewards( address: String, state: tauri::State<'_, WalletState>, ) -> Result { - log::info!(">>> Get pending operator rewards for {}", address); + log::info!(">>> Get pending operator rewards for {address}"); let guard = state.read().await; let res = guard .current_client()? @@ -554,11 +548,7 @@ pub async fn get_pending_operator_rewards( .transpose()? .unwrap_or_else(|| guard.default_zero_mix_display_coin()); - log::info!( - "<<< rewards_base = {:?}, rewards_display = {}", - base_coin, - display_coin - ); + log::info!("<<< rewards_base = {base_coin:?}, rewards_display = {display_coin}"); Ok(display_coin) } @@ -637,7 +627,7 @@ pub async fn migrate_legacy_mixnode( let res = client.nyxd.migrate_legacy_mixnode(fee).await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -657,7 +647,7 @@ pub async fn migrate_legacy_gateway( let res = client.nyxd.migrate_legacy_gateway(None, fee).await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -678,7 +668,7 @@ pub async fn update_nymnode_config( .update_nymnode_config(update, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -705,7 +695,7 @@ pub async fn update_nymnode_cost_params( .update_cost_params(cost_params, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) diff --git a/nym-wallet/src-tauri/src/operations/mixnet/delegate.rs b/nym-wallet/src-tauri/src/operations/mixnet/delegate.rs index 8fc47187d06..5275436dcd5 100644 --- a/nym-wallet/src-tauri/src/operations/mixnet/delegate.rs +++ b/nym-wallet/src-tauri/src/operations/mixnet/delegate.rs @@ -62,10 +62,7 @@ pub async fn get_pending_delegation_events( "<<< {} pending delegation events", client_specific_events.len() ); - log::trace!( - "<<< pending delegation events = {:?}", - client_specific_events - ); + log::trace!("<<< pending delegation events = {client_specific_events:?}"); Ok(client_specific_events) } @@ -83,15 +80,11 @@ pub async fn delegate_to_mixnode( let fee_amount = guard.convert_tx_fee(fee.as_ref()); log::info!( - ">>> Delegate to mixnode: mix_id = {}, display_amount = {}, base_amount = {}, fee = {:?}", - mix_id, - amount, - delegation_base, - fee, + ">>> Delegate to mixnode: mix_id = {mix_id}, display_amount = {amount}, base_amount = {delegation_base}, fee = {fee:?}", ); let res = client.nyxd.delegate(mix_id, delegation_base, fee).await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -106,14 +99,10 @@ pub async fn undelegate_from_mixnode( let guard = state.read().await; let fee_amount = guard.convert_tx_fee(fee.as_ref()); - log::info!( - ">>> Undelegate from mixnode: mix_id = {}, fee = {:?}", - mix_id, - fee - ); + log::info!(">>> Undelegate from mixnode: mix_id = {mix_id}, fee = {fee:?}"); let res = guard.current_client()?.nyxd.undelegate(mix_id, fee).await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -128,11 +117,7 @@ pub async fn undelegate_all_from_mixnode( state: tauri::State<'_, WalletState>, ) -> Result, BackendError> { log::info!( - ">>> Undelegate all from mixnode: mix_id = {}, uses_vesting_contract_tokens = {}, fee_liquid = {:?}, fee_vesting = {:?}", - mix_id, - uses_vesting_contract_tokens, - fee_liquid, - fee_vesting, + ">>> Undelegate all from mixnode: mix_id = {mix_id}, uses_vesting_contract_tokens = {uses_vesting_contract_tokens}, fee_liquid = {fee_liquid:?}, fee_vesting = {fee_vesting:?}", ); let mut res: Vec = vec![undelegate_from_mixnode(mix_id, fee_liquid, state.clone()).await?]; @@ -178,7 +163,7 @@ pub(crate) async fn get_node_information( let str_err = format!( "Failed to get legacy mixnode details for node_id = {node_id}. Error: {err}", ); - log::error!(" <<< {}", str_err); + log::error!(" <<< {str_err}"); error_strings.push(str_err); })? .mixnode_details; @@ -222,7 +207,7 @@ pub async fn get_all_mix_delegations( .get_all_delegator_delegations(&address) .await .tap_err(|err| { - log::error!(" <<< Failed to get delegations. Error: {}", err); + log::error!(" <<< Failed to get delegations. Error: {err}"); })?; log::info!(" <<< {} delegations", delegations.len()); @@ -230,7 +215,7 @@ pub async fn get_all_mix_delegations( get_pending_delegation_events(state.clone()) .await .tap_err(|err| { - log::error!(" <<< Failed to get pending delegations. Error: {}", err); + log::error!(" <<< Failed to get pending delegations. Error: {err}"); })?; log::info!( @@ -276,7 +261,7 @@ pub async fn get_all_mix_delegations( "Failed to get operator rewards as a display coin for mix_id = {}. Error: {}", d.mix_id, err ); - log::error!(" <<< {}", str_err); + log::error!(" <<< {str_err}"); error_strings.push(str_err); }) .unwrap_or_default(); @@ -295,7 +280,7 @@ pub async fn get_all_mix_delegations( "Failed to get delegator rewards as a display coin for mix_id = {}. Error: {}", d.mix_id, err ); - log::error!(" <<< {}", str_err); + log::error!(" <<< {str_err}"); error_strings.push(str_err); }) .unwrap_or_default(); @@ -314,12 +299,12 @@ pub async fn get_all_mix_delegations( "Failed to mixnode cost params for mix_id = {}. Error: {}", d.mix_id, err ); - log::error!(" <<< {}", str_err); + log::error!(" <<< {str_err}"); error_strings.push(str_err); }) .unwrap_or_default(); - log::trace!(" >>> Get accumulated rewards: address = {}", address); + log::trace!(" >>> Get accumulated rewards: address = {address}"); let pending_reward = client .nyxd .get_pending_delegator_reward(&address, d.mix_id, d.proxy.clone()) @@ -329,7 +314,7 @@ pub async fn get_all_mix_delegations( "Failed to get accumulated rewards for mix_id = {}. Error: {}", d.mix_id, err ); - log::error!(" <<< {}", str_err); + log::error!(" <<< {str_err}"); error_strings.push(str_err); }) .unwrap_or_default(); @@ -340,15 +325,11 @@ pub async fn get_all_mix_delegations( .attempt_convert_to_display_dec_coin(reward.clone().into()) .tap_err(|err| { let str_err = format!("Failed to get convert reward to a display coin for mix_id = {}. Error: {}", d.mix_id, err); - log::error!(" <<< {}", str_err); + log::error!(" <<< {str_err}"); error_strings.push(str_err); }) .ok(); - log::trace!( - " <<< rewards = {:?}, amount = {:?}", - pending_reward, - amount - ); + log::trace!(" <<< rewards = {pending_reward:?}, amount = {amount:?}"); amount } None => { @@ -367,7 +348,7 @@ pub async fn get_all_mix_delegations( "Failed to get stake saturation for mix_id = {}. Error: {}", d.mix_id, err ); - log::error!(" <<< {}", str_err); + log::error!(" <<< {str_err}"); error_strings.push(str_err); }) .unwrap_or(MixStakeSaturationResponse { @@ -375,7 +356,7 @@ pub async fn get_all_mix_delegations( uncapped_saturation: None, current_saturation: None, }); - log::trace!(" <<< {:?}", stake_saturation); + log::trace!(" <<< {stake_saturation:?}"); log::trace!( " >>> Get average uptime percentage: mix_iid = {}", @@ -391,7 +372,7 @@ pub async fn get_all_mix_delegations( "Failed to get current node performance for node_id = {}. Error: {err}", d.mix_id ); - log::error!(" <<< {}", str_err); + log::error!(" <<< {str_err}"); error_strings.push(str_err); }) .ok() @@ -400,7 +381,7 @@ pub async fn get_all_mix_delegations( // convert to old u8 let current_uptime = current_performance.map(|p| (p * 100.) as u8); - log::trace!(" <<< {:?}", current_uptime); + log::trace!(" <<< {current_uptime:?}"); log::trace!( " >>> Convert delegated on block height to timestamp: block_height = {}", @@ -415,19 +396,17 @@ pub async fn get_all_mix_delegations( // Check if the error is related to height not being available (pruning) if error_message.contains("height") && error_message.contains("not available") { let str_err = "Due to pruning strategies from validators, please navigate to the Settings tab and change your RPC node for your validator to retrieve your delegations."; - log::error!(" <<< {}", str_err); + log::error!(" <<< {str_err}"); error_strings.push(str_err.to_string()); } else { let str_err = format!("Failed to get block timestamp for height = {} for delegation to mix_id = {}. Error: {}", d.height, d.mix_id, err); - log::error!(" <<< {}", str_err); + log::error!(" <<< {str_err}"); error_strings.push(str_err); } }).ok(); let delegated_on_iso_datetime = timestamp.map(|ts| ts.to_rfc3339()); log::trace!( - " <<< timestamp = {:?}, delegated_on_iso_datetime = {:?}", - timestamp, - delegated_on_iso_datetime + " <<< timestamp = {timestamp:?}, delegated_on_iso_datetime = {delegated_on_iso_datetime:?}" ); let pending_events = filter_pending_events(d.mix_id, &pending_events_for_account); @@ -466,7 +445,7 @@ pub async fn get_all_mix_delegations( }, }) } - log::trace!("<<< {:?}", with_everything); + log::trace!("<<< {with_everything:?}"); Ok(with_everything) } @@ -490,11 +469,7 @@ pub async fn get_pending_delegator_rewards( proxy: Option, state: tauri::State<'_, WalletState>, ) -> Result { - log::info!( - ">>> Get pending delegator rewards: mix_id = {}, proxy = {:?}", - mix_id, - proxy - ); + log::info!(">>> Get pending delegator rewards: mix_id = {mix_id}, proxy = {proxy:?}"); let guard = state.read().await; let res = guard .current_client()? @@ -518,11 +493,7 @@ pub async fn get_pending_delegator_rewards( .transpose()? .unwrap_or_else(|| guard.default_zero_mix_display_coin()); - log::info!( - "<<< rewards_base = {:?}, rewards_display = {}", - base_coin, - display_coin - ); + log::info!("<<< rewards_base = {base_coin:?}, rewards_display = {display_coin}"); Ok(display_coin) } @@ -554,7 +525,7 @@ pub async fn get_delegation_summary( total_delegations, total_rewards ); - log::trace!("<<< {:?}", delegations); + log::trace!("<<< {delegations:?}"); Ok(DelegationsSummaryResponse { delegations, diff --git a/nym-wallet/src-tauri/src/operations/mixnet/interval.rs b/nym-wallet/src-tauri/src/operations/mixnet/interval.rs index 05151d8a53f..8268f442420 100644 --- a/nym-wallet/src-tauri/src/operations/mixnet/interval.rs +++ b/nym-wallet/src-tauri/src/operations/mixnet/interval.rs @@ -14,7 +14,7 @@ pub async fn get_current_interval( ) -> Result { log::info!(">>> Get current interval"); let res = nyxd_client!(state).get_current_interval_details().await?; - log::info!("<<< current interval = {:?}", res); + log::info!("<<< current interval = {res:?}"); Ok(res.interval.into()) } diff --git a/nym-wallet/src-tauri/src/operations/mixnet/rewards.rs b/nym-wallet/src-tauri/src/operations/mixnet/rewards.rs index 4563005b88d..b32a4224b3d 100644 --- a/nym-wallet/src-tauri/src/operations/mixnet/rewards.rs +++ b/nym-wallet/src-tauri/src/operations/mixnet/rewards.rs @@ -23,7 +23,7 @@ pub async fn claim_operator_reward( .withdraw_operator_reward(fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -44,7 +44,7 @@ pub async fn claim_delegator_reward( .withdraw_delegator_reward(node_id, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -87,9 +87,7 @@ pub async fn claim_locked_and_unlocked_delegator_reward( let did_delegate_with_vesting_contract = vesting_delegation.delegation.is_some(); log::trace!( - "<<< Delegations done with: mixnet contract = {}, vesting contract = {}", - did_delegate_with_mixnet_contract, - did_delegate_with_vesting_contract + "<<< Delegations done with: mixnet contract = {did_delegate_with_mixnet_contract}, vesting contract = {did_delegate_with_vesting_contract}" ); let mut res: Vec = vec![]; @@ -99,7 +97,7 @@ pub async fn claim_locked_and_unlocked_delegator_reward( if did_delegate_with_vesting_contract { res.push(vesting_claim_delegator_reward(node_id, fee, state).await?); } - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(res) } diff --git a/nym-wallet/src-tauri/src/operations/mixnet/send.rs b/nym-wallet/src-tauri/src/operations/mixnet/send.rs index 9e1ae7849c0..5a313608ca1 100644 --- a/nym-wallet/src-tauri/src/operations/mixnet/send.rs +++ b/nym-wallet/src-tauri/src/operations/mixnet/send.rs @@ -20,12 +20,7 @@ pub async fn send( let from_address = guard.current_client()?.nyxd.address().to_string(); let fee_amount = guard.convert_tx_fee(fee.as_ref()); log::info!( - ">>> Send: display_amount = {}, base_amount = {}, from = {}, to = {}, fee = {:?}", - amount, - amount_base, - from_address, - to_address, - fee, + ">>> Send: display_amount = {amount}, base_amount = {amount_base}, from = {from_address}, to = {to_address}, fee = {fee:?}", ); let raw_res = guard .current_client()? @@ -38,6 +33,6 @@ pub async fn send( TransactionDetails::new(amount, from_address, to_address.to_string()), fee_amount, ); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(res) } diff --git a/nym-wallet/src-tauri/src/operations/signatures/sign.rs b/nym-wallet/src-tauri/src/operations/signatures/sign.rs index 59da5cae366..e93edd57f4e 100644 --- a/nym-wallet/src-tauri/src/operations/signatures/sign.rs +++ b/nym-wallet/src-tauri/src/operations/signatures/sign.rs @@ -40,7 +40,7 @@ pub async fn sign( signature_as_hex: signature.to_string(), }; let output_json = json!(output).to_string(); - log::info!(">>> Signing data {}", output_json); + log::info!(">>> Signing data {output_json}"); Ok(output_json) } @@ -48,17 +48,17 @@ async fn get_pubkey_from_account_address( address: &AccountId, state: &tauri::State<'_, WalletState>, ) -> Result { - log::info!("Getting public key for address {} from chain...", address); + log::info!("Getting public key for address {address} from chain..."); let guard = state.read().await; let client = guard.current_client()?; let account = client.nyxd.get_account(address).await?.ok_or_else(|| { - log::error!("No account associated with address {}", address); + log::error!("No account associated with address {address}"); BackendError::SignatureError(format!("No account associated with address {address}")) })?; let base_account = account.try_get_base_account()?; base_account.pubkey.ok_or_else(|| { - log::error!("No pubkey found for address {}", address); + log::error!("No pubkey found for address {address}"); BackendError::SignatureError(format!("No pubkey found for address {address}")) }) } @@ -125,7 +125,7 @@ pub async fn verify( )); } - log::info!("<<< Verifying signature [{}]", signature_as_hex); + log::info!("<<< Verifying signature [{signature_as_hex}]"); let verifying_key = VerifyingKey::from_sec1_bytes(&public_key.to_bytes())?; let signature = Signature::from_str(&signature_as_hex)?; let message_as_bytes = message.into_bytes(); diff --git a/nym-wallet/src-tauri/src/operations/simulate/mixnet.rs b/nym-wallet/src-tauri/src/operations/simulate/mixnet.rs index eb1b4bb1cff..3866062e2f4 100644 --- a/nym-wallet/src-tauri/src/operations/simulate/mixnet.rs +++ b/nym-wallet/src-tauri/src/operations/simulate/mixnet.rs @@ -114,17 +114,11 @@ pub async fn simulate_update_pledge( match new_pledge.amount.cmp(¤t_pledge.amount) { Ordering::Greater => { - log::info!( - "Simulate pledge increase, calculated additional pledge {}", - dec_delta, - ); + log::info!("Simulate pledge increase, calculated additional pledge {dec_delta}",); simulate_mixnet_operation(ExecuteMsg::PledgeMore {}, Some(dec_delta), &state).await } Ordering::Less => { - log::info!( - "Simulate pledge reduction, calculated reduction pledge {}", - dec_delta, - ); + log::info!("Simulate pledge reduction, calculated reduction pledge {dec_delta}",); simulate_mixnet_operation( ExecuteMsg::DecreasePledge { decrease_by: guard.attempt_convert_to_base_coin(dec_delta)?.into(), diff --git a/nym-wallet/src-tauri/src/operations/simulate/vesting.rs b/nym-wallet/src-tauri/src/operations/simulate/vesting.rs index 9578575c3ff..28752f4bad6 100644 --- a/nym-wallet/src-tauri/src/operations/simulate/vesting.rs +++ b/nym-wallet/src-tauri/src/operations/simulate/vesting.rs @@ -114,8 +114,7 @@ pub async fn simulate_vesting_update_pledge( })? .into(); log::info!( - ">>> Simulate pledge more, calculated additional pledge {}", - additional_pledge, + ">>> Simulate pledge more, calculated additional pledge {additional_pledge}", ); simulate_vesting_operation( ExecuteMsg::PledgeMore { @@ -134,8 +133,7 @@ pub async fn simulate_vesting_update_pledge( })? .into(); log::info!( - ">>> Simulate decrease pledge, calculated decrease pledge {}", - decrease_pledge, + ">>> Simulate decrease pledge, calculated decrease pledge {decrease_pledge}", ); simulate_vesting_operation( ExecuteMsg::DecreasePledge { diff --git a/nym-wallet/src-tauri/src/operations/vesting/bond.rs b/nym-wallet/src-tauri/src/operations/vesting/bond.rs index dfa7aec1f9c..9a97b2bfe66 100644 --- a/nym-wallet/src-tauri/src/operations/vesting/bond.rs +++ b/nym-wallet/src-tauri/src/operations/vesting/bond.rs @@ -48,7 +48,7 @@ pub async fn vesting_bond_gateway( .vesting_bond_gateway(gateway, msg_signature, pledge_base, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -61,13 +61,10 @@ pub async fn vesting_unbond_gateway( ) -> Result { let guard = state.read().await; let fee_amount = guard.convert_tx_fee(fee.as_ref()); - log::info!( - ">>> Unbond gateway bonded with locked tokens, fee = {:?}", - fee - ); + log::info!(">>> Unbond gateway bonded with locked tokens, fee = {fee:?}"); let res = nyxd_client!(state).vesting_unbond_gateway(fee).await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -118,7 +115,7 @@ pub async fn vesting_bond_mixnode( .vesting_bond_mixnode(mixnode, cost_params, msg_signature, pledge_base, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -144,9 +141,7 @@ pub async fn vesting_update_pledge( let res = match new_pledge.amount.cmp(¤t_pledge.amount) { Ordering::Greater => { log::info!( - "Pledge increase with locked tokens, calculated additional pledge {}, fee = {:?}", - dec_delta, - fee, + "Pledge increase with locked tokens, calculated additional pledge {dec_delta}, fee = {fee:?}", ); guard .current_client()? @@ -156,9 +151,7 @@ pub async fn vesting_update_pledge( } Ordering::Less => { log::info!( - "Pledge reduction with locked tokens, calculated reduction pledge {}, fee = {:?}", - dec_delta, - fee, + "Pledge reduction with locked tokens, calculated reduction pledge {dec_delta}, fee = {fee:?}", ); guard .current_client()? @@ -170,7 +163,7 @@ pub async fn vesting_update_pledge( }; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, @@ -187,10 +180,7 @@ pub async fn vesting_pledge_more( let additional_pledge_base = guard.attempt_convert_to_base_coin(additional_pledge.clone())?; let fee_amount = guard.convert_tx_fee(fee.as_ref()); log::info!( - ">>> Pledge more with locked tokens, additional_pledge_display = {}, additional_pledge_base = {}, fee = {:?}", - additional_pledge, - additional_pledge_base, - fee, + ">>> Pledge more with locked tokens, additional_pledge_display = {additional_pledge}, additional_pledge_base = {additional_pledge_base}, fee = {fee:?}", ); let res = guard .current_client()? @@ -198,7 +188,7 @@ pub async fn vesting_pledge_more( .vesting_pledge_more(additional_pledge_base, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -214,10 +204,7 @@ pub async fn vesting_decrease_pledge( let decrease_by_base = guard.attempt_convert_to_base_coin(decrease_by.clone())?; let fee_amount = guard.convert_tx_fee(fee.as_ref()); log::info!( - ">>> Decrease pledge with locked tokens, pledge_decrease_display = {}, pledge_decrease_base = {}, fee = {:?}", - decrease_by, - decrease_by_base, - fee, + ">>> Decrease pledge with locked tokens, pledge_decrease_display = {decrease_by}, pledge_decrease_base = {decrease_by_base}, fee = {fee:?}", ); let res = guard .current_client()? @@ -225,7 +212,7 @@ pub async fn vesting_decrease_pledge( .vesting_decrease_pledge(decrease_by_base, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -238,17 +225,14 @@ pub async fn vesting_unbond_mixnode( ) -> Result { let guard = state.read().await; let fee_amount = guard.convert_tx_fee(fee.as_ref()); - log::info!( - ">>> Unbond mixnode bonded with locked tokens, fee = {:?}", - fee - ); + log::info!(">>> Unbond mixnode bonded with locked tokens, fee = {fee:?}"); let res = guard .current_client()? .nyxd .vesting_unbond_mixnode(fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -265,10 +249,7 @@ pub async fn withdraw_vested_coins( let fee_amount = guard.convert_tx_fee(fee.as_ref()); log::info!( - ">>> Withdraw vested liquid coins: amount_base = {}, amount_base = {}, fee = {:?}", - amount, - amount_base, - fee + ">>> Withdraw vested liquid coins: amount_base = {amount}, amount_base = {amount_base}, fee = {fee:?}" ); let res = guard .current_client()? @@ -276,7 +257,7 @@ pub async fn withdraw_vested_coins( .withdraw_vested_coins(amount_base, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -304,7 +285,7 @@ pub async fn vesting_update_mixnode_cost_params( .vesting_update_mixnode_cost_params(cost_params, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -329,7 +310,7 @@ pub async fn vesting_update_mixnode_config( .vesting_update_mixnode_config(update, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -354,7 +335,7 @@ pub async fn vesting_update_gateway_config( .vesting_update_gateway_config(update, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) diff --git a/nym-wallet/src-tauri/src/operations/vesting/delegate.rs b/nym-wallet/src-tauri/src/operations/vesting/delegate.rs index bbb1d8df118..ed896c0322d 100644 --- a/nym-wallet/src-tauri/src/operations/vesting/delegate.rs +++ b/nym-wallet/src-tauri/src/operations/vesting/delegate.rs @@ -20,11 +20,7 @@ pub async fn vesting_delegate_to_mixnode( let fee_amount = guard.convert_tx_fee(fee.as_ref()); log::info!( - ">>> Delegate to mixnode with locked tokens: mix_id = {}, amount_display = {}, amount_base = {}, fee = {:?}", - mix_id, - amount, - delegation, - fee + ">>> Delegate to mixnode with locked tokens: mix_id = {mix_id}, amount_display = {amount}, amount_base = {delegation}, fee = {fee:?}" ); let res = guard .current_client()? @@ -32,7 +28,7 @@ pub async fn vesting_delegate_to_mixnode( .vesting_delegate_to_mixnode(mix_id, delegation, None, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -47,9 +43,7 @@ pub async fn vesting_undelegate_from_mixnode( let guard = state.read().await; let fee_amount = guard.convert_tx_fee(fee.as_ref()); log::info!( - ">>> Undelegate from mixnode delegated with locked tokens: mix_id = {}, fee = {:?}", - mix_id, - fee, + ">>> Undelegate from mixnode delegated with locked tokens: mix_id = {mix_id}, fee = {fee:?}", ); let res = guard .current_client()? @@ -57,7 +51,7 @@ pub async fn vesting_undelegate_from_mixnode( .vesting_undelegate_from_mixnode(mix_id, None, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) diff --git a/nym-wallet/src-tauri/src/operations/vesting/migrate.rs b/nym-wallet/src-tauri/src/operations/vesting/migrate.rs index 00257464b19..6d99641f873 100644 --- a/nym-wallet/src-tauri/src/operations/vesting/migrate.rs +++ b/nym-wallet/src-tauri/src/operations/vesting/migrate.rs @@ -25,7 +25,7 @@ pub async fn migrate_vested_mixnode( .migrate_vested_mixnode(fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -52,7 +52,7 @@ pub async fn migrate_vested_delegations( .get_all_delegator_delegations(&address) .await .inspect_err(|err| { - log::error!(" <<< Failed to get delegations. Error: {}", err); + log::error!(" <<< Failed to get delegations. Error: {err}"); })?; log::info!(" <<< {} delegations", delegations.len()); @@ -91,6 +91,6 @@ pub async fn migrate_vested_delegations( .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result(res, None)?) } diff --git a/nym-wallet/src-tauri/src/operations/vesting/queries.rs b/nym-wallet/src-tauri/src/operations/vesting/queries.rs index f3377d5ed51..750d03caee6 100644 --- a/nym-wallet/src-tauri/src/operations/vesting/queries.rs +++ b/nym-wallet/src-tauri/src/operations/vesting/queries.rs @@ -146,7 +146,7 @@ pub(crate) async fn vesting_start_time( .vesting_start_time(vesting_account_address) .await? .seconds(); - log::info!("<<< vesting start time = {}", res); + log::info!("<<< vesting start time = {res}"); Ok(res) } @@ -160,7 +160,7 @@ pub(crate) async fn vesting_end_time( .vesting_end_time(vesting_account_address) .await? .seconds(); - log::info!("<<< vesting end time = {}", res); + log::info!("<<< vesting end time = {res}"); Ok(res) } @@ -180,7 +180,7 @@ pub(crate) async fn original_vesting( .await?; let res = OriginalVestingResponse::from_vesting_contract(res, reg)?; - log::info!("<<< {:?}", res); + log::info!("<<< {res:?}"); Ok(res) } @@ -347,7 +347,7 @@ pub(crate) async fn vesting_get_mixnode_pledge( .map(|pledge| PledgeData::from_vesting_contract(pledge, reg)) .transpose()?; - log::info!("<<< {:?}", res); + log::info!("<<< {res:?}"); Ok(res) } @@ -368,7 +368,7 @@ pub(crate) async fn vesting_get_gateway_pledge( .map(|pledge| PledgeData::from_vesting_contract(pledge, reg)) .transpose()?; - log::info!("<<< {:?}", res); + log::info!("<<< {res:?}"); Ok(res) } @@ -381,7 +381,7 @@ pub(crate) async fn get_current_vesting_period( let res = nyxd_client!(state) .get_current_vesting_period(address) .await?; - log::info!("<<< {:?}", res); + log::info!("<<< {res:?}"); Ok(res) } @@ -397,6 +397,6 @@ pub(crate) async fn get_account_info( let vesting_account = guard.current_client()?.nyxd.get_account(address).await?; let res = VestingAccountInfo::from_vesting_contract(vesting_account, res)?; - log::info!("<<< {:?}", res); + log::info!("<<< {res:?}"); Ok(res) } diff --git a/nym-wallet/src-tauri/src/operations/vesting/rewards.rs b/nym-wallet/src-tauri/src/operations/vesting/rewards.rs index 7cf2155cdbe..f41fee90556 100644 --- a/nym-wallet/src-tauri/src/operations/vesting/rewards.rs +++ b/nym-wallet/src-tauri/src/operations/vesting/rewards.rs @@ -22,7 +22,7 @@ pub async fn vesting_claim_operator_reward( .vesting_withdraw_operator_reward(None) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) @@ -34,10 +34,7 @@ pub async fn vesting_claim_delegator_reward( fee: Option, state: tauri::State<'_, WalletState>, ) -> Result { - log::info!( - ">>> Vesting account: claim delegator reward: mix_id = {}", - mix_id - ); + log::info!(">>> Vesting account: claim delegator reward: mix_id = {mix_id}"); let guard = state.read().await; let fee_amount = guard.convert_tx_fee(fee.as_ref()); let res = guard @@ -46,7 +43,7 @@ pub async fn vesting_claim_delegator_reward( .vesting_withdraw_delegator_reward(mix_id, fee) .await?; log::info!("<<< tx hash = {}", res.transaction_hash); - log::trace!("<<< {:?}", res); + log::trace!("<<< {res:?}"); Ok(TransactionExecuteResult::from_execute_result( res, fee_amount, )?) diff --git a/nym-wallet/src-tauri/src/wallet_storage/mod.rs b/nym-wallet/src-tauri/src/wallet_storage/mod.rs index 973172f4fcf..42f9f080fec 100644 --- a/nym-wallet/src-tauri/src/wallet_storage/mod.rs +++ b/nym-wallet/src-tauri/src/wallet_storage/mod.rs @@ -286,7 +286,7 @@ fn remove_login_at_file(filepath: &Path, id: &LoginId) -> Result<(), BackendErro let mut stored_wallet = load_existing_wallet_at_file(filepath)?; if stored_wallet.is_empty() { - log::info!("Removing file: {:#?}", filepath); + log::info!("Removing file: {filepath:#?}"); return Ok(fs::remove_file(filepath)?); } @@ -295,7 +295,7 @@ fn remove_login_at_file(filepath: &Path, id: &LoginId) -> Result<(), BackendErro .ok_or(BackendError::WalletNoSuchLoginId)?; if stored_wallet.is_empty() { - log::info!("Removing file: {:#?}", filepath); + log::info!("Removing file: {filepath:#?}"); Ok(fs::remove_file(filepath)?) } else { write_to_file(filepath, &stored_wallet) @@ -345,7 +345,7 @@ fn _archive_wallet_file(path: &Path) -> Result<(), BackendError> { additional_number += 1; } else { if let Some(new_path) = new_path.to_str() { - log::info!("Archived to: {}", new_path); + log::info!("Archived to: {new_path}"); } else { log::warn!("Archived wallet file to filename that is not a valid UTF-8 string"); } @@ -363,17 +363,14 @@ pub(crate) fn archive_wallet_file() -> Result<(), BackendError> { if filepath.exists() { if let Some(filepath) = filepath.to_str() { - log::info!("Archiving wallet file: {}", filepath); + log::info!("Archiving wallet file: {filepath}"); } else { log::info!("Archiving wallet file"); } _archive_wallet_file(&filepath) } else { if let Some(filepath) = filepath.to_str() { - log::info!( - "Skipping archiving wallet file, as it's not found: {}", - filepath - ); + log::info!("Skipping archiving wallet file, as it's not found: {filepath}"); } else { log::info!("Skipping archiving wallet file, as it's not found"); } @@ -430,7 +427,7 @@ fn remove_account_from_login_at_file( // Remove the file, or write the new file if stored_wallet.is_empty() { - log::info!("Removing file: {:#?}", filepath); + log::info!("Removing file: {filepath:#?}"); Ok(fs::remove_file(filepath)?) } else { write_to_file(filepath, &stored_wallet) diff --git a/nyx-chain-watcher/build.rs b/nyx-chain-watcher/build.rs index 5cf16e56f8e..a6dbb3c1052 100644 --- a/nyx-chain-watcher/build.rs +++ b/nyx-chain-watcher/build.rs @@ -14,7 +14,7 @@ async fn main() -> Result<()> { } let db_path_str = db_path.display().to_string().replace('\\', "/"); - let db_url = format!("sqlite:{}", db_path_str); + let db_url = format!("sqlite:{db_path_str}"); // Ensure database file is created with proper permissions let connect_options = SqliteConnectOptions::from_str(&db_url)? @@ -30,7 +30,7 @@ async fn main() -> Result<()> { // Force SQLx to prepare all queries during build println!("cargo:rustc-env=SQLX_OFFLINE=true"); - println!("cargo:rustc-env=DATABASE_URL={}", db_url); + println!("cargo:rustc-env=DATABASE_URL={db_url}"); // Add rerun-if-changed directives println!("cargo:rerun-if-changed=migrations"); @@ -46,7 +46,7 @@ fn export_db_variables(db_url: &str) -> Result<()> { let mut file = File::create(".env")?; for (var, value) in map.iter() { - writeln!(file, "{}={}", var, value)?; + writeln!(file, "{var}={value}")?; } Ok(()) diff --git a/nyx-chain-watcher/src/cli/commands/run/mod.rs b/nyx-chain-watcher/src/cli/commands/run/mod.rs index 84d9f10f3b0..150738dfb6e 100644 --- a/nyx-chain-watcher/src/cli/commands/run/mod.rs +++ b/nyx-chain-watcher/src/cli/commands/run/mod.rs @@ -133,7 +133,7 @@ pub(crate) async fn execute(args: Args, http_port: u16) -> Result<(), NyxChainWa std::fs::create_dir_all(parent)?; } - let connection_url = format!("sqlite://{}?mode=rwc", db_path); + let connection_url = format!("sqlite://{db_path}?mode=rwc"); let storage = db::Storage::init(connection_url).await?; let watcher_pool = storage.pool_owned(); diff --git a/nyx-chain-watcher/src/http/server.rs b/nyx-chain-watcher/src/http/server.rs index 96e7d47f959..4216441d665 100644 --- a/nyx-chain-watcher/src/http/server.rs +++ b/nyx-chain-watcher/src/http/server.rs @@ -34,7 +34,7 @@ pub(crate) async fn build_http_api( ); let router = router_builder.with_state(state); - let bind_addr = format!("0.0.0.0:{}", http_port); + let bind_addr = format!("0.0.0.0:{http_port}"); let server = router.build_server(bind_addr).await?; Ok(server) } diff --git a/nyx-chain-watcher/src/logging.rs b/nyx-chain-watcher/src/logging.rs index 74479e3c7d6..1c8cbeebb16 100644 --- a/nyx-chain-watcher/src/logging.rs +++ b/nyx-chain-watcher/src/logging.rs @@ -36,7 +36,7 @@ pub(crate) fn setup_tracing_logger() { "axum", ]; for crate_name in filter_crates { - filter = filter.add_directive(directive_checked(format!("{}=warn", crate_name))); + filter = filter.add_directive(directive_checked(format!("{crate_name}=warn"))); } log_builder.with_env_filter(filter).init(); diff --git a/sdk/rust/nym-sdk/Cargo.toml b/sdk/rust/nym-sdk/Cargo.toml index 46eb67d3eff..9c67bbf8989 100644 --- a/sdk/rust/nym-sdk/Cargo.toml +++ b/sdk/rust/nym-sdk/Cargo.toml @@ -18,9 +18,9 @@ path = "src/tcp_proxy/bin/proxy_client.rs" async-trait = { workspace = true } bip39 = { workspace = true } nym-client-core = { path = "../../../common/client-core", features = [ - "fs-credentials-storage", - "fs-surb-storage", - "fs-gateways-storage", + "fs-credentials-storage", + "fs-surb-storage", + "fs-gateways-storage", ] } nym-crypto = { path = "../../../common/crypto" } nym-gateway-requests = { path = "../../../common/gateway-requests" } @@ -36,14 +36,14 @@ nym-task = { path = "../../../common/task" } nym-topology = { path = "../../../common/topology" } nym-socks5-client-core = { path = "../../../common/socks5-client-core" } nym-validator-client = { path = "../../../common/client-libs/validator-client", features = [ - "http-client", + "http-client", ] } nym-socks5-requests = { path = "../../../common/socks5/requests" } nym-ordered-buffer = { path = "../../../common/socks5/ordered-buffer" } nym-service-providers-common = { path = "../../../service-providers/common" } nym-sphinx-addressing = { path = "../../../common/nymsphinx/addressing" } nym-bin-common = { path = "../../../common/bin-common", features = [ - "basic_tracing", + "basic_tracing", ] } bytecodec = { workspace = true } httpcodec = { workspace = true } @@ -80,6 +80,7 @@ dotenvy = { workspace = true } reqwest = { workspace = true, features = ["json", "socks"] } thiserror = { workspace = true } tokio = { workspace = true, features = ["full"] } +time = { workspace = true } nym-bin-common = { path = "../../../common/bin-common", features = ["basic_tracing"] } # extra dependencies for libp2p examples diff --git a/sdk/rust/nym-sdk/examples/surb_reply.rs b/sdk/rust/nym-sdk/examples/surb_reply.rs index 74f91624707..6011181f0fc 100644 --- a/sdk/rust/nym-sdk/examples/surb_reply.rs +++ b/sdk/rust/nym-sdk/examples/surb_reply.rs @@ -55,8 +55,7 @@ async fn main() { // parse sender_tag: we will use this to reply to sender without needing their Nym address let return_recipient: AnonymousSenderTag = message[0].sender_tag.unwrap(); println!( - "\nReceived the following message: {} \nfrom sender with surb bucket {}", - parsed, return_recipient + "\nReceived the following message: {parsed} \nfrom sender with surb bucket {return_recipient}" ); // reply to self with it: note we use `send_str_reply` instead of `send_str` diff --git a/sdk/rust/nym-sdk/examples/tcp_proxy_single_connection.rs b/sdk/rust/nym-sdk/examples/tcp_proxy_single_connection.rs index 86cfbf70cd5..adce2e263fe 100644 --- a/sdk/rust/nym-sdk/examples/tcp_proxy_single_connection.rs +++ b/sdk/rust/nym-sdk/examples/tcp_proxy_single_connection.rs @@ -45,7 +45,7 @@ async fn main() -> anyhow::Result<()> { let server_port = env::args() .nth(1) .expect("Server listen port not specified"); - let upstream_tcp_addr = format!("127.0.0.1:{}", server_port); + let upstream_tcp_addr = format!("127.0.0.1:{server_port}"); // This dir gets cleaned up at the end: NOTE if you switch env between tests without letting the file do the automatic cleanup, make sure to manually remove this directory up before running again, otherwise your client will attempt to use these keys for the new env let home_dir = dirs::home_dir().expect("Unable to get home directory"); @@ -155,7 +155,7 @@ async fn main() -> anyhow::Result<()> { // The assumption regarding integration is that you know what you're sending, and will do proper // framing before and after, know what data types you're expecting, etc; the proxies are just piping bytes // back and forth using tokio's `Bytecodec` under the hood. - let local_tcp_addr = format!("127.0.0.1:{}", client_port); + let local_tcp_addr = format!("127.0.0.1:{client_port}"); let stream = TcpStream::connect(local_tcp_addr).await?; let (read, mut write) = stream.into_split(); diff --git a/sdk/rust/nym-sdk/src/client_pool/mixnet_client_pool.rs b/sdk/rust/nym-sdk/src/client_pool/mixnet_client_pool.rs index ff7b8b81981..76209b17928 100644 --- a/sdk/rust/nym-sdk/src/client_pool/mixnet_client_pool.rs +++ b/sdk/rust/nym-sdk/src/client_pool/mixnet_client_pool.rs @@ -47,7 +47,7 @@ impl fmt::Debug for ClientPool { "client_pool_reserve_number", &self.client_pool_reserve_number, ) - .field("clients", &format_args!("[{}]", clients_debug)); + .field("clients", &format_args!("[{clients_debug}]")); debug_struct.finish() } } diff --git a/sdk/rust/nym-sdk/src/mixnet/client.rs b/sdk/rust/nym-sdk/src/mixnet/client.rs index 47e958cb38a..90d1b218b66 100644 --- a/sdk/rust/nym-sdk/src/mixnet/client.rs +++ b/sdk/rust/nym-sdk/src/mixnet/client.rs @@ -510,7 +510,7 @@ where Ok(active) => { if let Some(active) = active.registration { let id = active.details.gateway_id(); - debug!("currently selected gateway: {0}", id); + debug!("currently selected gateway: {id}"); } } } diff --git a/sdk/rust/nym-sdk/src/mixnet/native_client.rs b/sdk/rust/nym-sdk/src/mixnet/native_client.rs index caa0f7d3e42..fb940c5b4dd 100644 --- a/sdk/rust/nym-sdk/src/mixnet/native_client.rs +++ b/sdk/rust/nym-sdk/src/mixnet/native_client.rs @@ -226,14 +226,14 @@ impl MixnetClient { log::debug!("Sending forget me request: {:?}", self.forget_me); match self.send_forget_me().await { Ok(_) => (), - Err(e) => error!("Failed to send forget me request: {}", e), + Err(e) => error!("Failed to send forget me request: {e}"), }; tokio::time::sleep(tokio::time::Duration::from_secs(2)).await; } else if self.remember_me.stats() { log::debug!("Sending remember me request: {:?}", self.remember_me); match self.send_remember_me().await { Ok(_) => (), - Err(e) => error!("Failed to send remember me request: {}", e), + Err(e) => error!("Failed to send remember me request: {e}"), }; tokio::time::sleep(tokio::time::Duration::from_secs(2)).await; } @@ -255,7 +255,7 @@ impl MixnetClient { match self.client_request_sender.send(client_request).await { Ok(_) => Ok(()), Err(e) => { - error!("Failed to send forget me request: {}", e); + error!("Failed to send forget me request: {e}"); Err(Error::MessageSendingFailure) } } @@ -268,7 +268,7 @@ impl MixnetClient { match self.client_request_sender.send(client_request).await { Ok(_) => Ok(()), Err(e) => { - error!("Failed to send forget me request: {}", e); + error!("Failed to send forget me request: {e}"); Err(Error::MessageSendingFailure) } } diff --git a/service-providers/authenticator/src/cli/peer_handler.rs b/service-providers/authenticator/src/cli/peer_handler.rs index ebf34dd3b08..402c09815a6 100644 --- a/service-providers/authenticator/src/cli/peer_handler.rs +++ b/service-providers/authenticator/src/cli/peer_handler.rs @@ -28,23 +28,23 @@ impl DummyHandler { if let Some(msg) = msg { match msg { PeerControlRequest::AddPeer { peer, client_id, response_tx } => { - log::info!("[DUMMY] Adding peer {:?} with client id {:?}", peer, client_id); + log::info!("[DUMMY] Adding peer {peer:?} with client id {client_id:?}"); response_tx.send(AddPeerControlResponse { success: true }).ok(); } PeerControlRequest::RemovePeer { key, response_tx } => { - log::info!("[DUMMY] Removing peer {:?}", key); + log::info!("[DUMMY] Removing peer {key:?}"); response_tx.send(RemovePeerControlResponse { success: true }).ok(); } PeerControlRequest::QueryPeer{key, response_tx} => { - log::info!("[DUMMY] Querying peer {:?}", key); + log::info!("[DUMMY] Querying peer {key:?}"); response_tx.send(QueryPeerControlResponse { success: true, peer: None }).ok(); } PeerControlRequest::QueryBandwidth{key, response_tx} => { - log::info!("[DUMMY] Querying bandwidth for peer {:?}", key); + log::info!("[DUMMY] Querying bandwidth for peer {key:?}"); response_tx.send(QueryBandwidthControlResponse { success: true, bandwidth_data: None }).ok(); } PeerControlRequest::GetClientBandwidth{key, response_tx} => { - log::info!("[DUMMY] Getting client bandwidth for peer {:?}", key); + log::info!("[DUMMY] Getting client bandwidth for peer {key:?}"); response_tx.send(GetClientBandwidthControlResponse {client_bandwidth: None }).ok(); } } diff --git a/service-providers/authenticator/src/cli/run.rs b/service-providers/authenticator/src/cli/run.rs index 67dc2265237..d6b273f5b1d 100644 --- a/service-providers/authenticator/src/cli/run.rs +++ b/service-providers/authenticator/src/cli/run.rs @@ -33,7 +33,7 @@ impl From for OverrideConfig { pub(crate) async fn execute(args: &Run) -> Result<(), AuthenticatorError> { let mut config = try_load_current_config(&args.common_args.id).await?; config = override_config(config, OverrideConfig::from(args.clone())); - log::debug!("Using config: {:#?}", config); + log::debug!("Using config: {config:#?}"); log::info!("Starting authenticator service provider"); let (wireguard_gateway_data, peer_rx) = WireguardGatewayData::new( diff --git a/service-providers/authenticator/src/mixnet_listener.rs b/service-providers/authenticator/src/mixnet_listener.rs index 382c0f29000..b28df229822 100644 --- a/service-providers/authenticator/src/mixnet_listener.rs +++ b/service-providers/authenticator/src/mixnet_listener.rs @@ -866,7 +866,7 @@ impl MixnetListener { } pub(crate) async fn run(mut self) -> Result<()> { - log::info!("Using authenticator version {}", CURRENT_VERSION); + log::info!("Using authenticator version {CURRENT_VERSION}"); let mut task_client = self.task_handle.fork("main_loop"); while !task_client.is_shutdown() { @@ -876,7 +876,7 @@ impl MixnetListener { }, _ = self.timeout_check_interval.next() => { if let Err(e) = self.remove_stale_registrations().await { - log::error!("Could not clear stale registrations. The registration process might get jammed soon - {:?}", e); + log::error!("Could not clear stale registrations. The registration process might get jammed soon - {e:?}"); } self.seen_credential_cache.remove_stale(); } diff --git a/service-providers/ip-packet-router/src/cli/run.rs b/service-providers/ip-packet-router/src/cli/run.rs index 3e4010cb326..bf71e79dea0 100644 --- a/service-providers/ip-packet-router/src/cli/run.rs +++ b/service-providers/ip-packet-router/src/cli/run.rs @@ -24,7 +24,7 @@ impl From for OverrideConfig { pub(crate) async fn execute(args: &Run) -> Result<(), IpPacketRouterError> { let mut config = try_load_current_config(&args.common_args.id).await?; config = override_config(config, OverrideConfig::from(args.clone())); - log::debug!("Using config: {:#?}", config); + log::debug!("Using config: {config:#?}"); log::info!("Starting ip packet router service provider"); let mut server = nym_ip_packet_router::IpPacketRouter::new(config); diff --git a/service-providers/ip-packet-router/src/clients/connected_client_handler.rs b/service-providers/ip-packet-router/src/clients/connected_client_handler.rs index 23360a2edd9..551518a0627 100644 --- a/service-providers/ip-packet-router/src/clients/connected_client_handler.rs +++ b/service-providers/ip-packet-router/src/clients/connected_client_handler.rs @@ -69,8 +69,8 @@ impl ConnectedClientHandler { oneshot::Sender<()>, tokio::task::JoinHandle<()>, ) { - log::debug!("Starting connected client handler for: {}", client_id); - log::debug!("client version: {:?}", client_version); + log::debug!("Starting connected client handler for: {client_id}"); + log::debug!("client version: {client_version:?}"); let (close_tx, close_rx) = oneshot::channel(); let (forward_from_tun_tx, forward_from_tun_rx) = mpsc::unbounded_channel(); diff --git a/service-providers/ip-packet-router/src/messages/response/v8.rs b/service-providers/ip-packet-router/src/messages/response/v8.rs index 99b87075c8f..1d0b5a34135 100644 --- a/service-providers/ip-packet-router/src/messages/response/v8.rs +++ b/service-providers/ip-packet-router/src/messages/response/v8.rs @@ -30,8 +30,7 @@ impl TryFrom for IpPacketResponseV8 { match response.response { Response::StaticConnect { .. } => { return Err(IpPacketRouterError::UnsupportedResponse(format!( - "Static connect response is not supported in version {}", - version + "Static connect response is not supported in version {version}" ))) } Response::DynamicConnect { request_id, reply } => IpPacketResponseDataV8::Control( diff --git a/service-providers/ip-packet-router/src/mixnet_listener.rs b/service-providers/ip-packet-router/src/mixnet_listener.rs index 3a35dc7ff0a..fe622f8aa03 100644 --- a/service-providers/ip-packet-router/src/mixnet_listener.rs +++ b/service-providers/ip-packet-router/src/mixnet_listener.rs @@ -310,7 +310,7 @@ impl MixnetListener { // Check if the client is connected if !self.connected_clients.is_client_connected(&client_id) { - log::info!("Client {} is not connected, cannot disconnect", client_id); + log::info!("Client {client_id} is not connected, cannot disconnect"); return Ok(Some(VersionedResponse { version, reply_to: client_id, @@ -322,7 +322,7 @@ impl MixnetListener { } // Disconnect the client - log::info!("Disconnecting client {}", client_id); + log::info!("Disconnecting client {client_id}"); self.connected_clients.disconnect_client(&client_id); Ok(Some(VersionedResponse { diff --git a/service-providers/network-requester/examples/query.rs b/service-providers/network-requester/examples/query.rs index 87f410ee75d..a11eeff143f 100644 --- a/service-providers/network-requester/examples/query.rs +++ b/service-providers/network-requester/examples/query.rs @@ -13,7 +13,7 @@ fn parse_response(received: Vec) -> Socks5Response { assert_eq!(received.len(), 1); let response: Response = Response::try_from_bytes(&received[0].message).unwrap(); match response.content { - ResponseContent::Control(control) => panic!("unexpected control response: {:?}", control), + ResponseContent::Control(control) => panic!("unexpected control response: {control:?}"), ResponseContent::ProviderData(data) => data, } } diff --git a/service-providers/network-requester/src/cli/run.rs b/service-providers/network-requester/src/cli/run.rs index 6a061dd7114..09938ac46a4 100644 --- a/service-providers/network-requester/src/cli/run.rs +++ b/service-providers/network-requester/src/cli/run.rs @@ -47,7 +47,7 @@ impl From for OverrideConfig { pub(crate) async fn execute(args: &Run) -> Result<(), NetworkRequesterError> { let mut config = try_load_current_config(&args.common_args.id).await?; config = override_config(config, OverrideConfig::from(args.clone())); - log::debug!("Using config: {:#?}", config); + log::debug!("Using config: {config:#?}"); if config.network_requester.open_proxy { println!( diff --git a/tools/echo-server/src/lib.rs b/tools/echo-server/src/lib.rs index 0bea93869a7..4630e979dd7 100644 --- a/tools/echo-server/src/lib.rs +++ b/tools/echo-server/src/lib.rs @@ -61,7 +61,7 @@ impl NymEchoServer { let home_dir = dirs::home_dir().expect("Unable to get home directory"); let default_path = format!("{}/tmp/nym-proxy-server-config", home_dir.display()); let config_path = config_path.unwrap_or(&default_path); - let listen_addr = format!("127.0.0.1:{}", listen_port); + let listen_addr = format!("127.0.0.1:{listen_port}"); let client = Arc::new(Mutex::new( tcp_proxy::NymProxyServer::new(&listen_addr, config_path, env, gateway).await?, @@ -337,7 +337,7 @@ mod tests { ); let coded_message = bincode::serialize(&outgoing)?; - println!("sending {:?}", coded_message); + println!("sending {coded_message:?}"); let mut client = MixnetClient::connect_new().await?; diff --git a/tools/internal/testnet-manager/build.rs b/tools/internal/testnet-manager/build.rs index cdd97f95057..7e969e1e088 100644 --- a/tools/internal/testnet-manager/build.rs +++ b/tools/internal/testnet-manager/build.rs @@ -4,9 +4,9 @@ use std::env; #[tokio::main] async fn main() { let out_dir = env::var("OUT_DIR").unwrap(); - let database_path = format!("{}/nym-api-example.sqlite", out_dir); + let database_path = format!("{out_dir}/nym-api-example.sqlite"); - let mut conn = SqliteConnection::connect(&format!("sqlite://{}?mode=rwc", database_path)) + let mut conn = SqliteConnection::connect(&format!("sqlite://{database_path}?mode=rwc")) .await .expect("Failed to create SQLx database connection"); diff --git a/tools/nym-cli/src/main.rs b/tools/nym-cli/src/main.rs index 9fa5a3d9dd9..b8315de641a 100644 --- a/tools/nym-cli/src/main.rs +++ b/tools/nym-cli/src/main.rs @@ -138,10 +138,7 @@ async fn execute(cli: Cli) -> anyhow::Result<()> { async fn wait_for_interrupt() { if let Err(e) = tokio::signal::ctrl_c().await { - error!( - "There was an error while capturing SIGINT - {:?}. We will terminate regardless", - e - ); + error!("There was an error while capturing SIGINT - {e:?}. We will terminate regardless",); } println!( "Received SIGINT - the process will terminate now (threads are not yet nicely stopped, if you see stack traces that's alright)." diff --git a/tools/nym-nr-query/src/main.rs b/tools/nym-nr-query/src/main.rs index 67980d638f6..aecf7110d06 100644 --- a/tools/nym-nr-query/src/main.rs +++ b/tools/nym-nr-query/src/main.rs @@ -75,7 +75,7 @@ fn parse_socks5_response(received: Vec) -> Socks5R assert_eq!(received.len(), 1); let response: Response = Response::try_from_bytes(&received[0].message).unwrap(); match response.content { - ResponseContent::Control(control) => panic!("unexpected control response: {:?}", control), + ResponseContent::Control(control) => panic!("unexpected control response: {control:?}"), ResponseContent::ProviderData(data) => data, } } @@ -276,9 +276,9 @@ enum ClientResponse { impl fmt::Display for ClientResponse { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - ClientResponse::Control(control) => write!(f, "{:#?}", control), - ClientResponse::Query(query) => write!(f, "{:#?}", query), - ClientResponse::Ping(ping) => write!(f, "{}", ping), + ClientResponse::Control(control) => write!(f, "{control:#?}"), + ClientResponse::Query(query) => write!(f, "{query:#?}"), + ClientResponse::Ping(ping) => write!(f, "{ping}"), } } } diff --git a/wasm/client/src/encoded_payload_helper.rs b/wasm/client/src/encoded_payload_helper.rs index 71600ed5ce4..8f2099425fa 100644 --- a/wasm/client/src/encoded_payload_helper.rs +++ b/wasm/client/src/encoded_payload_helper.rs @@ -61,7 +61,7 @@ pub fn encode_payload_with_headers( Ok([size, metadata, payload].concat()) } Err(e) => Err(JsValue::from(JsError::new( - format!("Could not encode message: {}", e).as_str(), + format!("Could not encode message: {e}").as_str(), ))), } } @@ -84,7 +84,7 @@ pub fn decode_payload(message: Vec) -> Result { .unwrap() .unchecked_into::()), Err(e) => Err(JsValue::from(JsError::new( - format!("Could not parse message: {}", e).as_str(), + format!("Could not parse message: {e}").as_str(), ))), } }