Make window::open pure again

This commit is contained in:
Héctor Ramón Jiménez 2025-07-08 00:31:04 +02:00
parent 98d8f466bb
commit 1deb87694d
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 12 additions and 19 deletions

View file

@ -42,13 +42,12 @@ enum Message {
impl Example {
fn new() -> (Self, Task<Message>) {
let (_id, open) = window::open(window::Settings::default());
(
Self {
windows: BTreeMap::new(),
},
open.map(Message::WindowOpened),
window::open(window::Settings::default())
.map(Message::WindowOpened),
)
}
@ -77,12 +76,10 @@ impl Example {
},
);
let (_id, open) = window::open(window::Settings {
window::open(window::Settings {
position,
..window::Settings::default()
});
open
})
})
.map(Message::WindowOpened)
}