window: map().flatten() -> and_then()

Per clippy lints
This commit is contained in:
Christopher Davis 2022-06-29 20:09:45 -04:00
parent e8511bf5d5
commit f0973f6cf6

View file

@ -112,7 +112,7 @@ mod imp {
});
klass.install_action("win.show-toast", Some("(si)"), move |win, _, var| {
if let Some((ref toast, i)) = var.map(|v| v.get::<(String, i32)>()).flatten() {
if let Some((ref toast, i)) = var.and_then(|v| v.get::<(String, i32)>()) {
win.show_toast(toast, adw::ToastPriority::__Unknown(i));
}
});