Skip to content

Commit 0befe5e

Browse files
committed
simplify to original form
1 parent 54da6ed commit 0befe5e

File tree

1 file changed

+9
-4
lines changed
  • utils/scarb-execute-utils/src

1 file changed

+9
-4
lines changed

utils/scarb-execute-utils/src/lib.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ pub const EXECUTE_PRINT_OUTPUT_FILENAME: &str = "stdout_output.txt";
1717
pub fn incremental_create_execution_output_dir(path: &Utf8Path) -> Result<(Utf8PathBuf, usize)> {
1818
for i in 1..=MAX_ITERATION_COUNT {
1919
let filepath = path.join(format!("execution{i}"));
20-
match fs::create_dir(&filepath) {
21-
Err(e) if e.kind() == io::ErrorKind::AlreadyExists => continue,
22-
Err(e) => return Err(e.into()),
23-
Ok(_) => return Ok((filepath, i)),
20+
let result = fs::create_dir(&filepath);
21+
return match result {
22+
Err(e) => {
23+
if e.kind() == io::ErrorKind::AlreadyExists {
24+
continue;
25+
}
26+
Err(e.into())
27+
}
28+
Ok(_) => Ok((filepath, i)),
2429
}
2530
}
2631
bail!("failed to create output directory")

0 commit comments

Comments
 (0)