File tree Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ pub async fn is_executable(path: impl AsRef<Path>) -> Result<bool> {
129
129
meta. permissions ( ) . mode ( ) & 0o100 != 0
130
130
} ;
131
131
#[ cfg( not( unix) ) ]
132
- let has_executable_flag = |meta : Metadata | true ;
132
+ let has_executable_flag = |_meta : Metadata | true ;
133
133
134
134
fs:: metadata ( path. as_ref ( ) )
135
135
. await
Original file line number Diff line number Diff line change @@ -631,21 +631,29 @@ mod archive {
631
631
}
632
632
633
633
/// Set the executable flag for a file. Only has an effect on UNIX platforms.
634
+ #[ cfg( not( unix) ) ]
635
+ fn set_file_permissions (
636
+ _file : & mut File ,
637
+ _mode : u32 ,
638
+ _file_path_hint : impl Display ,
639
+ ) -> Result < ( ) > {
640
+ Ok ( ( ) )
641
+ }
642
+
643
+ /// Set the executable flag for a file. Only has an effect on UNIX platforms.
644
+ #[ cfg( unix) ]
634
645
fn set_file_permissions (
635
646
file : & mut File ,
636
647
mode : u32 ,
637
648
file_path_hint : impl Display ,
638
649
) -> Result < ( ) > {
639
- #[ cfg( unix) ]
640
- {
641
- use std:: fs:: Permissions ;
642
- use std:: os:: unix:: fs:: PermissionsExt ;
650
+ use std:: fs:: Permissions ;
651
+ use std:: os:: unix:: fs:: PermissionsExt ;
643
652
644
- tracing:: debug!( "Setting permission of '{file_path_hint}' to {mode:#o}" ) ;
653
+ tracing:: debug!( "Setting permission of '{file_path_hint}' to {mode:#o}" ) ;
645
654
646
- file. set_permissions ( Permissions :: from_mode ( mode) )
647
- . context ( "failed setting file permissions" ) ?;
648
- }
655
+ file. set_permissions ( Permissions :: from_mode ( mode) )
656
+ . context ( "failed setting file permissions" ) ?;
649
657
650
658
Ok ( ( ) )
651
659
}
You can’t perform that action at this time.
0 commit comments