File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -451,7 +451,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
451
451
super :: unsupported:: unsupported ( )
452
452
}
453
453
454
- #[ cfg( target_os = "fuchsia" , target_os = "aix" ) ]
454
+ #[ cfg( any ( target_os = "fuchsia" , target_os = "aix" ) ) ]
455
455
pub fn current_exe ( ) -> io:: Result < PathBuf > {
456
456
use crate :: io:: ErrorKind ;
457
457
@@ -469,7 +469,11 @@ pub fn current_exe() -> io::Result<PathBuf> {
469
469
470
470
// Prepend the current working directory to the path if it's not absolute.
471
471
if cfg ! ( target_os = "fuchsia" ) {
472
- if !path. is_absolute ( ) { getcwd ( ) . map ( |cwd| cwd. join ( path) ) } else { Ok ( path) }
472
+ if !path. is_absolute ( ) {
473
+ return getcwd ( ) . map ( |cwd| cwd. join ( path) ) ;
474
+ } else {
475
+ return Ok ( path) ;
476
+ }
473
477
}
474
478
475
479
if path. is_absolute ( ) {
You can’t perform that action at this time.
0 commit comments