From 677aa32bb414e358b327cbb8540c622e6b66c1d6 Mon Sep 17 00:00:00 2001 From: wasm-forge <122647775+wasm-forge@users.noreply.github.com> Date: Fri, 30 Aug 2024 00:45:06 +0200 Subject: [PATCH] clippy --- src/storage/allocator.rs | 5 ++--- src/test_utils.rs | 15 +++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) 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();