Skip to content

Commit 58b0275

Browse files
committed
Once:new() is const-stable since Rust 1.24
... so stop using `ONCE_INIT` which is deprecated in 1.37.
1 parent 83b67e2 commit 58b0275

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rayon-core/src/registry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::ptr;
1919
#[allow(deprecated)]
2020
use std::sync::atomic::ATOMIC_USIZE_INIT;
2121
use std::sync::atomic::{AtomicUsize, Ordering};
22-
use std::sync::{Arc, Once, ONCE_INIT};
22+
use std::sync::{Arc, Once};
2323
use std::thread;
2424
use std::usize;
2525
use unwind;
@@ -161,7 +161,7 @@ pub(super) struct Registry {
161161
/// Initialization
162162
163163
static mut THE_REGISTRY: Option<&'static Arc<Registry>> = None;
164-
static THE_REGISTRY_SET: Once = ONCE_INIT;
164+
static THE_REGISTRY_SET: Once = Once::new();
165165

166166
/// Starts the worker threads (if that has not already happened). If
167167
/// initialization has not already occurred, use the default

0 commit comments

Comments
 (0)