@@ -244,16 +244,16 @@ pub trait CapStdExtDirExt {
244
244
/// to determine, and `None` will be returned in those cases.
245
245
fn is_mountpoint ( & self , path : impl AsRef < Path > ) -> Result < Option < bool > > ;
246
246
247
- #[ cfg( not ( windows ) ) ]
247
+ #[ cfg( any ( target_os = "android" , target_os = "linux" ) ) ]
248
248
/// Get the value of an extended attribute. If the attribute is not present,
249
249
/// this function will return `Ok(None)`.
250
250
fn getxattr ( & self , path : impl AsRef < Path > , key : impl AsRef < OsStr > ) -> Result < Option < Vec < u8 > > > ;
251
251
252
- #[ cfg( not ( windows ) ) ]
252
+ #[ cfg( any ( target_os = "android" , target_os = "linux" ) ) ]
253
253
/// List all extended attribute keys for this path.
254
254
fn listxattrs ( & self , path : impl AsRef < Path > ) -> Result < crate :: XattrList > ;
255
255
256
- #[ cfg( not ( windows ) ) ]
256
+ #[ cfg( any ( target_os = "android" , target_os = "linux" ) ) ]
257
257
/// Set the value of an extended attribute.
258
258
fn setxattr (
259
259
& self ,
@@ -614,6 +614,10 @@ where
614
614
615
615
// Ensure that the target path isn't absolute, and doesn't
616
616
// have any parent references.
617
+ #[ cfg_attr(
618
+ not( any( target_os = "android" , target_os = "linux" , test) ) ,
619
+ allow( dead_code)
620
+ ) ]
617
621
pub ( crate ) fn validate_relpath_no_uplinks ( path : & Path ) -> Result < & Path > {
618
622
let is_absolute = path. is_absolute ( ) ;
619
623
let contains_uplinks = path
@@ -828,17 +832,17 @@ impl CapStdExtDirExt for Dir {
828
832
is_mountpoint_impl_statx ( self , path. as_ref ( ) ) . map_err ( Into :: into)
829
833
}
830
834
831
- #[ cfg( not ( windows ) ) ]
835
+ #[ cfg( any ( target_os = "android" , target_os = "linux" ) ) ]
832
836
fn getxattr ( & self , path : impl AsRef < Path > , key : impl AsRef < OsStr > ) -> Result < Option < Vec < u8 > > > {
833
837
crate :: xattrs:: impl_getxattr ( self , path. as_ref ( ) , key. as_ref ( ) )
834
838
}
835
839
836
- #[ cfg( not ( windows ) ) ]
840
+ #[ cfg( any ( target_os = "android" , target_os = "linux" ) ) ]
837
841
fn listxattrs ( & self , path : impl AsRef < Path > ) -> Result < crate :: XattrList > {
838
842
crate :: xattrs:: impl_listxattrs ( self , path. as_ref ( ) )
839
843
}
840
844
841
- #[ cfg( not ( windows ) ) ]
845
+ #[ cfg( any ( target_os = "android" , target_os = "linux" ) ) ]
842
846
fn setxattr (
843
847
& self ,
844
848
path : impl AsRef < Path > ,
0 commit comments