diff options
author | 2024-08-12 05:12:42 +0200 | |
---|---|---|
committer | 2024-08-12 05:12:42 +0200 | |
commit | 01aa84e41afa556fd4e82ef11f2f55cf443ef1aa (patch) | |
tree | d794bc53ecd2f8405ec6128f7d730042179e1635 /runtime/src/window.rs | |
parent | 7740c35a2a0f162b04f78075afa5a8e2448a782c (diff) | |
download | iced-01aa84e41afa556fd4e82ef11f2f55cf443ef1aa.tar.gz iced-01aa84e41afa556fd4e82ef11f2f55cf443ef1aa.tar.bz2 iced-01aa84e41afa556fd4e82ef11f2f55cf443ef1aa.zip |
Make `window::close` return and introduce `Task::discard`
Diffstat (limited to '')
-rw-r--r-- | runtime/src/window.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/src/window.rs b/runtime/src/window.rs index cd27cdfe..0d280f1f 100644 --- a/runtime/src/window.rs +++ b/runtime/src/window.rs @@ -24,7 +24,7 @@ pub enum Action { Open(Id, Settings, oneshot::Sender<Id>), /// Close the window and exits the application. - Close(Id), + Close(Id, oneshot::Sender<Id>), /// Gets the [`Id`] of the oldest window. GetOldest(oneshot::Sender<Option<Id>>), @@ -230,8 +230,8 @@ pub fn open(settings: Settings) -> (Id, Task<Id>) { } /// Closes the window with `id`. -pub fn close<T>(id: Id) -> Task<T> { - task::effect(crate::Action::Window(Action::Close(id))) +pub fn close(id: Id) -> Task<Id> { + task::oneshot(|channel| crate::Action::Window(Action::Close(id, channel))) } /// Gets the window [`Id`] of the oldest window. |