Skip to content

Commit

Permalink
use localfs instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ethe committed Sep 29, 2024
1 parent 075d34f commit a17d1b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 9 additions & 0 deletions fusio/src/local/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,12 @@ 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;
}
}
7 changes: 2 additions & 5 deletions fusio/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::sync::Arc;
use crate::{DynFs, Error};

#[derive(Clone)]
#[non_exhaustive]
pub enum FsOptions {
Local,
#[cfg(feature = "aws")]
Expand All @@ -18,10 +19,7 @@ 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)),
FsOptions::Local => Ok(Arc::new(crate::local::LocalFs {})),
#[cfg(all(feature = "aws", feature = "object_store"))]
FsOptions::S3 {
bucket,
Expand Down Expand Up @@ -82,7 +80,6 @@ impl FsOptions {
}
Ok(Arc::new(builder.build()))
}
_ => Err(Error::Unsupported),
}
}
}

0 comments on commit a17d1b9

Please sign in to comment.