From 2c9126872335d59d51e950ca59785a6683c118f6 Mon Sep 17 00:00:00 2001 From: wasm-forge <122647775+wasm-forge@users.noreply.github.com> Date: Thu, 26 Dec 2024 15:57:59 +0100 Subject: [PATCH] clippy --- src/runtime/structure_helpers.rs | 3 ++- src/storage/chunk_iterator.rs | 2 +- src/storage/types.rs | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runtime/structure_helpers.rs b/src/runtime/structure_helpers.rs index 9af16e8..66bc170 100644 --- a/src/runtime/structure_helpers.rs +++ b/src/runtime/structure_helpers.rs @@ -12,6 +12,7 @@ use crate::{ Storage, }, }; + use std::collections::BTreeMap; #[derive(Debug)] struct EntryFindResult { @@ -429,7 +430,7 @@ pub fn rm_dir_entry( #[inline] pub fn grow_memory(memory: &dyn Memory, max_address: FileSize) { - let pages_required = (max_address + WASM_PAGE_SIZE_IN_BYTES - 1) / WASM_PAGE_SIZE_IN_BYTES; + let pages_required = max_address.div_ceil(WASM_PAGE_SIZE_IN_BYTES); let cur_pages = memory.size(); diff --git a/src/storage/chunk_iterator.rs b/src/storage/chunk_iterator.rs index 7ce3b9f..4df10c4 100644 --- a/src/storage/chunk_iterator.rs +++ b/src/storage/chunk_iterator.rs @@ -40,7 +40,7 @@ impl<'a, M: Memory> ChunkV2Iterator<'a, M> { } } -impl<'a, M: Memory> Iterator for ChunkV2Iterator<'a, M> { +impl Iterator for ChunkV2Iterator<'_, M> { type Item = ((Node, FileChunkIndex), CachedChunkPtr); fn next(&mut self) -> Option { diff --git a/src/storage/types.rs b/src/storage/types.rs index e6e5cd5..a3d502f 100644 --- a/src/storage/types.rs +++ b/src/storage/types.rs @@ -101,6 +101,7 @@ pub struct FileMetadata { pub node: Node, pub size: FileSize, pub times: Times, + pub file_type: FileType, } impl ic_stable_structures::Storable for Metadata {