diff --git a/src/storage/allocator.rs b/src/storage/allocator.rs index 17592c0..61406e4 100644 --- a/src/storage/allocator.rs +++ b/src/storage/allocator.rs @@ -137,10 +137,9 @@ impl ChunkPtrAllocator { pub fn set_chunk_size(&mut self, new_size: usize) -> Result<(), Error> { // new size must be one of the available values - if ChunkSize::VALUES + if !ChunkSize::VALUES .iter() - .find(|size| **size as usize == new_size) - .is_none() + .any(|size| *size as usize == new_size) { return Err(Error::IncompatibleChunkSize); } diff --git a/src/test_utils.rs b/src/test_utils.rs index 6e9559e..31281c0 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -51,14 +51,13 @@ pub fn test_fs_transient() -> FileSystem { pub fn test_fs_setups(virtual_file_name: &str) -> Vec { use crate::runtime::types::ChunkSize; - let mut result = Vec::new(); - - result.push(test_fs()); - result.push(test_fs_v1()); - result.push(test_fs_custom_chunk_size(ChunkSize::CHUNK4K)); - result.push(test_fs_custom_chunk_size(ChunkSize::CHUNK64K)); - - result.push(test_fs_transient()); + let mut result = vec![ + test_fs(), + test_fs_v1(), + test_fs_custom_chunk_size(ChunkSize::CHUNK4K), + test_fs_custom_chunk_size(ChunkSize::CHUNK64K), + test_fs_transient(), + ]; if !virtual_file_name.is_empty() { let mut fs = test_fs();