Skip to content

Commit

Permalink
Fix deprecation warning in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SSheldon committed Jan 19, 2020
1 parent 3c43a39 commit 880c598
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/test_utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ops::{Deref, DerefMut};
use std::os::raw::c_char;
use std::sync::{Once, ONCE_INIT};
use std::sync::Once;

use crate::declare::{ClassDecl, ProtocolDecl};
use crate::runtime::{Class, Object, Protocol, Sel, self};
Expand Down Expand Up @@ -55,7 +55,7 @@ unsafe impl Encode for CustomStruct {
}

pub fn custom_class() -> &'static Class {
static REGISTER_CUSTOM_CLASS: Once = ONCE_INIT;
static REGISTER_CUSTOM_CLASS: Once = Once::new();

REGISTER_CUSTOM_CLASS.call_once(|| {
// The runtime will call this method, so it has to be implemented
Expand Down Expand Up @@ -114,7 +114,7 @@ pub fn custom_class() -> &'static Class {
}

pub fn custom_protocol() -> &'static Protocol {
static REGISTER_CUSTOM_PROTOCOL: Once = ONCE_INIT;
static REGISTER_CUSTOM_PROTOCOL: Once = Once::new();

REGISTER_CUSTOM_PROTOCOL.call_once(|| {
let mut decl = ProtocolDecl::new("CustomProtocol").unwrap();
Expand All @@ -130,7 +130,7 @@ pub fn custom_protocol() -> &'static Protocol {
}

pub fn custom_subprotocol() -> &'static Protocol {
static REGISTER_CUSTOM_SUBPROTOCOL: Once = ONCE_INIT;
static REGISTER_CUSTOM_SUBPROTOCOL: Once = Once::new();

REGISTER_CUSTOM_SUBPROTOCOL.call_once(|| {
let super_proto = custom_protocol();
Expand All @@ -150,7 +150,7 @@ pub fn custom_object() -> CustomObject {
}

pub fn custom_subclass() -> &'static Class {
static REGISTER_CUSTOM_SUBCLASS: Once = ONCE_INIT;
static REGISTER_CUSTOM_SUBCLASS: Once = Once::new();

REGISTER_CUSTOM_SUBCLASS.call_once(|| {
let superclass = custom_class();
Expand Down

0 comments on commit 880c598

Please sign in to comment.