Skip to content

Commit

Permalink
build: use unwrap_or_else for lazy evaluation (clippy)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Nov 4, 2024
1 parent d228567 commit 5dc4bcd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,12 @@ fn build_web() {
"yarn"
};

let version = Command::new(&program)
let version = Command::new(program)
.args(["--version"])
.status()
.expect(&format!(
"Failed to build frontend, `{}` appears to be not installed.",
&program
));
.unwrap_or_else(|_| {
panic!("Failed to build frontend, `{program}` appears to be not installed.",)
});

if !version.success() {
panic!("{program} version failed!");
Expand Down

0 comments on commit 5dc4bcd

Please sign in to comment.