@@ -6,10 +6,10 @@ use std::iter;
66use std:: path:: { Path , PathBuf } ;
77use std:: process:: Command ;
88use std:: str:: FromStr ;
9+ use std:: sync:: OnceLock ;
910
1011use crate :: util:: { add_dylib_path, PathBufExt } ;
1112use build_helper:: git:: GitConfig ;
12- use lazycell:: AtomicLazyCell ;
1313use serde:: de:: { Deserialize , Deserializer , Error as _} ;
1414use std:: collections:: { HashMap , HashSet } ;
1515use test:: { ColorConfig , OutputFormat } ;
@@ -384,7 +384,7 @@ pub struct Config {
384384 /// Only rerun the tests that result has been modified accoring to Git status
385385 pub only_modified : bool ,
386386
387- pub target_cfgs : AtomicLazyCell < TargetCfgs > ,
387+ pub target_cfgs : OnceLock < TargetCfgs > ,
388388
389389 pub nocapture : bool ,
390390
@@ -406,13 +406,7 @@ impl Config {
406406 }
407407
408408 pub fn target_cfgs ( & self ) -> & TargetCfgs {
409- match self . target_cfgs . borrow ( ) {
410- Some ( cfgs) => cfgs,
411- None => {
412- let _ = self . target_cfgs . fill ( TargetCfgs :: new ( self ) ) ;
413- self . target_cfgs . borrow ( ) . unwrap ( )
414- }
415- }
409+ self . target_cfgs . get_or_init ( || TargetCfgs :: new ( self ) )
416410 }
417411
418412 pub fn target_cfg ( & self ) -> & TargetCfg {
0 commit comments