File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -439,19 +439,19 @@ impl Cmd {
439
439
return Err ( Error :: new ( ErrorKind :: Other , err_msg) ) ;
440
440
}
441
441
442
- let dir = & self . args [ 1 ] ;
443
- if !std :: path :: Path :: new ( & dir) . is_dir ( ) {
444
- let err_msg = format ! ( "cd: {:? }: No such file or directory" , dir) ;
442
+ let dir = PathBuf :: from ( & self . args [ 1 ] ) ;
443
+ if !dir. is_dir ( ) {
444
+ let err_msg = format ! ( "cd { }: No such file or directory" , dir. display ( ) ) ;
445
445
error ! ( "{}" , err_msg) ;
446
446
return Err ( Error :: new ( ErrorKind :: Other , err_msg) ) ;
447
447
}
448
448
449
- if let Err ( e) = Path :: new ( dir) . access ( AccessMode :: EXECUTE ) {
450
- error ! ( "cd {:? }: {}" , dir, e) ;
449
+ if let Err ( e) = dir. access ( AccessMode :: EXECUTE ) {
450
+ error ! ( "cd {}: {}" , dir. display ( ) , e) ;
451
451
return Err ( e) ;
452
452
}
453
453
454
- * current_dir = PathBuf :: from ( dir) ;
454
+ * current_dir = dir;
455
455
Ok ( ( ) )
456
456
}
457
457
You can’t perform that action at this time.
0 commit comments