@@ -101,7 +101,7 @@ struct Context<'a> {
101101}
102102
103103impl < ' a > Context < ' a > {
104- fn new ( root : & ' a Path , target : & ' a Path ) -> std :: io:: Result < Self > {
104+ fn new ( root : & ' a Path , target : & ' a Path ) -> io:: Result < Self > {
105105 let current_dir = env:: current_dir ( ) ?;
106106 let root_path = current_dir. join ( root) ;
107107 let root_parent = if target. exists ( ) && !root. to_str ( ) . unwrap ( ) . ends_with ( "/." ) {
@@ -181,7 +181,7 @@ impl Entry {
181181 if no_target_dir {
182182 let source_is_dir = source. is_dir ( ) ;
183183 if path_ends_with_terminator ( context. target ) && source_is_dir {
184- if let Err ( e) = std :: fs:: create_dir_all ( context. target ) {
184+ if let Err ( e) = fs:: create_dir_all ( context. target ) {
185185 eprintln ! ( "Failed to create directory: {e}" ) ;
186186 }
187187 } else {
@@ -305,9 +305,7 @@ fn copy_direntry(
305305 false ,
306306 ) {
307307 Ok ( _) => { }
308- Err ( Error :: IoErrContext ( e, _) )
309- if e. kind ( ) == std:: io:: ErrorKind :: PermissionDenied =>
310- {
308+ Err ( Error :: IoErrContext ( e, _) ) if e. kind ( ) == io:: ErrorKind :: PermissionDenied => {
311309 show ! ( uio_error!(
312310 e,
313311 "cannot open {} for reading" ,
@@ -580,14 +578,13 @@ fn build_dir(
580578 // we need to allow trivial casts here because some systems like linux have u32 constants in
581579 // in libc while others don't.
582580 #[ allow( clippy:: unnecessary_cast) ]
583- let mut excluded_perms =
584- if matches ! ( options. attributes. ownership, crate :: Preserve :: Yes { .. } ) {
585- libc:: S_IRWXG | libc:: S_IRWXO // exclude rwx for group and other
586- } else if matches ! ( options. attributes. mode, crate :: Preserve :: Yes { .. } ) {
587- libc:: S_IWGRP | libc:: S_IWOTH //exclude w for group and other
588- } else {
589- 0
590- } as u32 ;
581+ let mut excluded_perms = if matches ! ( options. attributes. ownership, Preserve :: Yes { .. } ) {
582+ libc:: S_IRWXG | libc:: S_IRWXO // exclude rwx for group and other
583+ } else if matches ! ( options. attributes. mode, Preserve :: Yes { .. } ) {
584+ libc:: S_IWGRP | libc:: S_IWOTH //exclude w for group and other
585+ } else {
586+ 0
587+ } as u32 ;
591588
592589 let umask = if copy_attributes_from. is_some ( )
593590 && matches ! ( options. attributes. mode, Preserve :: Yes { .. } )
0 commit comments