Use match instead of a couple if let branches
This commit is contained in:
parent
874245bc2e
commit
26b773c643
1 changed files with 6 additions and 10 deletions
16
src/main.rs
16
src/main.rs
|
|
@ -631,26 +631,22 @@ impl Application for App {
|
|||
}
|
||||
|
||||
fn subscription(&self) -> Subscription<Msg> {
|
||||
let events = iced::event::listen_with(|evt, _, _| {
|
||||
if let iced::Event::PlatformSpecific(iced::event::PlatformSpecific::Wayland(evt)) = evt
|
||||
{
|
||||
let events = iced::event::listen_with(|evt, _, _| match evt {
|
||||
iced::Event::PlatformSpecific(iced::event::PlatformSpecific::Wayland(evt)) => {
|
||||
if !matches!(evt, WaylandEvent::RequestResize) {
|
||||
Some(Msg::WaylandEvent(evt))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
} else if let iced::Event::Keyboard(iced::keyboard::Event::KeyReleased {
|
||||
}
|
||||
iced::Event::Keyboard(iced::keyboard::Event::KeyReleased {
|
||||
key: Key::Named(Named::Escape),
|
||||
modifiers: _,
|
||||
location: _,
|
||||
modified_key: _,
|
||||
physical_key: _,
|
||||
}) = evt
|
||||
{
|
||||
Some(Msg::Close)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}) => Some(Msg::Close),
|
||||
_ => None,
|
||||
});
|
||||
let config_subscription = cosmic_config::config_subscription::<_, CosmicWorkspacesConfig>(
|
||||
"config-sub",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue