diff --git a/src/feature/mod.rs b/src/feature/mod.rs index 24ebbe9..7985af5 100644 --- a/src/feature/mod.rs +++ b/src/feature/mod.rs @@ -6,39 +6,8 @@ #[cfg(target_os = "linux")] mod xattr_linux; #[cfg(target_os = "linux")] pub use self::xattr_linux::Attribute; -#[cfg(not(any(target_os = "macos", target_os = "linux")))] use std::old_io as io; -#[cfg(not(any(target_os = "macos", target_os = "linux")))] - - -#[derive(Clone)] -pub struct Attribute; - -#[cfg(not(any(target_os = "macos", target_os = "linux")))] -impl Attribute { - - /// Getter for name - pub fn name(&self) -> &str { - unimplemented!() - } - - /// Getter for size - pub fn size(&self) -> usize { - unimplemented!() - } - - /// Lists the extended attributes. Follows symlinks like `metadata` - pub fn list(_: &Path) -> io::IoResult> { - Ok(Vec::new()) - } - - /// Lists the extended attributes. Does not follow symlinks like `symlink_metadata` - pub fn llist(_: &Path) -> io::IoResult> { - Ok(Vec::new()) - } - - pub fn feature_implemented() -> bool { false } -} - +#[cfg(not(any(target_os = "macos", target_os = "linux")))] mod xattr_dummy; +#[cfg(not(any(target_os = "macos", target_os = "linux")))] pub use self::xattr_dummy::Attribute; // Git support diff --git a/src/feature/xattr_dummy.rs b/src/feature/xattr_dummy.rs new file mode 100644 index 0000000..04686d4 --- /dev/null +++ b/src/feature/xattr_dummy.rs @@ -0,0 +1,32 @@ +use std::io; +use std::path::Path; + +#[derive(Clone)] +pub struct Attribute; + +impl Attribute { + + /// Getter for name + pub fn name(&self) -> &str { + unimplemented!() + } + + /// Getter for size + pub fn size(&self) -> usize { + unimplemented!() + } + + /// Lists the extended attributes. Follows symlinks like `metadata` + pub fn list(_: &Path) -> io::Result> { + Ok(Vec::new()) + } + + /// Lists the extended attributes. Does not follow symlinks like `symlink_metadata` + pub fn llist(_: &Path) -> io::Result> { + Ok(Vec::new()) + } + + pub fn feature_implemented() -> bool { false } +} + +