aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-10-31 07:53:36 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-10-31 08:05:15 +0300
commit739834dfecf7379dc57c541879a1bf7525aaec5f (patch)
tree8564f83a1fb804af9f4ba69654d56c4ca3d1db63 /src
parent7c0dcddee782d2ca68620ec423d08d932ef059df (diff)
downloadniri-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.rs6
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) {