Skip to content

Commit c5a8b9e

Browse files
committed
Fix ordering in build.rs
1 parent 23e6273 commit c5a8b9e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

build.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ use std::{env, process};
33
use chrono::{TimeZone as _, Utc};
44
use rustc_version::{Channel, version_meta};
55

6+
fn git_revision_hash() -> Option<String> {
7+
let result = process::Command::new("git")
8+
.args(["rev-parse", "--short=10", "HEAD"])
9+
.output();
10+
let output = result.ok()?;
11+
let v = String::from(String::from_utf8_lossy(&output.stdout).trim());
12+
if v.is_empty() { None } else { Some(v) }
13+
}
14+
615
fn main() {
716
println!("cargo::rustc-check-cfg=cfg(allow_unknown_lints)");
817
println!("cargo::rustc-check-cfg=cfg(include_nightly_lints)");
@@ -26,12 +35,3 @@ fn main() {
2635
};
2736
println!("cargo:rustc-env=GIRT_BUILD_DATE={}", build_date.format("%Y-%m-%d"));
2837
}
29-
30-
fn git_revision_hash() -> Option<String> {
31-
let result = process::Command::new("git")
32-
.args(["rev-parse", "--short=10", "HEAD"])
33-
.output();
34-
let output = result.ok()?;
35-
let v = String::from(String::from_utf8_lossy(&output.stdout).trim());
36-
if v.is_empty() { None } else { Some(v) }
37-
}

0 commit comments

Comments
 (0)