clippy: rm some type_complexity (#9276)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Thomas Coratger
2024-07-03 21:17:33 +02:00
committed by GitHub
parent 4f3f5067ce
commit ba370918c8
5 changed files with 35 additions and 15 deletions

View File

@ -30,6 +30,12 @@ use reth_tracing::{RethTracer, Tracer};
use schnellru::{ByLength, LruMap};
use std::{collections::HashMap, sync::Arc};
/// Type alias for the LRU cache used within the [`PrecompileCache`].
type PrecompileLRUCache = LruMap<(Bytes, u64), PrecompileResult>;
/// Type alias for the thread-safe `Arc<RwLock<_>>` wrapper around [`PrecompileCache`].
type CachedPrecompileResult = Arc<RwLock<PrecompileLRUCache>>;
/// A cache for precompile inputs / outputs.
///
/// This assumes that the precompile is a standard precompile, as in `StandardPrecompileFn`, meaning
@ -40,8 +46,7 @@ use std::{collections::HashMap, sync::Arc};
#[derive(Debug, Default)]
pub struct PrecompileCache {
/// Caches for each precompile input / output.
#[allow(clippy::type_complexity)]
cache: HashMap<(Address, SpecId), Arc<RwLock<LruMap<(Bytes, u64), PrecompileResult>>>>,
cache: HashMap<(Address, SpecId), CachedPrecompileResult>,
}
/// Custom EVM configuration