Use is() instead of downcast().is_some()
Browse files at this commit11633aef98fa7e7bfab42a85164377c9f4afd142Parent: 91932451 changed file +2 -3
src/handlers/xdg_shell.rsmodified+2 -3
| @@ -83,7 +83,7 @@ impl XdgShellHandler for State { | |||
| 83 | if focus.id().same_client_as(&wl_surface.id()) { | 83 | if focus.id().same_client_as(&wl_surface.id()) { |
| 84 | // Deny move requests from DnD grabs to work around | 84 | // Deny move requests from DnD grabs to work around |
| 85 | // https://gitlab.gnome.org/GNOME/gtk/-/issues/7113 | 85 | // https://gitlab.gnome.org/GNOME/gtk/-/issues/7113 |
| 86 | - let is_dnd_grab = grab.as_any().downcast_ref::<DnDGrab<Self>>().is_some(); | 86 | + let is_dnd_grab = grab.as_any().is::<DnDGrab<Self>>(); |
| 87 | 87 | ||
| 88 | if !is_dnd_grab { | 88 | if !is_dnd_grab { |
| 89 | grab_start_data = | 89 | grab_start_data = |
| @@ -103,8 +103,7 @@ impl XdgShellHandler for State { | |||
| 103 | if focus.id().same_client_as(&wl_surface.id()) { | 103 | if focus.id().same_client_as(&wl_surface.id()) { |
| 104 | // Deny move requests from DnD grabs to work around | 104 | // Deny move requests from DnD grabs to work around |
| 105 | // https://gitlab.gnome.org/GNOME/gtk/-/issues/7113 | 105 | // https://gitlab.gnome.org/GNOME/gtk/-/issues/7113 |
| 106 | - let is_dnd_grab = | 106 | + let is_dnd_grab = grab.as_any().is::<DnDGrab<Self>>(); |
| 107 | - grab.as_any().downcast_ref::<DnDGrab<Self>>().is_some(); | ||
| 108 | 107 | ||
| 109 | if !is_dnd_grab { | 108 | if !is_dnd_grab { |
| 110 | grab_start_data = | 109 | grab_start_data = |