Skip to content

Commit d9d0fee

Browse files
committed
fix: removed potential panic
1 parent fcbe9f4 commit d9d0fee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/alexandrie/src/utils/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub fn short() -> String {
99
format!(
1010
"{version} - {commit} ({features})",
1111
version = built::PKG_VERSION,
12-
commit = built::GIT_COMMIT_HASH_SHORT.unwrap(),
12+
commit = built::GIT_COMMIT_HASH_SHORT.unwrap_or("<none>"),
1313
features = built::FEATURES_STR,
1414
)
1515
}
@@ -24,8 +24,8 @@ pub fn long() -> String {
2424
build time (UTC) = {build_time}\n\
2525
rustc version = {rustc_version}",
2626
version = built::PKG_VERSION,
27-
branch = built::GIT_HEAD_REF.unwrap_or("(detached HEAD)"),
28-
commit = built::GIT_COMMIT_HASH.unwrap(),
27+
branch = built::GIT_HEAD_REF.unwrap_or("<none>"),
28+
commit = built::GIT_COMMIT_HASH.unwrap_or("<none>"),
2929
features = built::FEATURES_STR,
3030
build_time = built::BUILT_TIME_UTC,
3131
rustc_version = built::RUSTC_VERSION,

0 commit comments

Comments
 (0)