diff --git a/book/listings/main_event_loop/4/main.rs b/book/listings/main_event_loop/4/main.rs index bcf271c6f2ba..8530571bca2c 100644 --- a/book/listings/main_event_loop/4/main.rs +++ b/book/listings/main_event_loop/4/main.rs @@ -1,4 +1,4 @@ -use glib::{clone, timeout_future_seconds, MainContext, Priority}; +use glib::{clone, MainContext, Priority}; use gtk::prelude::*; use gtk::{glib, Application, ApplicationWindow, Button}; @@ -34,7 +34,7 @@ fn build_ui(app: &Application) { main_context.spawn_local(clone!(@strong sender => async move { // Deactivate the button until the operation is done sender.send(false).expect("Could not send through channel"); - timeout_future_seconds(5).await; + glib::timeout_future_seconds(5).await; // Activate the button again sender.send(true).expect("Could not send through channel"); })); diff --git a/book/listings/main_event_loop/5/main.rs b/book/listings/main_event_loop/5/main.rs index 5d4ab55ba529..2081e595c5c6 100644 --- a/book/listings/main_event_loop/5/main.rs +++ b/book/listings/main_event_loop/5/main.rs @@ -1,4 +1,4 @@ -use glib::{clone, timeout_future_seconds, MainContext}; +use glib::{clone, MainContext}; use gtk::prelude::*; use gtk::{glib, Application, ApplicationWindow, Button}; @@ -33,7 +33,7 @@ fn build_ui(app: &Application) { main_context.spawn_local(clone!(@weak button => async move { // Deactivate the button until the operation is done button.set_sensitive(false); - timeout_future_seconds(5).await; + glib::timeout_future_seconds(5).await; // Activate the button again button.set_sensitive(true); }));