Skip to content

Commit 46efa0e

Browse files
committed
core: Replace unwrap() calls with expect() in build.rs
1 parent 5cac53f commit 46efa0e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/build.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn main() {
88
println!("cargo::rerun-if-changed=build.rs");
99
}
1010

11-
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
11+
let out_dir = PathBuf::from(std::env::var("OUT_DIR").expect("OUT_DIR not set by cargo"));
1212
let built_file = out_dir.join("built.rs");
1313

1414
built::write_built_file().expect("Failed to acquire build-time information");
@@ -19,7 +19,8 @@ fn main() {
1919
&built_file,
2020
format!(
2121
"{}\npub const BUILT_TIME_SQLITE: &str = \"{}\";\n",
22-
fs::read_to_string(&built_file).unwrap(),
22+
fs::read_to_string(&built_file)
23+
.expect("built.rs should exist after built::write_built_file()"),
2324
sqlite_date
2425
),
2526
)

0 commit comments

Comments
 (0)