Skip to content

Commit ca0a0af

Browse files
committed
Use Once::new instead of ONCE_INIT
1 parent 807429e commit ca0a0af

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/cargo/util/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::io::{self, SeekFrom};
1010
use std::mem;
1111
use std::path::{Path, PathBuf};
1212
use std::str::FromStr;
13-
use std::sync::{Once, ONCE_INIT};
13+
use std::sync::Once;
1414
use std::time::Instant;
1515
use std::vec;
1616

@@ -89,7 +89,7 @@ pub struct Config {
8989
impl Config {
9090
pub fn new(shell: Shell, cwd: PathBuf, homedir: PathBuf) -> Config {
9191
static mut GLOBAL_JOBSERVER: *mut jobserver::Client = 0 as *mut _;
92-
static INIT: Once = ONCE_INIT;
92+
static INIT: Once = Once::new();
9393

9494
// This should be called early on in the process, so in theory the
9595
// unsafety is ok here. (taken ownership of random fds)

tests/testsuite/support/cross_compile.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::env;
22
use std::process::Command;
33
use std::sync::atomic::{AtomicBool, Ordering};
4-
use std::sync::{Once, ONCE_INIT};
4+
use std::sync::Once;
55

66
use crate::support::{basic_bin_manifest, main_file, project};
77

@@ -23,7 +23,7 @@ pub fn disabled() -> bool {
2323
// try to detect that before we fail a bunch of tests through no fault
2424
// of the user.
2525
static CAN_RUN_CROSS_TESTS: AtomicBool = AtomicBool::new(false);
26-
static CHECK: Once = ONCE_INIT;
26+
static CHECK: Once = Once::new();
2727

2828
let cross_target = alternate();
2929

0 commit comments

Comments
 (0)