From 8270e05fce5ff38b4aae08e9c6119d3b5493923e Mon Sep 17 00:00:00 2001 From: Julian Hofer Date: Mon, 9 Oct 2023 18:32:19 +0200 Subject: [PATCH] book: Clarify function in main_event_loop --- book/listings/main_event_loop/4/main.rs | 4 ++-- book/listings/main_event_loop/5/main.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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); }));