Skip to content

Commit d0d4110

Browse files
authored
book: Move to std::cell::OnceCell (#1470)
1 parent 2f38d3a commit d0d4110

File tree

13 files changed

+16
-20
lines changed

13 files changed

+16
-20
lines changed

book/listings/actions/7/window/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use gio::Settings;
22
use glib::subclass::InitializingObject;
33
use gtk::subclass::prelude::*;
44
use gtk::{gio, glib, Button, CompositeTemplate, Label};
5-
use once_cell::sync::OnceCell;
5+
use std::cell::OnceCell;
66

77
// ANCHOR: imp_struct
88
// Object holding the state

book/listings/saving_window_state/1/custom_window/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use gio::Settings;
22
use gtk::subclass::prelude::*;
33
use gtk::{gio, glib, ApplicationWindow};
4-
use once_cell::sync::OnceCell;
4+
use std::cell::OnceCell;
55

66
// ANCHOR: imp
77
#[derive(Default)]

book/listings/todo/2/window/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use glib::subclass::InitializingObject;
66
use gtk::prelude::*;
77
use gtk::subclass::prelude::*;
88
use gtk::{gio, glib, CompositeTemplate, Entry, ListView};
9-
use once_cell::sync::OnceCell;
9+
use std::cell::OnceCell;
1010

1111
use crate::task_object::{TaskData, TaskObject};
1212
use crate::utils::data_path;

book/listings/todo/3/window/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use glib::subclass::InitializingObject;
66
use gtk::prelude::*;
77
use gtk::subclass::prelude::*;
88
use gtk::{gio, glib, CompositeTemplate, Entry, ListView};
9-
use once_cell::sync::OnceCell;
9+
use std::cell::OnceCell;
1010

1111
use crate::task_object::{TaskData, TaskObject};
1212
use crate::utils::data_path;

book/listings/todo/4/window/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use glib::subclass::InitializingObject;
66
use gtk::prelude::*;
77
use gtk::subclass::prelude::*;
88
use gtk::{gio, glib, CompositeTemplate, Entry, ListView};
9-
use once_cell::sync::OnceCell;
9+
use std::cell::OnceCell;
1010

1111
use crate::task_object::{TaskData, TaskObject};
1212
use crate::utils::data_path;

book/listings/todo/5/window/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use glib::subclass::InitializingObject;
66
use gtk::prelude::*;
77
use gtk::subclass::prelude::*;
88
use gtk::{gio, glib, CompositeTemplate, Entry, ListView};
9-
use once_cell::sync::OnceCell;
9+
use std::cell::OnceCell;
1010

1111
use crate::task_object::{TaskData, TaskObject};
1212
use crate::utils::data_path;

book/listings/todo/6/window/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use glib::subclass::InitializingObject;
88

99
use adw::prelude::*;
1010
use gtk::{gio, glib, CompositeTemplate, Entry, ListBox};
11-
use once_cell::sync::OnceCell;
11+
use std::cell::OnceCell;
1212

1313
use crate::task_object::{TaskData, TaskObject};
1414
use crate::utils::data_path;

book/listings/todo/7/window/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use glib::subclass::InitializingObject;
88

99
use adw::prelude::*;
1010
use gtk::{gio, glib, CompositeTemplate, Entry, ListBox};
11-
use once_cell::sync::OnceCell;
11+
use std::cell::OnceCell;
1212

1313
use crate::task_object::{TaskData, TaskObject};
1414
use crate::utils::data_path;

book/listings/todo/8/collection_object/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use adw::prelude::*;
44
use adw::subclass::prelude::*;
55
use glib::Properties;
66
use gtk::{gio, glib};
7-
use once_cell::sync::OnceCell;
7+
use std::cell::OnceCell;
88

99
// ANCHOR: collection_object
1010
// Object holding the state

book/listings/todo/8/window/imp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use gtk::glib::SignalHandlerId;
1010
use gtk::{
1111
gio, glib, Button, CompositeTemplate, Entry, FilterListModel, ListBox, Stack,
1212
};
13-
use once_cell::sync::OnceCell;
13+
use std::cell::OnceCell;
1414

1515
use crate::collection_object::{CollectionData, CollectionObject};
1616
use crate::utils::data_path;

0 commit comments

Comments
 (0)