Move dummy xattr Attribute implementation into its own module.

This commit is contained in:
Michael Neumann 2015-06-17 01:52:06 +02:00
parent 6155252ac8
commit a0105b951d
2 changed files with 34 additions and 33 deletions

View File

@ -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<Vec<Attribute>> {
Ok(Vec::new())
}
/// Lists the extended attributes. Does not follow symlinks like `symlink_metadata`
pub fn llist(_: &Path) -> io::IoResult<Vec<Attribute>> {
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

View File

@ -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<Vec<Attribute>> {
Ok(Vec::new())
}
/// Lists the extended attributes. Does not follow symlinks like `symlink_metadata`
pub fn llist(_: &Path) -> io::Result<Vec<Attribute>> {
Ok(Vec::new())
}
pub fn feature_implemented() -> bool { false }
}