mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-06-26 02:32:35 +00:00
efa372cb3b
This commit moves file, dir, and the feature modules into one parent 'fs' module. Now there are three main 'areas' of the code: main and options, the filesystem-touching code, and the output-displaying code. It should be the case that nothing in 'output' touches 'std::fs'.
27 lines
604 B
Rust
27 lines
604 B
Rust
// Extended attribute support
|
|
pub mod xattr;
|
|
|
|
// Git support
|
|
|
|
#[cfg(feature="git")] mod git;
|
|
#[cfg(feature="git")] pub use self::git::Git;
|
|
|
|
#[cfg(not(feature="git"))] pub struct Git;
|
|
#[cfg(not(feature="git"))] use std::path::Path;
|
|
#[cfg(not(feature="git"))] use file::fields;
|
|
|
|
#[cfg(not(feature="git"))]
|
|
impl Git {
|
|
pub fn scan(_: &Path) -> Result<Git, ()> {
|
|
Err(())
|
|
}
|
|
|
|
pub fn status(&self, _: &Path) -> fields::Git {
|
|
panic!("Tried to access a Git repo without Git support!");
|
|
}
|
|
|
|
pub fn dir_status(&self, path: &Path) -> fields::Git {
|
|
self.status(path)
|
|
}
|
|
}
|