Use match instead of a couple if let branches

This commit is contained in:
Ian Douglas Scott 2025-04-07 08:20:51 -07:00
parent 874245bc2e
commit 26b773c643

View file

@ -631,26 +631,22 @@ impl Application for App {
} }
fn subscription(&self) -> Subscription<Msg> { fn subscription(&self) -> Subscription<Msg> {
let events = iced::event::listen_with(|evt, _, _| { let events = iced::event::listen_with(|evt, _, _| match evt {
if let iced::Event::PlatformSpecific(iced::event::PlatformSpecific::Wayland(evt)) = evt iced::Event::PlatformSpecific(iced::event::PlatformSpecific::Wayland(evt)) => {
{
if !matches!(evt, WaylandEvent::RequestResize) { if !matches!(evt, WaylandEvent::RequestResize) {
Some(Msg::WaylandEvent(evt)) Some(Msg::WaylandEvent(evt))
} else { } else {
None None
} }
} else if let iced::Event::Keyboard(iced::keyboard::Event::KeyReleased { }
iced::Event::Keyboard(iced::keyboard::Event::KeyReleased {
key: Key::Named(Named::Escape), key: Key::Named(Named::Escape),
modifiers: _, modifiers: _,
location: _, location: _,
modified_key: _, modified_key: _,
physical_key: _, physical_key: _,
}) = evt }) => Some(Msg::Close),
{ _ => None,
Some(Msg::Close)
} else {
None
}
}); });
let config_subscription = cosmic_config::config_subscription::<_, CosmicWorkspacesConfig>( let config_subscription = cosmic_config::config_subscription::<_, CosmicWorkspacesConfig>(
"config-sub", "config-sub",