@@ -22,7 +22,7 @@ mod build {
2222 include ! ( concat!( env!( "OUT_DIR" ) , "/built.rs" ) ) ;
2323}
2424
25- use once_cell :: sync:: Lazy ;
25+ use std :: sync:: LazyLock ;
2626use time:: format_description:: well_known:: Rfc2822 ;
2727use time:: OffsetDateTime ;
2828
@@ -33,12 +33,12 @@ pub use self::build::{
3333 RUSTC_VERSION , TARGET ,
3434} ;
3535
36- pub static BUILT_TIME_UTC : Lazy < OffsetDateTime > = Lazy :: new ( || {
36+ pub static BUILT_TIME_UTC : LazyLock < OffsetDateTime > = LazyLock :: new ( || {
3737 OffsetDateTime :: parse ( BUILT_TIME_UTC_STR , & Rfc2822 )
3838 . expect ( "Unable to parse built time string" )
3939} ) ;
4040
41- pub static VERSION_INFO : Lazy < String > = Lazy :: new ( || {
41+ pub static VERSION_INFO : LazyLock < String > = LazyLock :: new ( || {
4242 let mut version = format ! ( "v{PKG_VERSION}" ) ;
4343
4444 if let Some ( commit_hash) = * GIT_COMMIT_HASH_SHORT {
@@ -48,7 +48,7 @@ pub static VERSION_INFO: Lazy<String> = Lazy::new(|| {
4848 version
4949} ) ;
5050
51- pub static COMPILE_INFO : Lazy < String > = Lazy :: new ( || {
51+ pub static COMPILE_INFO : LazyLock < String > = LazyLock :: new ( || {
5252 let mut info = str !( "Compile info:\n " ) ;
5353 str_writeln ! ( & mut info, "* on {BUILT_TIME_UTC_STR}" ) ;
5454 str_writeln ! ( & mut info, "* by {RUSTC_VERSION}" ) ;
@@ -57,15 +57,16 @@ pub static COMPILE_INFO: Lazy<String> = Lazy::new(|| {
5757 info
5858} ) ;
5959
60- pub static VERSION : Lazy < String > = Lazy :: new ( || format ! ( "{PKG_NAME} {}" , * VERSION_INFO ) ) ;
60+ pub static VERSION : LazyLock < String > =
61+ LazyLock :: new ( || format ! ( "{PKG_NAME} {}" , * VERSION_INFO ) ) ;
6162
62- pub static FULL_VERSION : Lazy < String > =
63- Lazy :: new ( || format ! ( "{}\n \n {}" , * VERSION , * COMPILE_INFO ) ) ;
63+ pub static FULL_VERSION : LazyLock < String > =
64+ LazyLock :: new ( || format ! ( "{}\n \n {}" , * VERSION , * COMPILE_INFO ) ) ;
6465
65- pub static GIT_COMMIT_HASH_SHORT : Lazy < Option < & ' static str > > =
66- Lazy :: new ( || build:: GIT_COMMIT_HASH . map ( |s| & s[ ..8 ] ) ) ;
66+ pub static GIT_COMMIT_HASH_SHORT : LazyLock < Option < & ' static str > > =
67+ LazyLock :: new ( || build:: GIT_COMMIT_HASH . map ( |s| & s[ ..8 ] ) ) ;
6768
68- pub static HOSTNAME : Lazy < String > = Lazy :: new ( || {
69+ pub static HOSTNAME : LazyLock < String > = LazyLock :: new ( || {
6970 // According to the gethostname(3p) man page,
7071 // there don't seem to be any errors possible.
7172 //
0 commit comments