Skip to content

Commit

Permalink
feat(vfs) Make host_fs and mem_fs mutually exclusives.
Browse files Browse the repository at this point in the history
This patch generates a compiler error if `host_fs` and `mem_fs` are
both enabled at compile-time. It also generates a compiler error if
none of them have been enabled.
  • Loading branch information
Hywan committed Aug 16, 2021
1 parent f639dd9 commit 52be548
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/vfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ use std::path::{Path, PathBuf};
use thiserror::Error;
use tracing::debug;

#[cfg(all(not(feature = "host_fs"), not(feature = "mem_fs")))]
compile_error!("At least the `host_fs` or the `mem_fs` feature must be enabled. Please, pick one.");

#[cfg(all(feature = "host_fs", feature = "mem_fs"))]
compile_error!("The `host_fs` and `mem_fs` features are mutually exclusive.");

#[cfg(feature = "host_fs")]
pub mod host_fs;
//pub mod vfs_fs;
Expand Down

0 comments on commit 52be548

Please sign in to comment.