You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let out_dir = PathBuf::from(env::var_os(OUT_DIR)?);
48
48
// Find the first nonexistent candidate file to which the program's args can be written.
49
-
Some((0..).find_map(|i| {
50
-
let candidate = out_dir.join(format!("out{i}"));
51
-
52
-
if candidate.exists(){
53
-
// If the file exists, commands have already run. Try again.
54
-
None
55
-
}else{
56
-
Some(candidate)
57
-
}
58
-
}).unwrap_or_else(|| panic!("Cannot find the first nonexistent candidate file to which the program's args can be written under out_dir '{}'", out_dir.display())))
49
+
Some(
50
+
(0..)
51
+
.map(|i| out_dir.join(format!("out{i}")))
52
+
.find(|candidate| !candidate.exists())
53
+
.unwrap_or_else(|| panic!("Cannot find the first nonexistent candidate file to which the program's args can be written under out_dir '{}'", out_dir.display()))
54
+
)
59
55
}
60
56
61
57
/// Record the args passed to the command, if this invocation records at all.
0 commit comments