Skip to content

Commit ef225af

Browse files
committed
fix: clippy
1 parent dd423d1 commit ef225af

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

crates/fuel-core/src/database.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,9 @@ mod tests {
825825
};
826826
use fuel_core_storage::transactional::WriteTransaction;
827827

828+
// this invariant doesn't hold anymore
829+
// because we have removed columns from the storage
830+
#[ignore]
828831
#[test]
829832
fn column_keys_not_exceed_count_test() {
830833
column_keys_not_exceed_count::<OffChain>();

crates/fuel-core/src/state/in_memory/memory_store.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,17 @@ where
6363
Description: DatabaseDescription,
6464
{
6565
fn default() -> Self {
66-
use strum::EnumCount;
66+
use enum_iterator::all;
67+
let mut largest_column_idx = 0;
68+
69+
for column in all::<Description::Column>() {
70+
largest_column_idx = largest_column_idx.max(column.as_usize());
71+
}
72+
6773
Self {
68-
inner: (0..Description::Column::COUNT)
74+
inner: (0..largest_column_idx.checked_add(1).expect("too many columns"))
6975
.map(|_| Mutex::new(BTreeMap::new()))
70-
.collect(),
76+
.collect::<Vec<_>>(),
7177
_marker: Default::default(),
7278
}
7379
}

crates/services/compression/src/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ where
9696
.map_err(crate::errors::CompressionError::FailedToCompressBlock)?;
9797

9898
storage_tx.write_compressed_block(
99-
block_helpers::height(&block_with_metadata),
99+
block_helpers::height(block_with_metadata),
100100
&compressed_block,
101101
)?;
102102

0 commit comments

Comments
 (0)