Avoid unnecessarily unwrapping stack_ref() after is_stack()
In a lot of cases, matching on `stack_ref()` also works.
This commit is contained in:
parent
26ee83aaa7
commit
f765696834
4 changed files with 20 additions and 30 deletions
|
|
@ -314,8 +314,7 @@ impl CompositorHandler for State {
|
|||
.then(|| state.element())
|
||||
});
|
||||
if let Some(window) = moved_window {
|
||||
if window.is_stack() {
|
||||
let stack = window.stack_ref().unwrap();
|
||||
if let Some(stack) = window.stack_ref() {
|
||||
if let Some(i) = stack.surfaces().position(|s| {
|
||||
s.wl_surface()
|
||||
.as_deref()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue