Skip to content

Commit

Permalink
Use unwrap_or_else in build.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrubias committed Feb 24, 2023
1 parent cd715a6 commit af267ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down

0 comments on commit af267ba

Please sign in to comment.