From 2ef9793c68f0686c74f37da211b35b72a8c0a531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Mon, 4 Nov 2024 08:58:18 -0300 Subject: [PATCH] build: use unwrap_or_else for lazy evaluation (clippy) --- build.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build.rs b/build.rs index cb006871..935f83ce 100644 --- a/build.rs +++ b/build.rs @@ -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!");