From 075d34fe24fa4388efefef2f65b097f90973d4b6 Mon Sep 17 00:00:00 2001 From: Kould Date: Sun, 29 Sep 2024 19:02:33 +0800 Subject: [PATCH] chore: resolve comment --- fusio/src/lib.rs | 3 ++- fusio/src/local/mod.rs | 9 --------- fusio/src/{parse.rs => options.rs} | 4 ++-- 3 files changed, 4 insertions(+), 12 deletions(-) rename fusio/src/{parse.rs => options.rs} (94%) diff --git a/fusio/src/lib.rs b/fusio/src/lib.rs index 5a853ad..a1f21fd 100644 --- a/fusio/src/lib.rs +++ b/fusio/src/lib.rs @@ -5,7 +5,8 @@ mod error; #[cfg(feature = "fs")] pub mod fs; pub mod local; -pub mod parse; +#[cfg(feature = "fs")] +pub mod options; pub mod path; pub mod remotes; diff --git a/fusio/src/local/mod.rs b/fusio/src/local/mod.rs index c71df41..b16fcce 100644 --- a/fusio/src/local/mod.rs +++ b/fusio/src/local/mod.rs @@ -14,12 +14,3 @@ pub use tokio::fs::*; #[cfg(all(feature = "tokio-uring", target_os = "linux", feature = "fs"))] #[allow(unused)] pub use tokio_uring::fs::*; - -#[cfg(feature = "fs")] -cfg_if::cfg_if! { - if #[cfg(feature = "tokio")] { - pub type LocalFs = TokioFs; - } else if #[cfg(feature = "monoio")] { - pub type LocalFs = MonoIoFs; - } -} diff --git a/fusio/src/parse.rs b/fusio/src/options.rs similarity index 94% rename from fusio/src/parse.rs rename to fusio/src/options.rs index 01e1651..86c67e3 100644 --- a/fusio/src/parse.rs +++ b/fusio/src/options.rs @@ -51,8 +51,8 @@ impl FsOptions { if let Some(sign_payload) = sign_payload { builder = builder.with_unsigned_payload(!sign_payload); } - if let Some(checksum) = checksum { - // TODO + if matches!(checksum, Some(true)) { + builder = builder.with_checksum_algorithm(object_store::aws::Checksum::SHA256); } Ok(Arc::new(S3Store::new(builder.build()?))) }