diff --git a/evm-tests/EIP-152/src/portable.rs b/evm-tests/EIP-152/src/portable.rs index 2b4e8907..589f91b9 100644 --- a/evm-tests/EIP-152/src/portable.rs +++ b/evm-tests/EIP-152/src/portable.rs @@ -18,7 +18,7 @@ use crate::{IV, SIGMA}; -/// The G mixing function. See https://tools.ietf.org/html/rfc7693#section-3.1 +/// The G mixing function. See #[inline(always)] fn g(v: &mut [u64], a: usize, b: usize, c: usize, d: usize, x: u64, y: u64) { v[a] = v[a].wrapping_add(v[b]).wrapping_add(x); diff --git a/evm-tests/ethjson/src/bytes.rs b/evm-tests/ethjson/src/bytes.rs index 4e3c5953..dc393554 100644 --- a/evm-tests/ethjson/src/bytes.rs +++ b/evm-tests/ethjson/src/bytes.rs @@ -84,7 +84,7 @@ impl<'a> Deserialize<'a> for Bytes { struct BytesVisitor; -impl<'a> Visitor<'a> for BytesVisitor { +impl Visitor<'_> for BytesVisitor { type Value = Bytes; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/evm-tests/ethjson/src/uint.rs b/evm-tests/ethjson/src/uint.rs index 818ad479..db91d3b8 100644 --- a/evm-tests/ethjson/src/uint.rs +++ b/evm-tests/ethjson/src/uint.rs @@ -64,7 +64,7 @@ impl<'a> Deserialize<'a> for Uint { struct UintVisitor; -impl<'a> Visitor<'a> for UintVisitor { +impl Visitor<'_> for UintVisitor { type Value = Uint; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/fuzzer/src/main.rs b/fuzzer/src/main.rs index fe946cd1..1a769cce 100644 --- a/fuzzer/src/main.rs +++ b/fuzzer/src/main.rs @@ -2,9 +2,9 @@ use evm_core::Machine; use std::rc::Rc; fn find_subsequence(haystack: &[u8], needle: &[u8]) -> Option { - return haystack + haystack .windows(needle.len()) - .position(|window| window == needle); + .position(|window| window == needle) } fn split_at_delim(sequence: &[u8], delim: &[u8]) -> (Vec, Vec) { diff --git a/gasometer/src/lib.rs b/gasometer/src/lib.rs index d19d755a..6a199afb 100644 --- a/gasometer/src/lib.rs +++ b/gasometer/src/lib.rs @@ -937,7 +937,7 @@ struct Inner<'config> { config: &'config Config, } -impl<'config> Inner<'config> { +impl Inner<'_> { fn memory_gas(&self, memory: MemoryCost) -> Result { let from = memory.offset; let len = memory.len; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 812fd681..097e68d1 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.82.0" +channel = "1.84.0" profile = "minimal" components = ["rustfmt", "clippy"] diff --git a/src/backend/memory.rs b/src/backend/memory.rs index 619897d6..c60f962e 100644 --- a/src/backend/memory.rs +++ b/src/backend/memory.rs @@ -96,7 +96,7 @@ impl<'vicinity> MemoryBackend<'vicinity> { } } -impl<'vicinity> Backend for MemoryBackend<'vicinity> { +impl Backend for MemoryBackend<'_> { #[allow(clippy::misnamed_getters)] fn gas_price(&self) -> U256 { self.vicinity.effective_gas_price @@ -186,7 +186,7 @@ impl<'vicinity> Backend for MemoryBackend<'vicinity> { } } -impl<'vicinity> ApplyBackend for MemoryBackend<'vicinity> { +impl ApplyBackend for MemoryBackend<'_> { fn apply(&mut self, values: A, logs: L, delete_empty: bool) where A: IntoIterator>, diff --git a/src/executor/stack/executor.rs b/src/executor/stack/executor.rs index 4eaa6c39..c94e48d6 100644 --- a/src/executor/stack/executor.rs +++ b/src/executor/stack/executor.rs @@ -1360,8 +1360,8 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> } } -impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> InterpreterHandler - for StackExecutor<'config, 'precompiles, S, P> +impl<'config, S: StackState<'config>, P: PrecompileSet> InterpreterHandler + for StackExecutor<'config, '_, S, P> { #[inline] fn before_eval(&mut self) {} @@ -1442,8 +1442,8 @@ pub struct StackExecutorCallInterrupt<'borrow>(TaggedRuntime<'borrow>); pub struct StackExecutorCreateInterrupt<'borrow>(TaggedRuntime<'borrow>); -impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> Handler - for StackExecutor<'config, 'precompiles, S, P> +impl<'config, S: StackState<'config>, P: PrecompileSet> Handler + for StackExecutor<'config, '_, S, P> { type CreateInterrupt = StackExecutorCreateInterrupt<'static>; type CreateFeedback = Infallible; @@ -1802,8 +1802,8 @@ struct StackExecutorHandle<'inner, 'config, 'precompiles, S, P> { is_static: bool, } -impl<'inner, 'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> PrecompileHandle - for StackExecutorHandle<'inner, 'config, 'precompiles, S, P> +impl<'config, S: StackState<'config>, P: PrecompileSet> PrecompileHandle + for StackExecutorHandle<'_, 'config, '_, S, P> { // Perform subcall in provided context. /// Precompile specifies in which context the subcall is executed. diff --git a/src/executor/stack/memory.rs b/src/executor/stack/memory.rs index 56faf865..3bc9f91a 100644 --- a/src/executor/stack/memory.rs +++ b/src/executor/stack/memory.rs @@ -519,7 +519,7 @@ pub struct MemoryStackState<'backend, 'config, B> { substate: MemoryStackSubstate<'config>, } -impl<'backend, 'config, B: Backend> Backend for MemoryStackState<'backend, 'config, B> { +impl Backend for MemoryStackState<'_, '_, B> { fn gas_price(&self) -> U256 { self.backend.gas_price() } @@ -596,7 +596,7 @@ impl<'backend, 'config, B: Backend> Backend for MemoryStackState<'backend, 'conf } } -impl<'backend, 'config, B: Backend> StackState<'config> for MemoryStackState<'backend, 'config, B> { +impl<'config, B: Backend> StackState<'config> for MemoryStackState<'_, 'config, B> { fn metadata(&self) -> &StackSubstateMetadata<'config> { self.substate.metadata() } diff --git a/src/maybe_borrowed.rs b/src/maybe_borrowed.rs index c5dcc686..a10644f5 100644 --- a/src/maybe_borrowed.rs +++ b/src/maybe_borrowed.rs @@ -14,7 +14,7 @@ pub enum MaybeBorrowed<'a, T> { Owned(T), } -impl<'a, T> core::ops::Deref for MaybeBorrowed<'a, T> { +impl core::ops::Deref for MaybeBorrowed<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { @@ -25,7 +25,7 @@ impl<'a, T> core::ops::Deref for MaybeBorrowed<'a, T> { } } -impl<'a, T> core::ops::DerefMut for MaybeBorrowed<'a, T> { +impl core::ops::DerefMut for MaybeBorrowed<'_, T> { fn deref_mut(&mut self) -> &mut Self::Target { match self { Self::Borrowed(x) => x,