Skip to content

Commit

Permalink
fix: won't compile with azblob off
Browse files Browse the repository at this point in the history
  • Loading branch information
George-Miao authored and hannesdejager committed Jul 10, 2024
1 parent 19139b1 commit 4109e68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@ url = "2.5.2"
unftp-auth-pam = { version = "0.2.5", optional = true }

[features]
default = ["rest_auth", "cloud_storage", "jsonfile_auth"]
default = ["rest_auth", "cloud_storage", "jsonfile_auth", "opendal"]
all_extentions = ["pam_auth", "rest_auth", "jsonfile_auth", "cloud_storage"]
cloud_storage = ["unftp-sbe-gcs"]
jsonfile_auth = ["unftp-auth-jsonfile"]
pam_auth = ["unftp-auth-pam"]
rest_auth = ["unftp-auth-rest"]
tokio_console = ["console-subscriber", "tokio/tracing"]
azblob = ["dep:unftp-sbe-opendal", "dep:opendal", "opendal/services-azblob"]
opendal = ["dep:unftp-sbe-opendal", "dep:opendal"]
azblob = ["opendal/services-azblob"]

# With this we link dynamically to libc and pam
gnu = ["all_extentions"]
Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ fn gcs_storage_backend(log: &Logger, m: &clap::ArgMatches) -> Result<VfsProducer
}))
}

fn azblob_storage_backend(log: &Logger, m: &clap::ArgMatches) -> Result<VfsProducer, String> {
#[cfg(feature = "azblob")]
pub fn azblob_storage_backend(log: &Logger, m: &clap::ArgMatches) -> Result<VfsProducer, String> {
let mut b = opendal::services::Azblob::default();
if let Some(val) = m.value_of(args::AZBLOB_ROOT) {
b.root(val);
Expand Down Expand Up @@ -417,6 +418,7 @@ fn start_ftp(
match m.value_of(args::STORAGE_BACKEND_TYPE) {
None | Some("filesystem") => svc(fs_storage_backend(root_log, m)),
Some("gcs") => svc(gcs_storage_backend(root_log, m)?),
#[cfg(feature = "azblob")]
Some("azblob") => svc(azblob_storage_backend(root_log, m)?),
Some(x) => Err(format!("unknown storage back-end type {}", x)),
}
Expand Down

0 comments on commit 4109e68

Please sign in to comment.