From 8b45d620d048c33febbead4480d9ef62f196c9e1 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 12 Aug 2024 05:50:22 +0200 Subject: Revert `window::close` producing a `window::Id` Instead, subscribing to `window::close_events` is preferable; since most use cases will want to react to the user closing a window as well. --- examples/events/src/main.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'examples/events/src/main.rs') diff --git a/examples/events/src/main.rs b/examples/events/src/main.rs index e432eb14..5bada9b5 100644 --- a/examples/events/src/main.rs +++ b/examples/events/src/main.rs @@ -37,7 +37,7 @@ impl Events { } Message::EventOccurred(event) => { if let Event::Window(window::Event::CloseRequested) = event { - window::get_latest().and_then(window::close).discard() + window::get_latest().and_then(window::close) } else { Task::none() } @@ -47,9 +47,7 @@ impl Events { Task::none() } - Message::Exit => { - window::get_latest().and_then(window::close).discard() - } + Message::Exit => window::get_latest().and_then(window::close), } } -- cgit