fix: improve build error message when flatc is not installed (#85)

* fix: improve build error message when flatc is not installed

* Apply suggestions from code review

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

* Make it more canonical rust

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>
pull/24376/head
Andrew Lamb 2020-05-19 11:05:18 -04:00 committed by GitHub
parent c98c84c101
commit f5d7e70db9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -18,9 +18,12 @@ fn main() -> Result<()> {
.arg("-o")
.arg(&out_dir)
.arg("proto/delorean/wal.fbs")
.status()?;
if !status.success() {
panic!("`flatc` failed to compile the .fbs to Rust");
.status();
match status {
Ok(status) if !status.success() => panic!("`flatc` failed to compile the .fbs to Rust"),
Ok(_status) => {} // Successfully compiled
Err(err) => panic!("Could not execute `flatc`: {}", err),
}
Ok(())