Skip to content

Commit 5ba2fce

Browse files
asaf-swclaude
andauthored
apollo_storage: remove stale allow(dead_code) (#14375)
Four `#[allow(dead_code)]` annotations on table-type methods were stale; the methods all have production (non-test) callers, so the dead_code lint never fires for them: - `DbWriter::create_common_prefix_table` (dup_sort_tables.rs): called in `lib.rs` when opening storage (contract_storage, events, nonces, compiled_class_hash tables). - `append_greater_sub_key` (dup_sort_tables.rs): called in `body/mod.rs:545` (events) and `state/mod.rs:875,920` (nonces, storage). - `Table::append` trait method (table_types/mod.rs) and its `SimpleTable` impl (simple_table.rs): called in `header.rs:331` and `body/mod.rs:508`. Removed only the annotations; no behavior change. Verified that the lib build and the test build both compile with no dead_code warnings. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3a75386 commit 5ba2fce

3 files changed

Lines changed: 0 additions & 4 deletions

File tree

crates/apollo_storage/src/db/table_types/dup_sort_tables.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ where
101101
}
102102

103103
impl DbWriter {
104-
#[allow(dead_code)]
105104
pub(crate) fn create_common_prefix_table<
106105
MainKey: KeyTrait + Debug,
107106
SubKey: KeyTrait + Debug,
@@ -345,7 +344,6 @@ impl<'env, K: KeyTrait + Debug, V: ValueSerde + Debug, T: DupSortTableType + Dup
345344
// The sub-key is equal to the last sub-key of the given main-key.
346345
// NOTICE: if this returns an error, the transaction should not be committed. Doing so can cause
347346
// a corrupt database.
348-
#[allow(dead_code)]
349347
pub(crate) fn append_greater_sub_key(
350348
&'env self,
351349
txn: &DbTransaction<'env, RW>,

crates/apollo_storage/src/db/table_types/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ pub(crate) trait Table<'env> {
5656

5757
// Append a key value pair to the end of the table. The key must be bigger than or equal to
5858
// the last key in the table; otherwise, an error will be returned.
59-
#[allow(dead_code)]
6059
fn append(
6160
&'env self,
6261
txn: &DbTransaction<'env, RW>,

crates/apollo_storage/src/db/table_types/simple_table.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ impl<'env, K: KeyTrait + Debug, V: ValueSerde + Debug> Table<'env>
112112
Ok(())
113113
}
114114

115-
#[allow(dead_code)]
116115
fn append(
117116
&'env self,
118117
txn: &DbTransaction<'env, RW>,

0 commit comments

Comments
 (0)