@@ -31,9 +31,9 @@ pub use self::build::{
3131 RUSTC_VERSION , TARGET ,
3232} ;
3333
34- use once_cell :: sync:: Lazy ;
34+ use std :: sync:: LazyLock ;
3535
36- static VERSION_INFO : Lazy < String > = Lazy :: new ( || {
36+ static VERSION_INFO : LazyLock < String > = LazyLock :: new ( || {
3737 let mut version = format ! ( "v{PKG_VERSION}" ) ;
3838
3939 if let Some ( commit_hash) = * GIT_COMMIT_HASH_SHORT {
@@ -42,10 +42,13 @@ static VERSION_INFO: Lazy<String> = Lazy::new(|| {
4242
4343 version
4444} ) ;
45+
4546/// The package name and version info.
46- pub static VERSION : Lazy < String > = Lazy :: new ( || format ! ( "{PKG_NAME} {}" , * VERSION_INFO ) ) ;
47+ pub static VERSION : LazyLock < String > =
48+ LazyLock :: new ( || format ! ( "{PKG_NAME} {}" , * VERSION_INFO ) ) ;
49+
4750/// The full version info, including build information.
48- pub static FULL_VERSION : Lazy < String > = Lazy :: new ( || {
51+ pub static FULL_VERSION : LazyLock < String > = LazyLock :: new ( || {
4952 let mut version = format ! ( "{}\n \n Compiled:\n " , * VERSION_INFO ) ;
5053
5154 str_writeln ! ( & mut version, "* across {NUM_JOBS} threads" ) ;
@@ -56,11 +59,12 @@ pub static FULL_VERSION: Lazy<String> = Lazy::new(|| {
5659 version
5760} ) ;
5861/// The package name and full version info, including build information.
59- pub static FULL_VERSION_WITH_NAME : Lazy < String > =
60- Lazy :: new ( || format ! ( "{PKG_NAME} {}" , * FULL_VERSION ) ) ;
62+ pub static FULL_VERSION_WITH_NAME : LazyLock < String > =
63+ LazyLock :: new ( || format ! ( "{PKG_NAME} {}" , * FULL_VERSION ) ) ;
64+
6165// The last 8 characters of the commit hash for this version.
62- pub static GIT_COMMIT_HASH_SHORT : Lazy < Option < & ' static str > > =
63- Lazy :: new ( || GIT_COMMIT_HASH . map ( |s| & s[ ..8 ] ) ) ;
66+ pub static GIT_COMMIT_HASH_SHORT : LazyLock < Option < & ' static str > > =
67+ LazyLock :: new ( || GIT_COMMIT_HASH . map ( |s| & s[ ..8 ] ) ) ;
6468
6569#[ test]
6670fn info ( ) {
0 commit comments