From 20431f374da1e09be57c8ac7d717ddb18e603a86 Mon Sep 17 00:00:00 2001 From: kien6034 Date: Thu, 27 Jun 2024 22:37:38 +0700 Subject: [PATCH 1/2] fix: hacky type inference --- crates/storage/provider/src/providers/static_file/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/storage/provider/src/providers/static_file/mod.rs b/crates/storage/provider/src/providers/static_file/mod.rs index 5c2057b3b57d..0e2730157465 100644 --- a/crates/storage/provider/src/providers/static_file/mod.rs +++ b/crates/storage/provider/src/providers/static_file/mod.rs @@ -12,7 +12,7 @@ mod metrics; use reth_nippy_jar::NippyJar; use reth_primitives::{static_file::SegmentHeader, StaticFileSegment}; use reth_storage_errors::provider::{ProviderError, ProviderResult}; -use std::{ops::Deref, sync::Arc}; +use std::{ops::Deref, sync::Arc, vec::IntoIter}; const BLOCKS_PER_STATIC_FILE: u64 = 500_000; @@ -128,9 +128,7 @@ mod tests { let provider = factory.provider().unwrap(); let tx = provider.tx_ref(); - // Hacky type inference. TODO fix - let mut none_vec = Some(vec![vec![vec![0u8]].into_iter()]); - let _ = none_vec.take(); + let none_vec: Option>>> = None; // Generate list of hashes for filters & PHF let mut cursor = tx.cursor_read::>().unwrap(); From 45d95b60bfa4b5036a8feedda2717b86515c7b05 Mon Sep 17 00:00:00 2001 From: kien6034 Date: Thu, 27 Jun 2024 22:48:02 +0700 Subject: [PATCH 2/2] fix: lint unused type --- crates/storage/provider/src/providers/static_file/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/storage/provider/src/providers/static_file/mod.rs b/crates/storage/provider/src/providers/static_file/mod.rs index 0e2730157465..e7073defeed0 100644 --- a/crates/storage/provider/src/providers/static_file/mod.rs +++ b/crates/storage/provider/src/providers/static_file/mod.rs @@ -12,7 +12,7 @@ mod metrics; use reth_nippy_jar::NippyJar; use reth_primitives::{static_file::SegmentHeader, StaticFileSegment}; use reth_storage_errors::provider::{ProviderError, ProviderResult}; -use std::{ops::Deref, sync::Arc, vec::IntoIter}; +use std::{ops::Deref, sync::Arc}; const BLOCKS_PER_STATIC_FILE: u64 = 500_000; @@ -69,6 +69,7 @@ mod tests { }; use reth_primitives::{static_file::find_fixed_range, BlockNumber, B256, U256}; use reth_testing_utils::generators::{self, random_header_range}; + use std::vec::IntoIter; #[test] fn test_snap() {