Skip to content

Commit

Permalink
Use re-exported once_cell
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui committed Jul 6, 2023
1 parent 1af865b commit 788153b
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 19 deletions.
1 change: 0 additions & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ edition = "2021"

[dependencies]
chrono = "0.4"
once_cell = "1.0"

femtovg = { version = "0.7", optional = true, default-features = false }
glium = { version = "0.32", optional = true, default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_editable/custom_tag/imp.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use glib::clone;
use glib::once_cell::sync::Lazy;
use glib::subclass::Signal;
use glib::{ParamSpec, Properties};
use gtk::glib;
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use once_cell::sync::Lazy;
use std::cell::{Cell, RefCell};

#[derive(Debug, Properties)]
Expand Down
2 changes: 1 addition & 1 deletion examples/expressions/note/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use glib::prelude::*;
use glib::subclass::prelude::*;
use gtk::glib::{self, Properties};

use once_cell::unsync::OnceCell;
use glib::once_cell::unsync::OnceCell;

use super::Metadata;

Expand Down
1 change: 0 additions & 1 deletion gtk4/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ graphene = {package = "graphene-rs", git = "https://github.com/gtk-rs/gtk-rs-cor
gsk = {package = "gsk4", path = "../gsk4", version = "0.7"}
gtk4-macros = {path = "../gtk4-macros", version = "0.7"}
libc = "0.2"
once_cell = "1.0"
pango = {git = "https://github.com/gtk-rs/gtk-rs-core", version = "0.18", features = ["v1_46"]}

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion gtk4/src/builder_rust_scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ mod tests {

#[crate::test]
fn test_rust_builder_scope_object_during_dispose() {
use glib::once_cell::sync::Lazy;
use glib::subclass::Signal;
use once_cell::sync::Lazy;
use std::{cell::Cell, rc::Rc};

#[derive(Debug, Default)]
Expand Down
3 changes: 1 addition & 2 deletions gtk4/src/functions.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Take a look at the license at the top of the repository in the LICENSE file.

use crate::{prelude::*, AboutDialog, StyleProvider, Window};
use glib::{translate::*, IntoGStr, Quark, Slice, ToValue};
use once_cell::sync::Lazy;
use glib::{once_cell::sync::Lazy, translate::*, IntoGStr, Quark, Slice, ToValue};
use std::{boxed::Box as Box_, mem, pin::Pin, ptr};

#[doc(alias = "gtk_accelerator_valid")]
Expand Down
4 changes: 2 additions & 2 deletions gtk4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ where
.unwrap_or_else(|e| std::panic::resume_unwind(e))
}

static TEST_THREAD_WORKER: once_cell::sync::Lazy<glib::ThreadPool> =
once_cell::sync::Lazy::new(|| {
static TEST_THREAD_WORKER: glib::once_cell::sync::Lazy<glib::ThreadPool> =
glib::once_cell::sync::Lazy::new(|| {
let pool = glib::ThreadPool::exclusive(1).unwrap();
pool.push(move || {
crate::init().expect("Tests failed to initialize gtk");
Expand Down
3 changes: 1 addition & 2 deletions gtk4/src/subclass/buildable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

use crate::{prelude::*, subclass::prelude::*, Buildable, Builder};
use glib::translate::*;
use glib::{GString, Object, Quark, Value};
use once_cell::sync::Lazy;
use glib::{once_cell::sync::Lazy, GString, Object, Quark, Value};

use super::PtrHolder;

Expand Down
3 changes: 1 addition & 2 deletions gtk4/src/subclass/cell_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
use crate::{
prelude::*, subclass::prelude::*, CellArea, CellLayout, CellRenderer, TreeIter, TreeModel,
};
use glib::{translate::*, Quark};
use once_cell::sync::Lazy;
use glib::{once_cell::sync::Lazy, translate::*, Quark};

#[derive(Debug)]
pub struct CellLayoutDataCallback {
Expand Down
3 changes: 1 addition & 2 deletions gtk4/src/subclass/editable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
//! Traits intended for implementing the [`Editable`](crate::Editable) interface.

use crate::{prelude::*, subclass::prelude::*, Editable};
use glib::{translate::*, GString, Quark};
use glib::{once_cell::sync::Lazy, translate::*, GString, Quark};
use libc::{c_char, c_int};
use once_cell::sync::Lazy;

pub trait EditableImpl: WidgetImpl {
fn insert_text(&self, text: &str, length: i32, position: &mut i32) {
Expand Down
3 changes: 1 addition & 2 deletions gtk4/src/subclass/entry_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
//! Traits intended for subclassing [`EntryBuffer`](crate::EntryBuffer).

use crate::{prelude::*, subclass::prelude::*, EntryBuffer};
use glib::{translate::*, GString};
use once_cell::sync::Lazy;
use glib::{once_cell::sync::Lazy, translate::*, GString};

use super::PtrHolder;

Expand Down
3 changes: 1 addition & 2 deletions gtk4/src/subclass/font_chooser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
//! Traits intended for implementing the [`FontChooser`](crate::FontChooser) interface.

use crate::{prelude::*, subclass::prelude::*, FontChooser};
use glib::{translate::*, GString, Quark};
use once_cell::sync::Lazy;
use glib::{once_cell::sync::Lazy, translate::*, GString, Quark};
use pango::{FontFace, FontFamily, FontMap};

use super::PtrHolder;
Expand Down

0 comments on commit 788153b

Please sign in to comment.