Skip to content

Commit

Permalink
fix broken compile
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFluffy committed Dec 5, 2024
1 parent 326b3ad commit 04d2617
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tools/protobuf-compiler/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,12 @@ fn purge_out_dir(path: impl AsRef<Path>) {
is expected to have read, write, execute permissions set",
path.as_ref().display()
);
for entry in read_dir(path).expect(read_dir_msg).flatten() {
for entry in read_dir(path).expect(&read_dir_msg).flatten() {
// skip mod.rs as it's assumed to be the only non-generated file in the out dir.
if entry
.path()
.file_name()
.expect("every entry in the generated file out dir should have a name")
== "mod.rs"
{
if entry.path().file_name().expect(&entry_msg) == "mod.rs" {
continue;
}

std::fs::remove_file(entry.path()).expect(remove_msg);
std::fs::remove_file(entry.path()).expect(&remove_msg);
}
}

0 comments on commit 04d2617

Please sign in to comment.