From 406662984d934e0d816eae198e7f722398d9ae8d Mon Sep 17 00:00:00 2001 From: Gwo Tzu-Hsing Date: Thu, 14 Nov 2024 15:16:54 +0800 Subject: [PATCH] refactor: format & specific compilation condition scope --- examples/opfs/src/lib.rs | 1 + fusio/Cargo.toml | 1 + fusio/src/lib.rs | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/opfs/src/lib.rs b/examples/opfs/src/lib.rs index e537434..81cba91 100644 --- a/examples/opfs/src/lib.rs +++ b/examples/opfs/src/lib.rs @@ -88,6 +88,7 @@ pub async fn async_reader() { assert_eq!(expected, read); web_sys::console::log_1(&format!("read data: {:?} from parquet", read).into()); } + #[wasm_bindgen] pub async fn remove_all_dir() { let fs_options = FsOptions::Local; diff --git a/fusio/Cargo.toml b/fusio/Cargo.toml index 6dff917..381992f 100644 --- a/fusio/Cargo.toml +++ b/fusio/Cargo.toml @@ -49,6 +49,7 @@ opfs = [ tokio = ["async-stream", "dep:tokio"] tokio-http = ["dep:reqwest", "http"] tokio-uring = ["async-stream", "completion-based", "dep:tokio-uring", "no-send"] + [[bench]] harness = false name = "tokio" diff --git a/fusio/src/lib.rs b/fusio/src/lib.rs index a53450a..99e914b 100644 --- a/fusio/src/lib.rs +++ b/fusio/src/lib.rs @@ -208,7 +208,6 @@ impl Write for &mut W { } #[cfg(test)] -#[cfg(not(target_arch = "wasm32"))] mod tests { use super::{Read, Write}; use crate::{buf::IoBufMut, Error, IoBuf}; @@ -322,6 +321,7 @@ mod tests { } #[allow(unused)] + #[cfg(not(target_arch = "wasm32"))] async fn test_local_fs(fs: S) -> Result<(), Error> where S: crate::fs::Fs, @@ -395,7 +395,7 @@ mod tests { write_and_read(File::from_std(write), File::from_std(read)).await; } - #[cfg(feature = "tokio")] + #[cfg(all(feature = "tokio", not(target_arch = "wasm32")))] #[tokio::test] async fn test_tokio_fs() { use crate::disk::TokioFs;