diff --git a/framework/base/src/hex_call_data/cd_de.rs b/framework/base/src/hex_call_data/cd_de.rs index ce6d6bdb63..f1826425e6 100644 --- a/framework/base/src/hex_call_data/cd_de.rs +++ b/framework/base/src/hex_call_data/cd_de.rs @@ -103,7 +103,7 @@ impl<'a> HexCallDataDeserializer<'a> { } } -impl<'a> TopDecodeMultiInput for HexCallDataDeserializer<'a> { +impl TopDecodeMultiInput for HexCallDataDeserializer<'_> { type ValueInput = Box<[u8]>; fn has_next(&self) -> bool { diff --git a/framework/base/src/lib.rs b/framework/base/src/lib.rs index f6c765e67b..b063a8d94a 100644 --- a/framework/base/src/lib.rs +++ b/framework/base/src/lib.rs @@ -1,7 +1,5 @@ #![no_std] #![allow(deprecated)] -#![allow(clippy::needless_lifetimes)] // TODO: fix them all! - pub use multiversx_sc_derive::{self as derive, contract, module, proxy}; // re-export basic heap types diff --git a/framework/base/src/storage/mappers/bi_di_mapper.rs b/framework/base/src/storage/mappers/bi_di_mapper.rs index ce0f24c159..decb892d2f 100644 --- a/framework/base/src/storage/mappers/bi_di_mapper.rs +++ b/framework/base/src/storage/mappers/bi_di_mapper.rs @@ -264,7 +264,7 @@ where } } -impl<'a, SA, K, V, A> Iterator for Iter<'a, SA, K, V, A> +impl Iterator for Iter<'_, SA, K, V, A> where SA: StorageMapperApi, A: StorageAddress, diff --git a/framework/base/src/storage/mappers/linked_list_mapper.rs b/framework/base/src/storage/mappers/linked_list_mapper.rs index a259467c29..0eba2da505 100644 --- a/framework/base/src/storage/mappers/linked_list_mapper.rs +++ b/framework/base/src/storage/mappers/linked_list_mapper.rs @@ -578,7 +578,7 @@ where } } -impl<'a, SA, T, A> Iterator for Iter<'a, SA, T, A> +impl Iterator for Iter<'_, SA, T, A> where SA: StorageMapperApi, A: StorageAddress, diff --git a/framework/base/src/storage/mappers/map_mapper.rs b/framework/base/src/storage/mappers/map_mapper.rs index 9e90917985..16cdf729fc 100644 --- a/framework/base/src/storage/mappers/map_mapper.rs +++ b/framework/base/src/storage/mappers/map_mapper.rs @@ -234,7 +234,7 @@ where } } -impl<'a, SA, A, K, V> Iterator for Iter<'a, SA, A, K, V> +impl Iterator for Iter<'_, SA, A, K, V> where SA: StorageMapperApi, A: StorageAddress, @@ -279,7 +279,7 @@ where } } -impl<'a, SA, A, K, V> Iterator for Values<'a, SA, A, K, V> +impl Iterator for Values<'_, SA, A, K, V> where SA: StorageMapperApi, A: StorageAddress, @@ -344,7 +344,7 @@ where pub(super) _marker: PhantomData<&'a mut (K, V)>, } -impl<'a, SA, A, K, V> Entry<'a, SA, A, K, V> +impl Entry<'_, SA, A, K, V> where SA: StorageMapperApi, A: StorageAddress, @@ -470,7 +470,7 @@ where } } -impl<'a, SA, A, K, V> OccupiedEntry<'a, SA, A, K, V> +impl OccupiedEntry<'_, SA, A, K, V> where SA: StorageMapperApi, A: StorageAddress, @@ -488,7 +488,7 @@ where } } -impl<'a, SA, K, V> OccupiedEntry<'a, SA, CurrentStorage, K, V> +impl OccupiedEntry<'_, SA, CurrentStorage, K, V> where SA: StorageMapperApi, K: TopEncode + TopDecode + NestedEncode + NestedDecode + Clone, diff --git a/framework/base/src/storage/mappers/map_storage_mapper.rs b/framework/base/src/storage/mappers/map_storage_mapper.rs index 699a3bab36..ed368a1822 100644 --- a/framework/base/src/storage/mappers/map_storage_mapper.rs +++ b/framework/base/src/storage/mappers/map_storage_mapper.rs @@ -221,7 +221,7 @@ where } } -impl<'a, SA, A, K, V> Iterator for Iter<'a, SA, A, K, V> +impl Iterator for Iter<'_, SA, A, K, V> where SA: StorageMapperApi, A: StorageAddress, @@ -268,7 +268,7 @@ where } } -impl<'a, SA, A, K, V> Iterator for Values<'a, SA, A, K, V> +impl Iterator for Values<'_, SA, A, K, V> where SA: StorageMapperApi, A: StorageAddress, @@ -388,7 +388,7 @@ where } } -impl<'a, SA, A, K, V> VacantEntry<'a, SA, A, K, V> +impl VacantEntry<'_, SA, A, K, V> where SA: StorageMapperApi, A: StorageAddress, @@ -420,7 +420,7 @@ where } } -impl<'a, SA, A, K, V> OccupiedEntry<'a, SA, A, K, V> +impl OccupiedEntry<'_, SA, A, K, V> where SA: StorageMapperApi, A: StorageAddress, @@ -438,7 +438,7 @@ where } } -impl<'a, SA, K, V> OccupiedEntry<'a, SA, CurrentStorage, K, V> +impl OccupiedEntry<'_, SA, CurrentStorage, K, V> where SA: StorageMapperApi, K: TopEncode + TopDecode + NestedEncode + NestedDecode + Clone + 'static, diff --git a/framework/base/src/storage/mappers/queue_mapper.rs b/framework/base/src/storage/mappers/queue_mapper.rs index 9937736b01..80572d1b41 100644 --- a/framework/base/src/storage/mappers/queue_mapper.rs +++ b/framework/base/src/storage/mappers/queue_mapper.rs @@ -484,7 +484,7 @@ where } } -impl<'a, SA, A, T> Iterator for Iter<'a, SA, A, T> +impl Iterator for Iter<'_, SA, A, T> where SA: StorageMapperApi, A: StorageAddress, diff --git a/framework/base/src/storage/mappers/unique_id_mapper.rs b/framework/base/src/storage/mappers/unique_id_mapper.rs index a1789d695a..a8605963a1 100644 --- a/framework/base/src/storage/mappers/unique_id_mapper.rs +++ b/framework/base/src/storage/mappers/unique_id_mapper.rs @@ -180,7 +180,7 @@ where } } -impl<'a, SA, A> Iterator for Iter<'a, SA, A> +impl Iterator for Iter<'_, SA, A> where SA: StorageMapperApi, A: StorageAddress, diff --git a/framework/base/src/storage/mappers/vec_mapper.rs b/framework/base/src/storage/mappers/vec_mapper.rs index 22b8763ece..0b7eb4cb5d 100644 --- a/framework/base/src/storage/mappers/vec_mapper.rs +++ b/framework/base/src/storage/mappers/vec_mapper.rs @@ -320,7 +320,7 @@ where } } -impl<'a, SA, T, A> Iterator for Iter<'a, SA, T, A> +impl Iterator for Iter<'_, SA, T, A> where SA: StorageMapperApi, A: StorageAddress, diff --git a/framework/base/src/storage/storage_get.rs b/framework/base/src/storage/storage_get.rs index b33b5e1dcb..3cd6324aae 100644 --- a/framework/base/src/storage/storage_get.rs +++ b/framework/base/src/storage/storage_get.rs @@ -57,7 +57,7 @@ where } } -impl<'k, A> TopDecodeInput for StorageGetInput<'k, A> +impl TopDecodeInput for StorageGetInput<'_, A> where A: StorageReadApi + ManagedTypeApi + ErrorApi + 'static, { diff --git a/framework/base/src/storage/storage_get_from_address.rs b/framework/base/src/storage/storage_get_from_address.rs index 13a467d2f0..14b1bfabf0 100644 --- a/framework/base/src/storage/storage_get_from_address.rs +++ b/framework/base/src/storage/storage_get_from_address.rs @@ -66,7 +66,7 @@ where } } -impl<'k, A> TopDecodeInput for StorageGetFromAddressInput<'k, A> +impl TopDecodeInput for StorageGetFromAddressInput<'_, A> where A: StorageReadApi + ManagedTypeApi + ErrorApi + 'static, { diff --git a/framework/base/src/storage/storage_set.rs b/framework/base/src/storage/storage_set.rs index a2f3c3b722..8907b2abbf 100644 --- a/framework/base/src/storage/storage_set.rs +++ b/framework/base/src/storage/storage_set.rs @@ -37,7 +37,7 @@ where } } -impl<'k, A> TopEncodeOutput for StorageSetOutput<'k, A> +impl TopEncodeOutput for StorageSetOutput<'_, A> where A: StorageWriteApi + ManagedTypeApi + ErrorApi + 'static, { diff --git a/framework/base/src/types/interaction/annotated/annotated_impl_big_uint.rs b/framework/base/src/types/interaction/annotated/annotated_impl_big_uint.rs index f05952ab75..590e73545f 100644 --- a/framework/base/src/types/interaction/annotated/annotated_impl_big_uint.rs +++ b/framework/base/src/types/interaction/annotated/annotated_impl_big_uint.rs @@ -53,7 +53,7 @@ where } } -impl<'a, Env> AnnotatedValue> for ManagedRef<'a, Env::Api, BigUint> +impl AnnotatedValue> for ManagedRef<'_, Env::Api, BigUint> where Env: TxEnv, { diff --git a/framework/base/src/types/interaction/expr/test_address.rs b/framework/base/src/types/interaction/expr/test_address.rs index 01d1dc819d..ed348c4e9c 100644 --- a/framework/base/src/types/interaction/expr/test_address.rs +++ b/framework/base/src/types/interaction/expr/test_address.rs @@ -56,13 +56,13 @@ impl<'a> TestAddress<'a> { } } -impl<'a, 'b> PartialEq> for TestAddress<'a> { +impl PartialEq> for TestAddress<'_> { fn eq(&self, other: &TestSCAddress) -> bool { self.to_address() == other.to_address() } } -impl<'a> PartialEq
for TestAddress<'a> { +impl PartialEq
for TestAddress<'_> { fn eq(&self, other: &Address) -> bool { &self.to_address() == other } @@ -74,7 +74,7 @@ impl<'a> PartialEq> for Address { } } -impl<'a, Api: ManagedTypeApi> PartialEq> for TestAddress<'a> { +impl PartialEq> for TestAddress<'_> { fn eq(&self, other: &ManagedAddress) -> bool { self.to_address() == other.to_address() } @@ -86,7 +86,7 @@ impl<'a, Api: ManagedTypeApi> PartialEq> for ManagedAddress } } -impl<'a, Env> AnnotatedValue> for TestAddress<'a> +impl AnnotatedValue> for TestAddress<'_> where Env: TxEnv, { @@ -102,7 +102,7 @@ where } } -impl<'a, Env> TxFrom for TestAddress<'a> +impl TxFrom for TestAddress<'_> where Env: TxEnv, { @@ -111,11 +111,11 @@ where expr.into() } } -impl<'a, Env> TxFromSpecified for TestAddress<'a> where Env: TxEnv {} -impl<'a, Env> TxTo for TestAddress<'a> where Env: TxEnv {} -impl<'a, Env> TxToSpecified for TestAddress<'a> where Env: TxEnv {} +impl TxFromSpecified for TestAddress<'_> where Env: TxEnv {} +impl TxTo for TestAddress<'_> where Env: TxEnv {} +impl TxToSpecified for TestAddress<'_> where Env: TxEnv {} -impl<'a> TopEncode for TestAddress<'a> { +impl TopEncode for TestAddress<'_> { fn top_encode_or_handle_err(&self, output: O, h: H) -> Result<(), H::HandledErr> where O: TopEncodeOutput, @@ -125,7 +125,7 @@ impl<'a> TopEncode for TestAddress<'a> { } } -impl<'a, Api> TypeAbiFrom> for ManagedAddress where Api: ManagedTypeApi {} +impl TypeAbiFrom> for ManagedAddress where Api: ManagedTypeApi {} #[cfg(test)] pub mod tests { diff --git a/framework/base/src/types/interaction/expr/test_sc_address.rs b/framework/base/src/types/interaction/expr/test_sc_address.rs index 564157fb94..520d3a6fc9 100644 --- a/framework/base/src/types/interaction/expr/test_sc_address.rs +++ b/framework/base/src/types/interaction/expr/test_sc_address.rs @@ -32,7 +32,7 @@ impl<'a> TestSCAddress<'a> { } } -impl<'a, Env> AnnotatedValue> for TestSCAddress<'a> +impl AnnotatedValue> for TestSCAddress<'_> where Env: TxEnv, { @@ -48,7 +48,7 @@ where } } -impl<'a> TestSCAddress<'a> { +impl TestSCAddress<'_> { pub fn to_address(&self) -> Address { self.eval_to_array().into() } @@ -58,13 +58,13 @@ impl<'a> TestSCAddress<'a> { } } -impl<'a, 'b> PartialEq> for TestSCAddress<'a> { +impl PartialEq> for TestSCAddress<'_> { fn eq(&self, other: &TestAddress) -> bool { self.to_address() == other.to_address() } } -impl<'a> PartialEq
for TestSCAddress<'a> { +impl PartialEq
for TestSCAddress<'_> { fn eq(&self, other: &Address) -> bool { &self.to_address() == other } @@ -76,7 +76,7 @@ impl<'a> PartialEq> for Address { } } -impl<'a, Api: ManagedTypeApi> PartialEq> for TestSCAddress<'a> { +impl PartialEq> for TestSCAddress<'_> { fn eq(&self, other: &ManagedAddress) -> bool { self.to_address() == other.to_address() } @@ -88,7 +88,7 @@ impl<'a, Api: ManagedTypeApi> PartialEq> for ManagedAddress TxFrom for TestSCAddress<'a> +impl TxFrom for TestSCAddress<'_> where Env: TxEnv, { @@ -97,11 +97,11 @@ where expr.into() } } -impl<'a, Env> TxFromSpecified for TestSCAddress<'a> where Env: TxEnv {} -impl<'a, Env> TxTo for TestSCAddress<'a> where Env: TxEnv {} -impl<'a, Env> TxToSpecified for TestSCAddress<'a> where Env: TxEnv {} +impl TxFromSpecified for TestSCAddress<'_> where Env: TxEnv {} +impl TxTo for TestSCAddress<'_> where Env: TxEnv {} +impl TxToSpecified for TestSCAddress<'_> where Env: TxEnv {} -impl<'a> TestSCAddress<'a> { +impl TestSCAddress<'_> { pub fn eval_to_array(&self) -> [u8; 32] { let result = *b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00______________________"; let expr_bytes = self.name.as_bytes(); @@ -130,7 +130,7 @@ impl<'a> TestSCAddress<'a> { } } -impl<'a> TopEncode for TestSCAddress<'a> { +impl TopEncode for TestSCAddress<'_> { fn top_encode_or_handle_err(&self, output: O, h: H) -> Result<(), H::HandledErr> where O: TopEncodeOutput, @@ -140,7 +140,7 @@ impl<'a> TopEncode for TestSCAddress<'a> { } } -impl<'a, Api> TypeAbiFrom> for ManagedAddress where Api: ManagedTypeApi {} +impl TypeAbiFrom> for ManagedAddress where Api: ManagedTypeApi {} #[cfg(test)] pub mod tests { diff --git a/framework/base/src/types/interaction/expr/test_token_identifier.rs b/framework/base/src/types/interaction/expr/test_token_identifier.rs index 68865d8fbc..36ee135239 100644 --- a/framework/base/src/types/interaction/expr/test_token_identifier.rs +++ b/framework/base/src/types/interaction/expr/test_token_identifier.rs @@ -40,7 +40,7 @@ impl<'a> TestTokenIdentifier<'a> { } } -impl<'a, Env> AnnotatedValue> for TestTokenIdentifier<'a> +impl AnnotatedValue> for TestTokenIdentifier<'_> where Env: TxEnv, { @@ -64,7 +64,7 @@ where } } -impl<'a> TopEncode for TestTokenIdentifier<'a> { +impl TopEncode for TestTokenIdentifier<'_> { fn top_encode_or_handle_err(&self, output: O, h: H) -> Result<(), H::HandledErr> where O: TopEncodeOutput, @@ -74,5 +74,4 @@ impl<'a> TopEncode for TestTokenIdentifier<'a> { } } -impl<'a, Api> TypeAbiFrom> for TokenIdentifier where Api: ManagedTypeApi -{} +impl TypeAbiFrom> for TokenIdentifier where Api: ManagedTypeApi {} diff --git a/framework/base/src/types/interaction/tx_payment/test_esdt_transfer.rs b/framework/base/src/types/interaction/tx_payment/test_esdt_transfer.rs index 99d00a219e..307bc06133 100644 --- a/framework/base/src/types/interaction/tx_payment/test_esdt_transfer.rs +++ b/framework/base/src/types/interaction/tx_payment/test_esdt_transfer.rs @@ -26,7 +26,7 @@ where } } -impl<'a, Env> TxPayment for TestEsdtTransfer<'a> +impl TxPayment for TestEsdtTransfer<'_> where Env: TxEnv, { diff --git a/framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_esdt_refs.rs b/framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_esdt_refs.rs index 14f9058b55..1326974817 100644 --- a/framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_esdt_refs.rs +++ b/framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_esdt_refs.rs @@ -2,7 +2,7 @@ use crate::types::{BigUint, EgldOrEsdtTokenPaymentRefs, ManagedAddress, TxFrom, use super::{Egld, FullPaymentData, FunctionCall, TxEnv, TxPayment}; -impl<'a, Env> TxPayment for EgldOrEsdtTokenPaymentRefs<'a, Env::Api> +impl TxPayment for EgldOrEsdtTokenPaymentRefs<'_, Env::Api> where Env: TxEnv, { diff --git a/framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_multi_esdt_ref.rs b/framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_multi_esdt_ref.rs index 9d4eb6c20a..8cd88504ae 100644 --- a/framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_multi_esdt_ref.rs +++ b/framework/base/src/types/interaction/tx_payment/tx_payment_egld_or_multi_esdt_ref.rs @@ -2,7 +2,7 @@ use crate::types::{BigUint, EgldOrMultiEsdtPaymentRefs, ManagedAddress, TxFrom, use super::{Egld, FullPaymentData, FunctionCall, TxEnv, TxPayment}; -impl<'a, Env> TxPayment for EgldOrMultiEsdtPaymentRefs<'a, Env::Api> +impl TxPayment for EgldOrMultiEsdtPaymentRefs<'_, Env::Api> where Env: TxEnv, { diff --git a/framework/base/src/types/interaction/tx_payment/tx_payment_egld_value.rs b/framework/base/src/types/interaction/tx_payment/tx_payment_egld_value.rs index 99d91b618f..9b32d93a4e 100644 --- a/framework/base/src/types/interaction/tx_payment/tx_payment_egld_value.rs +++ b/framework/base/src/types/interaction/tx_payment/tx_payment_egld_value.rs @@ -10,5 +10,5 @@ where impl TxEgldValue for BigUint where Env: TxEnv {} impl TxEgldValue for &BigUint where Env: TxEnv {} -impl<'a, Env> TxEgldValue for ManagedRef<'a, Env::Api, BigUint> where Env: TxEnv {} +impl TxEgldValue for ManagedRef<'_, Env::Api, BigUint> where Env: TxEnv {} impl TxEgldValue for u64 where Env: TxEnv {} diff --git a/framework/base/src/types/interaction/tx_payment/tx_payment_multi_esdt.rs b/framework/base/src/types/interaction/tx_payment/tx_payment_multi_esdt.rs index c0afc2055c..ab030362d2 100644 --- a/framework/base/src/types/interaction/tx_payment/tx_payment_multi_esdt.rs +++ b/framework/base/src/types/interaction/tx_payment/tx_payment_multi_esdt.rs @@ -16,7 +16,7 @@ where impl TxPaymentMultiEsdt for MultiEsdtPayment where Env: TxEnv {} impl TxPaymentMultiEsdt for &MultiEsdtPayment where Env: TxEnv {} -impl<'a, Env> TxPaymentMultiEsdt for ManagedRef<'a, Env::Api, MultiEsdtPayment> where +impl TxPaymentMultiEsdt for ManagedRef<'_, Env::Api, MultiEsdtPayment> where Env: TxEnv { } @@ -76,7 +76,7 @@ where } } -impl<'a, Env> TxPayment for ManagedRef<'a, Env::Api, MultiEsdtPayment> +impl TxPayment for ManagedRef<'_, Env::Api, MultiEsdtPayment> where Env: TxEnv, { diff --git a/framework/base/src/types/interaction/tx_payment/tx_payment_single_esdt_ref.rs b/framework/base/src/types/interaction/tx_payment/tx_payment_single_esdt_ref.rs index c91391d316..6aecb277a6 100644 --- a/framework/base/src/types/interaction/tx_payment/tx_payment_single_esdt_ref.rs +++ b/framework/base/src/types/interaction/tx_payment/tx_payment_single_esdt_ref.rs @@ -7,7 +7,7 @@ use crate::{ use super::{FullPaymentData, FunctionCall, TxEnv, TxPayment}; -impl<'a, Env> TxPayment for EsdtTokenPaymentRefs<'a, Env::Api> +impl TxPayment for EsdtTokenPaymentRefs<'_, Env::Api> where Env: TxEnv, { diff --git a/framework/base/src/types/managed/wrapped/egld_or_esdt_token_identifier.rs b/framework/base/src/types/managed/wrapped/egld_or_esdt_token_identifier.rs index 66dd7c9ec9..7b46cb2e50 100644 --- a/framework/base/src/types/managed/wrapped/egld_or_esdt_token_identifier.rs +++ b/framework/base/src/types/managed/wrapped/egld_or_esdt_token_identifier.rs @@ -207,11 +207,9 @@ impl TypeAbiFrom<&TokenIdentifier> for EgldOrEsdtTokenIdentifier where impl TypeAbiFrom<&[u8]> for EgldOrEsdtTokenIdentifier where M: ManagedTypeApi {} impl TypeAbiFrom<&str> for EgldOrEsdtTokenIdentifier where M: ManagedTypeApi {} -impl<'a, M> TypeAbiFrom> for EgldOrEsdtTokenIdentifier where - M: ManagedTypeApi -{ -} -impl<'a, M> TypeAbiFrom<&TestTokenIdentifier<'a>> for EgldOrEsdtTokenIdentifier where +impl TypeAbiFrom> for EgldOrEsdtTokenIdentifier where M: ManagedTypeApi +{} +impl TypeAbiFrom<&TestTokenIdentifier<'_>> for EgldOrEsdtTokenIdentifier where M: ManagedTypeApi { } diff --git a/framework/base/src/types/managed/wrapped/egld_or_multi_esdt_payment.rs b/framework/base/src/types/managed/wrapped/egld_or_multi_esdt_payment.rs index 88534f95c1..1c06f0677c 100644 --- a/framework/base/src/types/managed/wrapped/egld_or_multi_esdt_payment.rs +++ b/framework/base/src/types/managed/wrapped/egld_or_multi_esdt_payment.rs @@ -49,7 +49,7 @@ impl EgldOrMultiEsdtPayment { } } -impl<'a, M: ManagedTypeApi> EgldOrMultiEsdtPaymentRefs<'a, M> { +impl EgldOrMultiEsdtPaymentRefs<'_, M> { pub fn to_owned_payment(&self) -> EgldOrMultiEsdtPayment { match self { EgldOrMultiEsdtPaymentRefs::Egld(egld_value) => { diff --git a/framework/base/src/types/managed/wrapped/managed_ref.rs b/framework/base/src/types/managed/wrapped/managed_ref.rs index f618063b3c..efdf4a9596 100644 --- a/framework/base/src/types/managed/wrapped/managed_ref.rs +++ b/framework/base/src/types/managed/wrapped/managed_ref.rs @@ -49,7 +49,7 @@ where } } -impl<'a, M, T> ManagedRef<'a, M, T> +impl ManagedRef<'_, M, T> where M: ManagedTypeApi, T: ManagedType + Clone, @@ -60,7 +60,7 @@ where } } -impl<'a, M, T> Clone for ManagedRef<'a, M, T> +impl Clone for ManagedRef<'_, M, T> where M: ManagedTypeApi, T: ManagedType, @@ -75,7 +75,7 @@ where } } -impl<'a, M, T> Deref for ManagedRef<'a, M, T> +impl Deref for ManagedRef<'_, M, T> where M: ManagedTypeApi, T: ManagedType, @@ -88,7 +88,7 @@ where } } -impl<'a, M, T> Borrow for ManagedRef<'a, M, T> +impl Borrow for ManagedRef<'_, M, T> where M: ManagedTypeApi, T: ManagedType, @@ -110,7 +110,7 @@ where } } -impl<'a, M, T> PartialEq for ManagedRef<'a, M, T> +impl PartialEq for ManagedRef<'_, M, T> where M: ManagedTypeApi, T: ManagedType + PartialEq, @@ -121,14 +121,14 @@ where } } -impl<'a, M, T> Eq for ManagedRef<'a, M, T> +impl Eq for ManagedRef<'_, M, T> where M: ManagedTypeApi, T: ManagedType + PartialEq, { } -impl<'a, M, T> TopEncode for ManagedRef<'a, M, T> +impl TopEncode for ManagedRef<'_, M, T> where M: ManagedTypeApi, T: ManagedType + TopEncode, diff --git a/framework/base/src/types/managed/wrapped/managed_ref_mut.rs b/framework/base/src/types/managed/wrapped/managed_ref_mut.rs index 868ef89e78..e017021d24 100644 --- a/framework/base/src/types/managed/wrapped/managed_ref_mut.rs +++ b/framework/base/src/types/managed/wrapped/managed_ref_mut.rs @@ -115,7 +115,7 @@ where } } -impl<'a, M, T> PartialEq for ManagedRefMut<'a, M, T> +impl PartialEq for ManagedRefMut<'_, M, T> where M: ManagedTypeApi, T: ManagedType + PartialEq, @@ -126,14 +126,14 @@ where } } -impl<'a, M, T> Eq for ManagedRefMut<'a, M, T> +impl Eq for ManagedRefMut<'_, M, T> where M: ManagedTypeApi, T: ManagedType + PartialEq, { } -impl<'a, M, T> TopEncode for ManagedRefMut<'a, M, T> +impl TopEncode for ManagedRefMut<'_, M, T> where M: ManagedTypeApi, T: ManagedType + TopEncode, @@ -148,7 +148,7 @@ where } } -impl<'a, M, T> NestedEncode for ManagedRefMut<'a, M, T> +impl NestedEncode for ManagedRefMut<'_, M, T> where M: ManagedTypeApi, T: ManagedType + NestedEncode, @@ -163,7 +163,7 @@ where } } -impl<'a, M, T> core::fmt::Debug for ManagedRefMut<'a, M, T> +impl core::fmt::Debug for ManagedRefMut<'_, M, T> where M: ManagedTypeApi, T: ManagedType + core::fmt::Debug, diff --git a/framework/base/src/types/managed/wrapped/managed_vec_owned_iter.rs b/framework/base/src/types/managed/wrapped/managed_vec_owned_iter.rs index 8e0da8727c..b5e342d345 100644 --- a/framework/base/src/types/managed/wrapped/managed_vec_owned_iter.rs +++ b/framework/base/src/types/managed/wrapped/managed_vec_owned_iter.rs @@ -39,7 +39,7 @@ where } } -impl<'a, M, T> Iterator for ManagedVecOwnedIterator<'a, M, T> +impl Iterator for ManagedVecOwnedIterator<'_, M, T> where M: ManagedTypeApi, T: ManagedVecItem, @@ -70,14 +70,14 @@ where } } -impl<'a, M, T> ExactSizeIterator for ManagedVecOwnedIterator<'a, M, T> +impl ExactSizeIterator for ManagedVecOwnedIterator<'_, M, T> where M: ManagedTypeApi, T: ManagedVecItem, { } -impl<'a, M, T> DoubleEndedIterator for ManagedVecOwnedIterator<'a, M, T> +impl DoubleEndedIterator for ManagedVecOwnedIterator<'_, M, T> where M: ManagedTypeApi, T: ManagedVecItem, @@ -98,7 +98,7 @@ where } } -impl<'a, M, T> Clone for ManagedVecOwnedIterator<'a, M, T> +impl Clone for ManagedVecOwnedIterator<'_, M, T> where M: ManagedTypeApi, T: ManagedVecItem, diff --git a/framework/base/src/types/managed/wrapped/managed_vec_ref_iter.rs b/framework/base/src/types/managed/wrapped/managed_vec_ref_iter.rs index 4703a1f61b..18cfcf84fe 100644 --- a/framework/base/src/types/managed/wrapped/managed_vec_ref_iter.rs +++ b/framework/base/src/types/managed/wrapped/managed_vec_ref_iter.rs @@ -56,14 +56,14 @@ where } } -impl<'a, M, T> ExactSizeIterator for ManagedVecRefIterator<'a, M, T> +impl ExactSizeIterator for ManagedVecRefIterator<'_, M, T> where M: ManagedTypeApi, T: ManagedVecItem, { } -impl<'a, M, T> DoubleEndedIterator for ManagedVecRefIterator<'a, M, T> +impl DoubleEndedIterator for ManagedVecRefIterator<'_, M, T> where M: ManagedTypeApi, T: ManagedVecItem, @@ -84,7 +84,7 @@ where } } -impl<'a, M, T> Clone for ManagedVecRefIterator<'a, M, T> +impl Clone for ManagedVecRefIterator<'_, M, T> where M: ManagedTypeApi, T: ManagedVecItem, diff --git a/framework/base/src/types/static_buffer/sparse_array.rs b/framework/base/src/types/static_buffer/sparse_array.rs index bb3a083243..911069a73d 100644 --- a/framework/base/src/types/static_buffer/sparse_array.rs +++ b/framework/base/src/types/static_buffer/sparse_array.rs @@ -156,7 +156,7 @@ where } } -impl<'a, E, const CAPACITY: usize> Iterator for SparseArrayIterator<'a, E, CAPACITY> +impl Iterator for SparseArrayIterator<'_, E, CAPACITY> where E: ErrorApi, { @@ -179,12 +179,12 @@ where } } -impl<'a, E, const CAPACITY: usize> ExactSizeIterator for SparseArrayIterator<'a, E, CAPACITY> where +impl ExactSizeIterator for SparseArrayIterator<'_, E, CAPACITY> where E: ErrorApi { } -impl<'a, E, const CAPACITY: usize> DoubleEndedIterator for SparseArrayIterator<'a, E, CAPACITY> +impl DoubleEndedIterator for SparseArrayIterator<'_, E, CAPACITY> where E: ErrorApi, { @@ -200,7 +200,7 @@ where } } -impl<'a, E, const CAPACITY: usize> Clone for SparseArrayIterator<'a, E, CAPACITY> +impl Clone for SparseArrayIterator<'_, E, CAPACITY> where E: ErrorApi, { diff --git a/framework/scenario/src/facade/expr/file_path.rs b/framework/scenario/src/facade/expr/file_path.rs index 0c05165fb2..593610ecd6 100644 --- a/framework/scenario/src/facade/expr/file_path.rs +++ b/framework/scenario/src/facade/expr/file_path.rs @@ -22,7 +22,7 @@ impl FilePath<'_> { } } -impl<'a, Env> AnnotatedValue> for FilePath<'a> +impl AnnotatedValue> for FilePath<'_> where Env: ScenarioTxEnv, { diff --git a/framework/scenario/src/facade/expr/mxsc_path.rs b/framework/scenario/src/facade/expr/mxsc_path.rs index 465eb5f097..fac10d6a46 100644 --- a/framework/scenario/src/facade/expr/mxsc_path.rs +++ b/framework/scenario/src/facade/expr/mxsc_path.rs @@ -20,7 +20,7 @@ impl<'a> MxscPath<'a> { } } -impl<'a> MxscPath<'a> { +impl MxscPath<'_> { pub fn eval_to_expr(&self) -> String { format!("{MXSC_PREFIX}{}", self.path) } @@ -30,7 +30,7 @@ impl<'a> MxscPath<'a> { } } -impl<'a, Env> AnnotatedValue> for MxscPath<'a> +impl AnnotatedValue> for MxscPath<'_> where Env: ScenarioTxEnv, { @@ -44,9 +44,9 @@ where } } -impl<'a, Env> TxCodeValue for MxscPath<'a> where Env: ScenarioTxEnv {} +impl TxCodeValue for MxscPath<'_> where Env: ScenarioTxEnv {} -impl<'a> RegisterCodeSource for MxscPath<'a> { +impl RegisterCodeSource for MxscPath<'_> { fn into_code(self, env_data: ScenarioTxEnvData) -> Vec { self.resolve_contents(&env_data.interpreter_context()) } diff --git a/framework/scenario/src/facade/expr/num_expr.rs b/framework/scenario/src/facade/expr/num_expr.rs index 704f52496b..55a849c1d3 100644 --- a/framework/scenario/src/facade/expr/num_expr.rs +++ b/framework/scenario/src/facade/expr/num_expr.rs @@ -19,7 +19,7 @@ where BigUint::from_bytes_be(&bytes) } -impl<'a, Env> AnnotatedValue> for NumExpr<'a> +impl AnnotatedValue> for NumExpr<'_> where Env: ScenarioTxEnv, { @@ -32,7 +32,7 @@ where } } -impl<'a, Env> AnnotatedValue for NumExpr<'a> +impl AnnotatedValue for NumExpr<'_> where Env: ScenarioTxEnv, { @@ -45,5 +45,5 @@ where } } -impl<'a, Env> TxEgldValue for NumExpr<'a> where Env: ScenarioTxEnv {} -impl<'a, Env> TxGasValue for NumExpr<'a> where Env: ScenarioTxEnv {} +impl TxEgldValue for NumExpr<'_> where Env: ScenarioTxEnv {} +impl TxGasValue for NumExpr<'_> where Env: ScenarioTxEnv {} diff --git a/framework/scenario/src/facade/result_handlers/expect_error.rs b/framework/scenario/src/facade/result_handlers/expect_error.rs index a06a227424..55e2bde473 100644 --- a/framework/scenario/src/facade/result_handlers/expect_error.rs +++ b/framework/scenario/src/facade/result_handlers/expect_error.rs @@ -8,14 +8,14 @@ use crate::scenario_model::{BytesValue, CheckValue, TxExpect, TxResponse}; /// Can only be used in tests and interactors, not available in contracts. pub struct ExpectError<'a>(pub u64, pub &'a str); -impl<'a, Env, Original> RHListItem for ExpectError<'a> +impl RHListItem for ExpectError<'_> where Env: TxEnv, { type Returns = (); } -impl<'a, Env, Original> RHListItemExec for ExpectError<'a> +impl RHListItemExec for ExpectError<'_> where Env: TxEnv, { diff --git a/framework/scenario/src/facade/result_handlers/expect_message.rs b/framework/scenario/src/facade/result_handlers/expect_message.rs index af5fa2a429..65f412fadd 100644 --- a/framework/scenario/src/facade/result_handlers/expect_message.rs +++ b/framework/scenario/src/facade/result_handlers/expect_message.rs @@ -8,14 +8,14 @@ use crate::scenario_model::{BytesValue, CheckValue, TxExpect, TxResponse, U64Val /// Can only be used in tests and interactors, not available in contracts. pub struct ExpectMessage<'a>(pub &'a str); -impl<'a, Env, Original> RHListItem for ExpectMessage<'a> +impl RHListItem for ExpectMessage<'_> where Env: TxEnv, { type Returns = (); } -impl<'a, Env, Original> RHListItemExec for ExpectMessage<'a> +impl RHListItemExec for ExpectMessage<'_> where Env: TxEnv, { diff --git a/framework/scenario/src/facade/world_tx/scenario_check_state.rs b/framework/scenario/src/facade/world_tx/scenario_check_state.rs index 3f5423419a..182edee26a 100644 --- a/framework/scenario/src/facade/world_tx/scenario_check_state.rs +++ b/framework/scenario/src/facade/world_tx/scenario_check_state.rs @@ -230,7 +230,7 @@ impl<'w> CheckStateBuilder<'w> { } } -impl<'w> Drop for CheckStateBuilder<'w> { +impl Drop for CheckStateBuilder<'_> { fn drop(&mut self) { self.commit_accounts(); } diff --git a/framework/scenario/src/facade/world_tx/scenario_exec_call.rs b/framework/scenario/src/facade/world_tx/scenario_exec_call.rs index 9c1551111b..a856d16d91 100644 --- a/framework/scenario/src/facade/world_tx/scenario_exec_call.rs +++ b/framework/scenario/src/facade/world_tx/scenario_exec_call.rs @@ -23,7 +23,7 @@ pub struct ScenarioEnvExec<'w> { pub data: ScenarioTxEnvData, } -impl<'w> TxEnv for ScenarioEnvExec<'w> { +impl TxEnv for ScenarioEnvExec<'_> { type Api = StaticApi; type RHExpect = TxExpect; @@ -41,7 +41,7 @@ impl<'w> TxEnv for ScenarioEnvExec<'w> { } } -impl<'w> TxEnvMockDeployAddress for ScenarioEnvExec<'w> { +impl TxEnvMockDeployAddress for ScenarioEnvExec<'_> { fn mock_deploy_new_address(&mut self, from: &From, new_address: NA) where From: TxFromSpecified, @@ -65,7 +65,7 @@ impl<'w> TxEnvMockDeployAddress for ScenarioEnvExec<'w> { } } -impl<'w> ScenarioTxEnv for ScenarioEnvExec<'w> { +impl ScenarioTxEnv for ScenarioEnvExec<'_> { fn env_data(&self) -> &ScenarioTxEnvData { &self.data } @@ -115,7 +115,7 @@ where } } -impl<'w> TxEnvWithTxHash for ScenarioEnvExec<'w> { +impl TxEnvWithTxHash for ScenarioEnvExec<'_> { fn set_tx_hash(&mut self, tx_hash: H256) { self.data.set_tx_hash(tx_hash); } diff --git a/framework/scenario/src/facade/world_tx/scenario_query_call.rs b/framework/scenario/src/facade/world_tx/scenario_query_call.rs index dc416439b4..afae3d80e9 100644 --- a/framework/scenario/src/facade/world_tx/scenario_query_call.rs +++ b/framework/scenario/src/facade/world_tx/scenario_query_call.rs @@ -18,7 +18,7 @@ pub struct ScenarioEnvQuery<'w> { pub data: ScenarioTxEnvData, } -impl<'w> TxEnv for ScenarioEnvQuery<'w> { +impl TxEnv for ScenarioEnvQuery<'_> { type Api = StaticApi; type RHExpect = TxExpect; @@ -36,7 +36,7 @@ impl<'w> TxEnv for ScenarioEnvQuery<'w> { } } -impl<'w> ScenarioTxEnv for ScenarioEnvQuery<'w> { +impl ScenarioTxEnv for ScenarioEnvQuery<'_> { fn env_data(&self) -> &ScenarioTxEnvData { &self.data } diff --git a/framework/scenario/src/facade/world_tx/scenario_set_state.rs b/framework/scenario/src/facade/world_tx/scenario_set_state.rs index 3fd44d70b3..ef256453f7 100644 --- a/framework/scenario/src/facade/world_tx/scenario_set_state.rs +++ b/framework/scenario/src/facade/world_tx/scenario_set_state.rs @@ -239,7 +239,7 @@ impl<'w> SetStateBuilderBase<'w> { } } -impl<'w> SetStateBuilder<'w, ()> {} +impl SetStateBuilder<'_, ()> {} impl<'w, Item> SetStateBuilder<'w, Item> where @@ -313,7 +313,7 @@ where pub fn commit(self) {} } -impl<'w, Current> Drop for SetStateBuilder<'w, Current> +impl Drop for SetStateBuilder<'_, Current> where Current: SetStateBuilderItem, { diff --git a/framework/scenario/src/facade/world_tx/scenario_set_state/scenario_set_account.rs b/framework/scenario/src/facade/world_tx/scenario_set_state/scenario_set_account.rs index f5590894e1..a9821659a5 100644 --- a/framework/scenario/src/facade/world_tx/scenario_set_state/scenario_set_account.rs +++ b/framework/scenario/src/facade/world_tx/scenario_set_state/scenario_set_account.rs @@ -38,7 +38,7 @@ impl SetStateBuilderItem for AccountItem { } } -impl<'w> SetStateBuilder<'w, AccountItem> { +impl SetStateBuilder<'_, AccountItem> { pub fn nonce(mut self, nonce: N) -> Self where N: AnnotatedValue, diff --git a/framework/scenario/src/facade/world_tx/scenario_set_state/scenario_set_block.rs b/framework/scenario/src/facade/world_tx/scenario_set_state/scenario_set_block.rs index 3ef0d06cca..e2244207db 100644 --- a/framework/scenario/src/facade/world_tx/scenario_set_state/scenario_set_block.rs +++ b/framework/scenario/src/facade/world_tx/scenario_set_state/scenario_set_block.rs @@ -49,7 +49,7 @@ impl SetStateBuilderItem for BlockItem { } } -impl<'w> SetStateBuilder<'w, BlockItem> { +impl SetStateBuilder<'_, BlockItem> { pub fn block_epoch(mut self, block_epoch: N) -> Self where N: AnnotatedValue, diff --git a/framework/scenario/src/lib.rs b/framework/scenario/src/lib.rs index 46238e2ab9..cfac7eaa50 100644 --- a/framework/scenario/src/lib.rs +++ b/framework/scenario/src/lib.rs @@ -1,5 +1,4 @@ #![allow(clippy::type_complexity)] -#![allow(clippy::needless_lifetimes)] // TODO: fix them all! pub mod api; pub mod bech32;