From af267ba638b1d8af723ab366aaaf88255887888c Mon Sep 17 00:00:00 2001 From: Victor Song Date: Fri, 30 Sep 2022 22:55:37 -0400 Subject: [PATCH] Use `unwrap_or_else` in build.rs --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index a0a1351..6cd6c72 100644 --- a/build.rs +++ b/build.rs @@ -41,7 +41,7 @@ fn main() -> io::Result<()> { let path = &out.join("version_string.txt"); // Bland version text - let mut f = File::create(path).expect(&path.to_string_lossy()); + let mut f = File::create(path).unwrap_or_else(|_| { panic!("{}", path.to_string_lossy().to_string()) }); writeln!(f, "{}", strip_codes(&ver))?; Ok(())