Skip to content

Commit 788153b

Browse files
Use re-exported once_cell
1 parent 1af865b commit 788153b

File tree

12 files changed

+11
-19
lines changed

12 files changed

+11
-19
lines changed

examples/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ edition = "2021"
66

77
[dependencies]
88
chrono = "0.4"
9-
once_cell = "1.0"
109

1110
femtovg = { version = "0.7", optional = true, default-features = false }
1211
glium = { version = "0.32", optional = true, default-features = false }

examples/custom_editable/custom_tag/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use glib::clone;
2+
use glib::once_cell::sync::Lazy;
23
use glib::subclass::Signal;
34
use glib::{ParamSpec, Properties};
45
use gtk::glib;
56
use gtk::prelude::*;
67
use gtk::subclass::prelude::*;
7-
use once_cell::sync::Lazy;
88
use std::cell::{Cell, RefCell};
99

1010
#[derive(Debug, Properties)]

examples/expressions/note/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use glib::prelude::*;
22
use glib::subclass::prelude::*;
33
use gtk::glib::{self, Properties};
44

5-
use once_cell::unsync::OnceCell;
5+
use glib::once_cell::unsync::OnceCell;
66

77
use super::Metadata;
88

gtk4/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ graphene = {package = "graphene-rs", git = "https://github.com/gtk-rs/gtk-rs-cor
5151
gsk = {package = "gsk4", path = "../gsk4", version = "0.7"}
5252
gtk4-macros = {path = "../gtk4-macros", version = "0.7"}
5353
libc = "0.2"
54-
once_cell = "1.0"
5554
pango = {git = "https://github.com/gtk-rs/gtk-rs-core", version = "0.18", features = ["v1_46"]}
5655

5756
[dev-dependencies]

gtk4/src/builder_rust_scope.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ mod tests {
301301

302302
#[crate::test]
303303
fn test_rust_builder_scope_object_during_dispose() {
304+
use glib::once_cell::sync::Lazy;
304305
use glib::subclass::Signal;
305-
use once_cell::sync::Lazy;
306306
use std::{cell::Cell, rc::Rc};
307307

308308
#[derive(Debug, Default)]

gtk4/src/functions.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

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

87
#[doc(alias = "gtk_accelerator_valid")]

gtk4/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ where
7878
.unwrap_or_else(|e| std::panic::resume_unwind(e))
7979
}
8080

81-
static TEST_THREAD_WORKER: once_cell::sync::Lazy<glib::ThreadPool> =
82-
once_cell::sync::Lazy::new(|| {
81+
static TEST_THREAD_WORKER: glib::once_cell::sync::Lazy<glib::ThreadPool> =
82+
glib::once_cell::sync::Lazy::new(|| {
8383
let pool = glib::ThreadPool::exclusive(1).unwrap();
8484
pool.push(move || {
8585
crate::init().expect("Tests failed to initialize gtk");

gtk4/src/subclass/buildable.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
66
use crate::{prelude::*, subclass::prelude::*, Buildable, Builder};
77
use glib::translate::*;
8-
use glib::{GString, Object, Quark, Value};
9-
use once_cell::sync::Lazy;
8+
use glib::{once_cell::sync::Lazy, GString, Object, Quark, Value};
109

1110
use super::PtrHolder;
1211

gtk4/src/subclass/cell_layout.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
use crate::{
77
prelude::*, subclass::prelude::*, CellArea, CellLayout, CellRenderer, TreeIter, TreeModel,
88
};
9-
use glib::{translate::*, Quark};
10-
use once_cell::sync::Lazy;
9+
use glib::{once_cell::sync::Lazy, translate::*, Quark};
1110

1211
#[derive(Debug)]
1312
pub struct CellLayoutDataCallback {

gtk4/src/subclass/editable.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
//! Traits intended for implementing the [`Editable`](crate::Editable) interface.
55
66
use crate::{prelude::*, subclass::prelude::*, Editable};
7-
use glib::{translate::*, GString, Quark};
7+
use glib::{once_cell::sync::Lazy, translate::*, GString, Quark};
88
use libc::{c_char, c_int};
9-
use once_cell::sync::Lazy;
109

1110
pub trait EditableImpl: WidgetImpl {
1211
fn insert_text(&self, text: &str, length: i32, position: &mut i32) {

0 commit comments

Comments
 (0)