@@ -30,21 +30,21 @@ pub static CRATE_LONG_VERSION: Lazy<String> =
3030
3131/// This is a very verbose description of the crate version.
3232pub static CRATE_VERBOSE_VERSION : Lazy < String > = Lazy :: new ( || {
33+ let ( commit_hash, commit_date) = GIT
34+ . as_ref ( )
35+ . map ( |git| ( git. commit_hash , git. commit_date ) )
36+ . unwrap_or ( ( "unknown" , "unknown" ) ) ;
3337 let mut v = CRATE_VERSION . clone ( ) ;
3438 macro_rules! push {
3539 ( $( $arg: tt) * ) => { v. push( '\n' ) ; v. push_str( & format!( $( $arg) +) ) } ;
3640 }
37- if let Some ( git) = GIT . as_ref ( ) {
38- push ! ( "" ) ;
39- push ! ( "Details:" ) ;
40- push ! ( " binary: {}" , CRATE_NAME ) ;
41- push ! ( " release: {}" , CRATE_RELEASE ) ;
42- push ! ( " commit-hash: {}" , git. commit_hash) ;
43- push ! ( " commit-date: {}" , git. commit_date) ;
44- push ! ( " target: {}" , env!( "TARGET" ) ) ;
45- }
46- push ! ( "" ) ;
47- push ! ( "Compiled with:" ) ;
41+ push ! ( "\n Details:" ) ;
42+ push ! ( " binary: {}" , CRATE_NAME ) ;
43+ push ! ( " release: {}" , CRATE_RELEASE ) ;
44+ push ! ( " commit-hash: {}" , commit_hash) ;
45+ push ! ( " commit-date: {}" , commit_date) ;
46+ push ! ( " target: {}" , env!( "TARGET" ) ) ;
47+ push ! ( "\n Compiled with:" ) ;
4848 push ! ( " binary: {}" , env!( "RUSTC_VERSION_BINARY" ) ) ;
4949 push ! ( " release: {}" , env!( "RUSTC_VERSION_RELEASE" ) ) ;
5050 push ! ( " commit-hash: {}" , env!( "RUSTC_VERSION_COMMIT_HASH" ) ) ;
0 commit comments