Skip to content

Commit 3d9d568

Browse files
Merge pull request #2137 from multiversx/rustc-1-89
Upgrade to rustc 1.89, clippy fixes
2 parents 7bacd7e + c7c9c00 commit 3d9d568

File tree

26 files changed

+77
-47
lines changed

26 files changed

+77
-47
lines changed

chain/vm/src/blockchain/state/esdt_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl AccountEsdt {
146146
.attributes = new_attribute_bytes;
147147
}
148148

149-
pub fn iter(&self) -> Iter<Vec<u8>, EsdtData> {
149+
pub fn iter(&self) -> Iter<'_, Vec<u8>, EsdtData> {
150150
self.0.iter()
151151
}
152152

chain/vm/src/builtin_functions/general/migrate_username_mock.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//! No longer used, since it the builtin function was dropped.
2+
#![allow(unused)]
3+
14
use crate::chain_core::builtin_func_names::MIGRATE_USERNAME_FUNC_NAME;
25
use crate::host::context::{BlockchainUpdate, TxCache, TxInput, TxResult};
36
use crate::host::runtime::{RuntimeInstanceCallLambda, RuntimeRef};

chain/vm/src/host/context/tx_context.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,23 +130,23 @@ impl TxContext {
130130
self.with_account_mut(&self.tx_input_box.to, f)
131131
}
132132

133-
pub fn m_types_lock(&self) -> MutexGuard<ManagedTypeContainer> {
133+
pub fn m_types_lock(&self) -> MutexGuard<'_, ManagedTypeContainer> {
134134
self.managed_types.lock().unwrap()
135135
}
136136

137-
pub fn back_transfers_lock(&self) -> MutexGuard<BackTransfers> {
137+
pub fn back_transfers_lock(&self) -> MutexGuard<'_, BackTransfers> {
138138
self.back_transfers.lock().unwrap()
139139
}
140140

141-
pub fn result_lock(&self) -> MutexGuard<TxResult> {
141+
pub fn result_lock(&self) -> MutexGuard<'_, TxResult> {
142142
self.tx_result_cell.lock().unwrap()
143143
}
144144

145145
pub fn extract_result(&self) -> TxResult {
146146
std::mem::replace(&mut *self.tx_result_cell.lock().unwrap(), TxResult::empty())
147147
}
148148

149-
pub fn rng_lock(&self) -> MutexGuard<BlockchainRng> {
149+
pub fn rng_lock(&self) -> MutexGuard<'_, BlockchainRng> {
150150
self.b_rng.lock().unwrap()
151151
}
152152

chain/vm/src/host/vm_hooks/vh_context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub trait VMHooksContext: Debug {
2727
/// The offset and the length must point to valid instance memory.
2828
unsafe fn memory_store(&self, mem_ptr: MemPtr, data: &[u8]);
2929

30-
fn m_types_lock(&self) -> MutexGuard<ManagedTypeContainer>;
30+
fn m_types_lock(&self) -> MutexGuard<'_, ManagedTypeContainer>;
3131

3232
fn gas_schedule(&self) -> &GasSchedule;
3333

@@ -46,7 +46,7 @@ pub trait VMHooksContext: Debug {
4646
/// Random number generator, based on the blockchain randomness source.
4747
fn random_next_bytes(&self, length: usize) -> Vec<u8>;
4848

49-
fn result_lock(&self) -> MutexGuard<TxResult>;
49+
fn result_lock(&self) -> MutexGuard<'_, TxResult>;
5050

5151
fn push_tx_log(&self, tx_log: TxLog) {
5252
self.result_lock().result_logs.push(tx_log);
@@ -62,7 +62,7 @@ pub trait VMHooksContext: Debug {
6262

6363
fn get_block_config(&self) -> &BlockConfig;
6464

65-
fn back_transfers_lock(&self) -> MutexGuard<BackTransfers>;
65+
fn back_transfers_lock(&self) -> MutexGuard<'_, BackTransfers>;
6666

6767
/// For ownership reasons, needs to return a clone.
6868
///

chain/vm/src/host/vm_hooks/vh_tx_context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<S: InstanceState> VMHooksContext for TxVMHooksContext<S> {
5656
.expect("error writing to wasmer instance memory");
5757
}
5858

59-
fn m_types_lock(&self) -> MutexGuard<ManagedTypeContainer> {
59+
fn m_types_lock(&self) -> MutexGuard<'_, ManagedTypeContainer> {
6060
self.tx_context_ref.m_types_lock()
6161
}
6262

@@ -93,7 +93,7 @@ impl<S: InstanceState> VMHooksContext for TxVMHooksContext<S> {
9393
self.tx_context_ref.rng_lock().next_bytes(length)
9494
}
9595

96-
fn result_lock(&self) -> MutexGuard<TxResult> {
96+
fn result_lock(&self) -> MutexGuard<'_, TxResult> {
9797
self.tx_context_ref.result_lock()
9898
}
9999

@@ -117,7 +117,7 @@ impl<S: InstanceState> VMHooksContext for TxVMHooksContext<S> {
117117
&self.tx_context_ref.blockchain_ref().block_config
118118
}
119119

120-
fn back_transfers_lock(&self) -> MutexGuard<BackTransfers> {
120+
fn back_transfers_lock(&self) -> MutexGuard<'_, BackTransfers> {
121121
self.tx_context_ref.back_transfers_lock()
122122
}
123123

contracts/examples/rewards-distribution/tests/rewards_distribution_integration_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ impl RewardsDistributionTestState {
9494
}
9595

9696
#[test]
97+
#[ignore = "long running test, run on demand"]
9798
fn test_compute_brackets() {
9899
let mut state = RewardsDistributionTestState::new();
99100

framework/base/src/storage/mappers/bi_di_mapper.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,15 @@ where
127127
self.value_set_mapper.contains(value)
128128
}
129129

130-
pub fn get_all_values(&self) -> unordered_set_mapper::Iter<SA, V, A> {
130+
pub fn get_all_values(&self) -> unordered_set_mapper::Iter<'_, SA, V, A> {
131131
self.value_set_mapper.iter()
132132
}
133133

134-
pub fn get_all_ids(&self) -> unordered_set_mapper::Iter<SA, K, A> {
134+
pub fn get_all_ids(&self) -> unordered_set_mapper::Iter<'_, SA, K, A> {
135135
self.id_set_mapper.iter()
136136
}
137137

138-
pub fn iter(&self) -> Iter<SA, K, V, A> {
138+
pub fn iter(&self) -> Iter<'_, SA, K, V, A> {
139139
Iter::new(self)
140140
}
141141

framework/base/src/storage/mappers/linked_list_mapper.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,11 @@ where
218218
Some(self.get_node(node_id))
219219
}
220220

221-
pub fn iter(&self) -> Iter<SA, T, A> {
221+
pub fn iter(&self) -> Iter<'_, SA, T, A> {
222222
Iter::new(self)
223223
}
224224

225-
pub fn iter_from_node_id(&self, node_id: u32) -> Iter<SA, T, A> {
225+
pub fn iter_from_node_id(&self, node_id: u32) -> Iter<'_, SA, T, A> {
226226
Iter::new_from_node_id(self, node_id)
227227
}
228228

framework/base/src/storage/mappers/map_mapper.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ where
165165
None
166166
}
167167

168-
pub fn keys(&self) -> Keys<SA, A, K> {
168+
pub fn keys(&self) -> Keys<'_, SA, A, K> {
169169
self.keys_set.iter()
170170
}
171171

@@ -198,13 +198,13 @@ where
198198

199199
/// An iterator visiting all values in arbitrary order.
200200
/// The iterator element type is `&'a V`.
201-
pub fn values(&self) -> Values<SA, A, K, V> {
201+
pub fn values(&self) -> Values<'_, SA, A, K, V> {
202202
Values::new(self)
203203
}
204204

205205
/// An iterator visiting all key-value pairs in arbitrary order.
206206
/// The iterator element type is `(&'a K, &'a V)`.
207-
pub fn iter(&self) -> Iter<SA, A, K, V> {
207+
pub fn iter(&self) -> Iter<'_, SA, A, K, V> {
208208
Iter::new(self)
209209
}
210210
}

framework/base/src/storage/mappers/map_storage_mapper.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ where
131131
None
132132
}
133133

134-
pub fn keys(&self) -> Keys<SA, A, K> {
134+
pub fn keys(&self) -> Keys<'_, SA, A, K> {
135135
self.keys_set.iter()
136136
}
137137

@@ -151,7 +151,7 @@ where
151151
}
152152

153153
/// Gets the given key's corresponding entry in the map for in-place manipulation.
154-
pub fn entry(&mut self, key: K) -> Entry<SA, A, K, V> {
154+
pub fn entry(&mut self, key: K) -> Entry<'_, SA, A, K, V> {
155155
if self.contains_key(&key) {
156156
Entry::Occupied(OccupiedEntry {
157157
key,
@@ -169,13 +169,13 @@ where
169169

170170
/// An iterator visiting all values in arbitrary order.
171171
/// The iterator element type is `&'a V`.
172-
pub fn values(&self) -> Values<SA, A, K, V> {
172+
pub fn values(&self) -> Values<'_, SA, A, K, V> {
173173
Values::new(self)
174174
}
175175

176176
/// An iterator visiting all key-value pairs in arbitrary order.
177177
/// The iterator element type is `(&'a K, &'a V)`.
178-
pub fn iter(&self) -> Iter<SA, A, K, V> {
178+
pub fn iter(&self) -> Iter<'_, SA, A, K, V> {
179179
Iter::new(self)
180180
}
181181
}

0 commit comments

Comments
 (0)