We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d9ea421 commit 33fd260Copy full SHA for 33fd260
library/std/src/sys/unix/os.rs
@@ -451,7 +451,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
451
super::unsupported::unsupported()
452
}
453
454
-#[cfg(target_os = "fuchsia", target_os = "aix")]
+#[cfg(any(target_os = "fuchsia", target_os = "aix"))]
455
pub fn current_exe() -> io::Result<PathBuf> {
456
use crate::io::ErrorKind;
457
@@ -469,7 +469,11 @@ pub fn current_exe() -> io::Result<PathBuf> {
469
470
// Prepend the current working directory to the path if it's not absolute.
471
if cfg!(target_os = "fuchsia") {
472
- if !path.is_absolute() { getcwd().map(|cwd| cwd.join(path)) } else { Ok(path) }
+ if !path.is_absolute() {
473
+ return getcwd().map(|cwd| cwd.join(path));
474
+ } else {
475
+ return Ok(path);
476
+ }
477
478
479
if path.is_absolute() {
0 commit comments