Skip to content

Commit

Permalink
chore: resolve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould committed Sep 30, 2024
1 parent e42a204 commit ab6a807
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion fusio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions fusio/src/parse.rs → fusio/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ use std::sync::Arc;
use crate::{DynFs, Error};

#[derive(Clone)]
#[non_exhaustive]
pub enum FsOptions {
#[cfg(all(feature = "fs", any(feature = "tokio", feature = "monoio")))]
Local,
#[cfg(feature = "aws")]
S3 {
Expand All @@ -18,10 +20,8 @@ pub enum FsOptions {
impl FsOptions {
pub fn parse(self) -> Result<Arc<dyn DynFs>, Error> {
match self {
#[cfg(feature = "tokio")]
FsOptions::Local => Ok(Arc::new(crate::local::TokioFs)),
#[cfg(feature = "monoio")]
FsOptions::Local => Ok(Arc::new(crate::local::MonoIoFs)),
#[cfg(all(feature = "fs", any(feature = "tokio", feature = "monoio")))]
FsOptions::Local => Ok(Arc::new(crate::local::LocalFs {})),
#[cfg(all(feature = "aws", feature = "object_store"))]
FsOptions::S3 {
bucket,
Expand Down Expand Up @@ -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()?)))
}
Expand Down

0 comments on commit ab6a807

Please sign in to comment.