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 {