Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tokio-signal/src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub use libc;
use std::io::{self, Error, ErrorKind, Write};
use std::pin::Pin;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Once, ONCE_INIT};
use std::sync::Once;

use crate::IoFuture;
use futures_core::stream::Stream;
Expand Down Expand Up @@ -96,7 +96,7 @@ impl Default for SignalInfo {
fn default() -> SignalInfo {
SignalInfo {
event_info: Default::default(),
init: ONCE_INIT,
init: Once::new(),
initialized: AtomicBool::new(false),
}
}
Expand Down
4 changes: 2 additions & 2 deletions tokio-signal/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::convert::TryFrom;
use std::future::Future;
use std::io;
use std::pin::Pin;
use std::sync::{Once, ONCE_INIT};
use std::sync::Once;
use std::task::{Context, Poll};

use futures_core::stream::Stream;
Expand Down Expand Up @@ -73,7 +73,7 @@ impl Init for OsExtraData {
}
}

static INIT: Once = ONCE_INIT;
static INIT: Once = Once::new();

/// Stream of events discovered via `SetConsoleCtrlHandler`.
///
Expand Down
14 changes: 7 additions & 7 deletions tokio-tls/tests/smoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct Keys {

#[allow(dead_code)]
fn openssl_keys() -> &'static Keys {
static INIT: Once = ONCE_INIT;
static INIT: Once = Once::new();
static mut KEYS: *mut Keys = 0 as *mut _;

INIT.call_once(|| {
Expand Down Expand Up @@ -130,7 +130,7 @@ cfg_if! {
use std::env;
use std::fs::File;
use std::process::Command;
use std::sync::{ONCE_INIT, Once};
use std::sync::Once;

use untrusted::Input;
use webpki::trust_anchor_util;
Expand Down Expand Up @@ -159,7 +159,7 @@ cfg_if! {
// Right now I don't know of a way to programmatically create a
// self-signed certificate, so we just fork out to the `openssl` binary.
fn keys() -> (&'static [u8], &'static [u8]) {
static INIT: Once = ONCE_INIT;
static INIT: Once = Once::new();
static mut KEYS: *mut (Vec<u8>, Vec<u8>) = 0 as *mut _;

INIT.call_once(|| {
Expand Down Expand Up @@ -226,7 +226,7 @@ cfg_if! {
not(target_os = "ios"))))] {
use std::fs::File;
use std::env;
use std::sync::{Once, ONCE_INIT};
use std::sync::Once;

fn contexts() -> (tokio_tls::TlsAcceptor, tokio_tls::TlsConnector) {
let keys = openssl_keys();
Expand All @@ -244,7 +244,7 @@ cfg_if! {
} else if #[cfg(any(target_os = "macos", target_os = "ios"))] {
use std::env;
use std::fs::File;
use std::sync::{Once, ONCE_INIT};
use std::sync::Once;

fn contexts() -> (tokio_tls::TlsAcceptor, tokio_tls::TlsConnector) {
let keys = openssl_keys();
Expand All @@ -267,7 +267,7 @@ cfg_if! {
use std::io::Error;
use std::mem;
use std::ptr;
use std::sync::{Once, ONCE_INIT};
use std::sync::Once;

use schannel::cert_context::CertContext;
use schannel::cert_store::{CertStore, CertAdd, Memory};
Expand Down Expand Up @@ -312,7 +312,7 @@ cfg_if! {
// for a small period of time (e.g. 1 day).

fn localhost_cert() -> CertContext {
static INIT: Once = ONCE_INIT;
static INIT: Once = Once::new();
INIT.call_once(|| {
for cert in local_root_store().certs() {
let name = match cert.friendly_name() {
Expand Down