@@ -6,10 +6,10 @@ use std::iter;
6
6
use std:: path:: { Path , PathBuf } ;
7
7
use std:: process:: Command ;
8
8
use std:: str:: FromStr ;
9
+ use std:: sync:: OnceLock ;
9
10
10
11
use crate :: util:: { add_dylib_path, PathBufExt } ;
11
12
use build_helper:: git:: GitConfig ;
12
- use lazycell:: AtomicLazyCell ;
13
13
use serde:: de:: { Deserialize , Deserializer , Error as _} ;
14
14
use std:: collections:: { HashMap , HashSet } ;
15
15
use test:: { ColorConfig , OutputFormat } ;
@@ -384,7 +384,7 @@ pub struct Config {
384
384
/// Only rerun the tests that result has been modified accoring to Git status
385
385
pub only_modified : bool ,
386
386
387
- pub target_cfgs : AtomicLazyCell < TargetCfgs > ,
387
+ pub target_cfgs : OnceLock < TargetCfgs > ,
388
388
389
389
pub nocapture : bool ,
390
390
@@ -406,13 +406,7 @@ impl Config {
406
406
}
407
407
408
408
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 ) )
416
410
}
417
411
418
412
pub fn target_cfg ( & self ) -> & TargetCfg {
0 commit comments