Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit 4351e33

Browse files
bors[bot]japaric
andcommitted
Merge #20
20: omit parens in -V output when no git info is available r=japaric a=japaric Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2 parents 6e0f12f + da18fd6 commit 4351e33

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ fn main() {
2727

2828
fn commit_info() -> String {
2929
match (commit_hash(), commit_date()) {
30-
(Ok(hash), Ok(date)) => format!(" ({} {})", hash.trim(), date.trim()),
30+
(Ok(hash), Ok(date)) => if !hash.is_empty() && !date.is_empty() {
31+
format!(" ({} {})", hash.trim(), date.trim())
32+
} else {
33+
String::new()
34+
}
3135
_ => String::new(),
3236
}
3337
}

0 commit comments

Comments
 (0)