Skip to content

Commit e0dbbda

Browse files
committed
remove_dir_all error handling
1 parent 250fd83 commit e0dbbda

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/main.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,17 @@ fn main() {
122122

123123
println!("Starting cleanup...");
124124

125-
projects
126-
.iter()
127-
.for_each(|p| remove_dir_all::remove_dir_all(&p.project_path.join("target")).unwrap());
125+
projects.iter().for_each(|p| {
126+
match remove_dir_all::remove_dir_all(&p.project_path.join("target")) {
127+
Ok(_) => println!("- Successfully cleaned {}", p.project_path.display()),
128+
Err(err) => {
129+
println!("- Failed to clean {}", p.project_path.display());
130+
println!(" Error: {}", err);
131+
}
132+
}
133+
});
128134

129-
println!("Done!");
135+
println!("\nDone!");
130136
}
131137

132138
/// Job for the threaded project finder. First the path to be searched, second the sender to create

0 commit comments

Comments
 (0)