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

This commit is contained in:
Sebastian Dröge 2019-07-11 16:41:42 +03:00
parent fbbd70950a
commit f149f8f1b5
15 changed files with 30 additions and 30 deletions

View file

@ -14,8 +14,8 @@ use std::path::PathBuf;
use gstcdg;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -21,8 +21,8 @@ extern crate pretty_assertions;
use glib::prelude::*;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -24,8 +24,8 @@ use rand::{Rng, SeedableRng};
use std::path::PathBuf;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -20,8 +20,8 @@
extern crate pretty_assertions;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -25,8 +25,8 @@ use rand::{Rng, SeedableRng};
use std::collections::VecDeque;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -15,8 +15,8 @@ extern crate gstreamer_video as gst_video;
extern crate gstrav1e;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -12,8 +12,8 @@ use gstreamer as gst;
use std::sync::mpsc;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -54,8 +54,8 @@ lazy_static! {
}
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -55,8 +55,8 @@ lazy_static! {
}
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -24,8 +24,8 @@ extern crate gstreamer_check as gst_check;
extern crate gstthreadshare;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -28,8 +28,8 @@ use std::sync::{Arc, Mutex};
extern crate gstthreadshare;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -28,8 +28,8 @@ use std::sync::{Arc, Mutex};
extern crate gstthreadshare;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -31,8 +31,8 @@ use std::{thread, time};
extern crate gstthreadshare;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -28,8 +28,8 @@ use std::thread;
extern crate gstthreadshare;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();

View file

@ -30,8 +30,8 @@ use std::thread;
extern crate gsttogglerecord;
fn init() {
use std::sync::{Once, ONCE_INIT};
static INIT: Once = ONCE_INIT;
use std::sync::Once;
static INIT: Once = Once::new();
INIT.call_once(|| {
gst::init().unwrap();