From 081dac6af472c468b4f244500844631e02c2e072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ad=C3=A1n=20SDPC?= Date: Thu, 27 Jul 2023 13:05:44 +0200 Subject: [PATCH] chore: update codebase to latest Rust version (1.71) --- data_structures/src/chain/tapi.rs | 4 ++-- node/src/actors/inventory_manager/handlers.rs | 2 +- node/src/actors/node.rs | 4 ++-- partial_struct/tests/partial_struct_derive.rs | 2 +- wallet/src/actors/app/handlers/refresh_session.rs | 2 +- wallet/src/repository/wallet/mod.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/data_structures/src/chain/tapi.rs b/data_structures/src/chain/tapi.rs index de1dd515d..ec000ec1e 100644 --- a/data_structures/src/chain/tapi.rs +++ b/data_structures/src/chain/tapi.rs @@ -138,7 +138,7 @@ impl TapiEngine { } } for n in 0..self.bit_tapi_counter.len() { - if let Some(mut bit_counter) = self.bit_tapi_counter.get_mut(n, &epoch_to_update) { + if let Some(bit_counter) = self.bit_tapi_counter.get_mut(n, &epoch_to_update) { if !self.wip_activation.contains_key(&bit_counter.wip) && !avoid_wip_list.contains(&bit_counter.wip) { @@ -639,7 +639,7 @@ mod tests { assert_eq!(tapi_counter.current_length, 1); assert_eq!(tapi_counter.get(0, &100).unwrap().votes, 0); - let mut votes_counter = tapi_counter.get_mut(0, &100).unwrap(); + let votes_counter = tapi_counter.get_mut(0, &100).unwrap(); votes_counter.votes += 1; assert_eq!(tapi_counter.get(0, &100).unwrap().votes, 1); diff --git a/node/src/actors/inventory_manager/handlers.rs b/node/src/actors/inventory_manager/handlers.rs index 2bc85836e..7b6484104 100644 --- a/node/src/actors/inventory_manager/handlers.rs +++ b/node/src/actors/inventory_manager/handlers.rs @@ -512,7 +512,7 @@ mod tests { // Start relevant actors config_mngr::start(config); storage_mngr::start(); - let inventory_manager = InventoryManager::default().start(); + let inventory_manager = InventoryManager.start(); // Create first block with value transfer transactions let block = build_block_with_vt_transactions(1); diff --git a/node/src/actors/node.rs b/node/src/actors/node.rs index 9db6d4de7..088b9c0f9 100644 --- a/node/src/actors/node.rs +++ b/node/src/actors/node.rs @@ -51,7 +51,7 @@ pub fn run(config: Arc, ops: NodeOps, callback: fn()) -> Result<(), fail SystemRegistry::set(peers_manager_addr); // Start ConnectionsManager actor - let connections_manager_addr = ConnectionsManager::default().start(); + let connections_manager_addr = ConnectionsManager.start(); SystemRegistry::set(connections_manager_addr); // Start SessionManager actor @@ -69,7 +69,7 @@ pub fn run(config: Arc, ops: NodeOps, callback: fn()) -> Result<(), fail SystemRegistry::set(chain_manager_addr); // Start InventoryManager actor - let inventory_manager_addr = InventoryManager::default().start(); + let inventory_manager_addr = InventoryManager.start(); SystemRegistry::set(inventory_manager_addr); // Start RadManager actor diff --git a/partial_struct/tests/partial_struct_derive.rs b/partial_struct/tests/partial_struct_derive.rs index 7723c90ad..8f987cbd5 100644 --- a/partial_struct/tests/partial_struct_derive.rs +++ b/partial_struct/tests/partial_struct_derive.rs @@ -81,5 +81,5 @@ fn test_partial_attr_partial() { let p = PartialObj::default(); - assert_eq!(p.f, PartialAnotherObj::default()); + assert_eq!(p.f, PartialAnotherObj); } diff --git a/wallet/src/actors/app/handlers/refresh_session.rs b/wallet/src/actors/app/handlers/refresh_session.rs index 04368f6f6..df9902f9a 100644 --- a/wallet/src/actors/app/handlers/refresh_session.rs +++ b/wallet/src/actors/app/handlers/refresh_session.rs @@ -21,7 +21,7 @@ impl Handler for app::App { type Result = ::Result; fn handle(&mut self, msg: RefreshSessionRequest, ctx: &mut Self::Context) -> Self::Result { - let mut session = self + let session = self .state .sessions .get_mut(&msg.session_id) diff --git a/wallet/src/repository/wallet/mod.rs b/wallet/src/repository/wallet/mod.rs index 0ccb1aefc..e9862ef3e 100644 --- a/wallet/src/repository/wallet/mod.rs +++ b/wallet/src/repository/wallet/mod.rs @@ -1441,7 +1441,7 @@ where let mut state = self.state.write()?; // This line is needed because of this error: // - Cannot borrow `state` as mutable because it is also borrowed as immutable - let mut state = &mut *state; + let state = &mut *state; // Mark UTXOs as used so we don't double spend // Save the timestamp to after which the UTXO can be spent again