Don't use ONCE_INIT anymore now that Once::new() is const

This commit is contained in:
Sebastian Dröge 2019-07-11 16:38:24 +03:00
parent 424a87efbf
commit f63d50546a
3 changed files with 6 additions and 6 deletions

View file

@ -8,7 +8,7 @@
extern crate libc;
use std::sync::{Once, ONCE_INIT};
use std::sync::Once;
extern crate gio_sys;
extern crate glib_sys;
@ -27,7 +27,7 @@ use glib::translate::from_glib;
extern crate glib;
extern crate gio;
static GES_INIT: Once = ONCE_INIT;
static GES_INIT: Once = Once::new();
pub use glib::{
BoolError, Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value,

View file

@ -10,7 +10,7 @@
extern crate bitflags;
extern crate libc;
use std::sync::{Once, ONCE_INIT};
use std::sync::Once;
#[macro_use]
extern crate glib;
@ -20,7 +20,7 @@ extern crate gstreamer as gst;
extern crate gstreamer_pbutils_sys as gst_pbutils_sys;
extern crate gstreamer_sys as gst_sys;
static PBUTILS_INIT: Once = ONCE_INIT;
static PBUTILS_INIT: Once = Once::new();
macro_rules! assert_initialized_main_thread {
() => {

View file

@ -363,10 +363,10 @@ unsafe extern "C" fn filter_boxed_unref<T: 'static>(boxed: gpointer) {
}
unsafe extern "C" fn filter_boxed_get_type<T: StaticType + 'static>() -> glib_sys::GType {
use std::sync::{Once, ONCE_INIT};
use std::sync::Once;
static mut TYPE: glib_sys::GType = gobject_sys::G_TYPE_INVALID;
static ONCE: Once = ONCE_INIT;
static ONCE: Once = Once::new();
ONCE.call_once(|| {
let type_name = {