Skip to content

Commit 8270e05

Browse files
committed
book: Clarify function in main_event_loop
1 parent 46c96e5 commit 8270e05

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

book/listings/main_event_loop/4/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use glib::{clone, timeout_future_seconds, MainContext, Priority};
1+
use glib::{clone, MainContext, Priority};
22
use gtk::prelude::*;
33
use gtk::{glib, Application, ApplicationWindow, Button};
44

@@ -34,7 +34,7 @@ fn build_ui(app: &Application) {
3434
main_context.spawn_local(clone!(@strong sender => async move {
3535
// Deactivate the button until the operation is done
3636
sender.send(false).expect("Could not send through channel");
37-
timeout_future_seconds(5).await;
37+
glib::timeout_future_seconds(5).await;
3838
// Activate the button again
3939
sender.send(true).expect("Could not send through channel");
4040
}));

book/listings/main_event_loop/5/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use glib::{clone, timeout_future_seconds, MainContext};
1+
use glib::{clone, MainContext};
22
use gtk::prelude::*;
33
use gtk::{glib, Application, ApplicationWindow, Button};
44

@@ -33,7 +33,7 @@ fn build_ui(app: &Application) {
3333
main_context.spawn_local(clone!(@weak button => async move {
3434
// Deactivate the button until the operation is done
3535
button.set_sensitive(false);
36-
timeout_future_seconds(5).await;
36+
glib::timeout_future_seconds(5).await;
3737
// Activate the button again
3838
button.set_sensitive(true);
3939
}));

0 commit comments

Comments
 (0)