From 1216273b9c3717f52927ca8a864ee7767cfa3ab0 Mon Sep 17 00:00:00 2001 From: Roman Krasiuk Date: Mon, 26 Aug 2024 00:27:28 -0700 Subject: [PATCH] chore: fix clippy (#10532) --- Cargo.toml | 1 + crates/etl/Cargo.toml | 3 +++ crates/etl/src/lib.rs | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9b525ff4e..a1a21da33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -226,6 +226,7 @@ future_not_send = "allow" needless_collect = "allow" non_send_fields_in_send_ty = "allow" redundant_pub_crate = "allow" +too_long_first_doc_paragraph = "allow" significant_drop_in_scrutinee = "allow" significant_drop_tightening = "allow" diff --git a/crates/etl/Cargo.toml b/crates/etl/Cargo.toml index 1ca10d620..e90f706f5 100644 --- a/crates/etl/Cargo.toml +++ b/crates/etl/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true homepage.workspace = true repository.workspace = true +[lints] +workspace = true + [dependencies] tempfile.workspace = true reth-db-api.workspace = true diff --git a/crates/etl/src/lib.rs b/crates/etl/src/lib.rs index 0b1bd129c..ebd872d9c 100644 --- a/crates/etl/src/lib.rs +++ b/crates/etl/src/lib.rs @@ -64,7 +64,7 @@ where /// Create a new collector with some capacity. /// /// Once the capacity (in bytes) is reached, the data is sorted and flushed to disk. - pub fn new(buffer_capacity_bytes: usize, parent_dir: Option) -> Self { + pub const fn new(buffer_capacity_bytes: usize, parent_dir: Option) -> Self { Self { parent_dir, dir: None, @@ -77,12 +77,12 @@ where } /// Returns number of elements currently in the collector. - pub fn len(&self) -> usize { + pub const fn len(&self) -> usize { self.len } /// Returns `true` if there are currently no elements in the collector. - pub fn is_empty(&self) -> bool { + pub const fn is_empty(&self) -> bool { self.len == 0 }