Skip to content

Commit

Permalink
fix: join output directory instead of cloning it every time when saving
Browse files Browse the repository at this point in the history
  • Loading branch information
rymdtian committed Apr 10, 2024
1 parent d09ca48 commit 034866b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,18 @@ fn save_images(
}
}

let mut output_directory = output_directory;
output_directory.push("placeholder");
let output_directory = output_directory;

split_images.par_iter().enumerate().for_each(|(i, image)| {
let mut file_path = output_directory.clone();
file_path.set_file_name(format!(
let file_name = format!(
"{}-r{}c{}.{}",
img_file_name,
i / num_cols,
i % num_cols,
img_format_str
));
);

let file_path = &output_directory.join(file_name);

if file_path.exists() {
if let Err(err) = fs::remove_file(&file_path) {
Expand Down

0 comments on commit 034866b

Please sign in to comment.