forge
Explore
Log in

Don't you dare go Hollow

Simplify downcast_ref().is_some()

Browse files at this commit

739834dfecf7379dc57c541879a1bf7525aaec5fIvan MolodetskikhParent: 7c0dcdd
src/input/mod.rsmodified+3 -3
@@ -2378,7 +2378,7 @@ impl State {
2378 // Inform the layout of an ongoing DnD operation.2378 // Inform the layout of an ongoing DnD operation.
2379 let mut is_dnd_grab = false;2379 let mut is_dnd_grab = false;
2380 pointer.with_grab(|_, grab| {2380 pointer.with_grab(|_, grab| {
2381- is_dnd_grab = grab.as_any().downcast_ref::<DnDGrab<Self>>().is_some();2381+ is_dnd_grab = grab.as_any().is::<DnDGrab<Self>>();
2382 });2382 });
2383 if is_dnd_grab {2383 if is_dnd_grab {
2384 if let Some((output, pos_within_output)) = self.niri.output_under(new_pos) {2384 if let Some((output, pos_within_output)) = self.niri.output_under(new_pos) {
@@ -2465,7 +2465,7 @@ impl State {
2465 // Inform the layout of an ongoing DnD operation.2465 // Inform the layout of an ongoing DnD operation.
2466 let mut is_dnd_grab = false;2466 let mut is_dnd_grab = false;
2467 pointer.with_grab(|_, grab| {2467 pointer.with_grab(|_, grab| {
2468- is_dnd_grab = grab.as_any().downcast_ref::<DnDGrab<Self>>().is_some();2468+ is_dnd_grab = grab.as_any().is::<DnDGrab<Self>>();
2469 });2469 });
2470 if is_dnd_grab {2470 if is_dnd_grab {
2471 if let Some((output, pos_within_output)) = self.niri.output_under(pos) {2471 if let Some((output, pos_within_output)) = self.niri.output_under(pos) {
@@ -3915,7 +3915,7 @@ impl State {
3915 // Inform the layout of an ongoing DnD operation.3915 // Inform the layout of an ongoing DnD operation.
3916 let mut is_dnd_grab = false;3916 let mut is_dnd_grab = false;
3917 handle.with_grab(|_, grab| {3917 handle.with_grab(|_, grab| {
3918- is_dnd_grab = grab.as_any().downcast_ref::<DnDGrab<Self>>().is_some();3918+ is_dnd_grab = grab.as_any().is::<DnDGrab<Self>>();
3919 });3919 });
3920 if is_dnd_grab {3920 if is_dnd_grab {
3921 if let Some((output, pos_within_output)) = self.niri.output_under(pos) {3921 if let Some((output, pos_within_output)) = self.niri.output_under(pos) {