Skip to content

Commit 2ef9793

Browse files
joaoantoniocardosopatrickelectric
authored andcommittedNov 4, 2024
build: use unwrap_or_else for lazy evaluation (clippy)
1 parent 70570cf commit 2ef9793

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
 

‎build.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,12 @@ fn build_web() {
120120
"yarn"
121121
};
122122

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

131130
if !version.success() {
132131
panic!("{program} version failed!");

0 commit comments

Comments
 (0)
Please sign in to comment.