We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f6d62f commit 8e047f1Copy full SHA for 8e047f1
library/std/src/sys/unix/os.rs
@@ -497,12 +497,9 @@ pub fn current_exe() -> io::Result<PathBuf> {
497
if let Some(p) = getenv(OsStr::from_bytes("PATH".as_bytes())) {
498
for search_path in split_paths(&p) {
499
let pb = search_path.join(&path);
500
- if pb.is_file() && let Ok(metadata) = crate::fs::metadata(&pb) {
501
- if metadata.permissions().mode() & 0o111 != 0 {
502
- return pb.canonicalize();
503
- }
504
- } else {
505
- continue;
+ if pb.is_file() && let Ok(metadata) = crate::fs::metadata(&pb) &&
+ metadata.permissions().mode() & 0o111 != 0 {
+ return pb.canonicalize();
506
}
507
508
0 commit comments