diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-10-31 07:53:36 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-10-31 08:05:15 +0300 |
| commit | 739834dfecf7379dc57c541879a1bf7525aaec5f (patch) | |
| tree | 8564f83a1fb804af9f4ba69654d56c4ca3d1db63 /src | |
| parent | 7c0dcddee782d2ca68620ec423d08d932ef059df (diff) | |
| download | niri-739834dfecf7379dc57c541879a1bf7525aaec5f.tar.gz niri-739834dfecf7379dc57c541879a1bf7525aaec5f.tar.bz2 niri-739834dfecf7379dc57c541879a1bf7525aaec5f.zip | |
Simplify downcast_ref().is_some()
Diffstat (limited to 'src')
| -rw-r--r-- | src/input/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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::<DnDGrab<Self>>().is_some(); + is_dnd_grab = grab.as_any().is::<DnDGrab<Self>>(); }); 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::<DnDGrab<Self>>().is_some(); + is_dnd_grab = grab.as_any().is::<DnDGrab<Self>>(); }); 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::<DnDGrab<Self>>().is_some(); + is_dnd_grab = grab.as_any().is::<DnDGrab<Self>>(); }); if is_dnd_grab { if let Some((output, pos_within_output)) = self.niri.output_under(pos) { |
