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> {
451451 super :: unsupported:: unsupported ( )
452452}
453453
454- #[ cfg( target_os = "fuchsia" , target_os = "aix" ) ]
454+ #[ cfg( any ( target_os = "fuchsia" , target_os = "aix" ) ) ]
455455pub fn current_exe ( ) -> io:: Result < PathBuf > {
456456 use crate :: io:: ErrorKind ;
457457
@@ -469,7 +469,11 @@ pub fn current_exe() -> io::Result<PathBuf> {
469469
470470 // Prepend the current working directory to the path if it's not absolute.
471471 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+ }
473477 }
474478
475479 if path. is_absolute ( ) {
You can’t perform that action at this time.
0 commit comments