File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,15 @@ use std::{env, process};
3
3
use chrono:: { TimeZone as _, Utc } ;
4
4
use rustc_version:: { Channel , version_meta} ;
5
5
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
+
6
15
fn main ( ) {
7
16
println ! ( "cargo::rustc-check-cfg=cfg(allow_unknown_lints)" ) ;
8
17
println ! ( "cargo::rustc-check-cfg=cfg(include_nightly_lints)" ) ;
@@ -26,12 +35,3 @@ fn main() {
26
35
} ;
27
36
println ! ( "cargo:rustc-env=GIRT_BUILD_DATE={}" , build_date. format( "%Y-%m-%d" ) ) ;
28
37
}
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
- }
You can’t perform that action at this time.
0 commit comments