From 739834dfecf7379dc57c541879a1bf7525aaec5f Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Fri, 31 Oct 2025 07:53:36 +0300 Subject: Simplify downcast_ref().is_some() --- src/input/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/input/mod.rs') diff --git a/src/input/mod.rs b/src/input/mod.rs index 23ea4b29..bfde9876 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -2378,7 +2378,7 @@ impl State { // Inform the layout of an ongoing DnD operation. let mut is_dnd_grab = false; pointer.with_grab(|_, grab| { - is_dnd_grab = grab.as_any().downcast_ref::>().is_some(); + is_dnd_grab = grab.as_any().is::>(); }); if is_dnd_grab { if let Some((output, pos_within_output)) = self.niri.output_under(new_pos) { @@ -2465,7 +2465,7 @@ impl State { // Inform the layout of an ongoing DnD operation. let mut is_dnd_grab = false; pointer.with_grab(|_, grab| { - is_dnd_grab = grab.as_any().downcast_ref::>().is_some(); + is_dnd_grab = grab.as_any().is::>(); }); if is_dnd_grab { if let Some((output, pos_within_output)) = self.niri.output_under(pos) { @@ -3915,7 +3915,7 @@ impl State { // Inform the layout of an ongoing DnD operation. let mut is_dnd_grab = false; handle.with_grab(|_, grab| { - is_dnd_grab = grab.as_any().downcast_ref::>().is_some(); + is_dnd_grab = grab.as_any().is::>(); }); if is_dnd_grab { if let Some((output, pos_within_output)) = self.niri.output_under(pos) { -- cgit