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
|
|
@ -713,8 +713,7 @@ impl Workspace {
|
|||
}
|
||||
|
||||
let mapped = self.element_for_surface(surface)?;
|
||||
let maybe_stack = mapped.stack_ref().filter(|s| s.len() > 1);
|
||||
if let Some(stack) = maybe_stack
|
||||
if let Some(stack) = mapped.stack_ref()
|
||||
&& stack.len() > 1
|
||||
{
|
||||
let idx = stack.surfaces().position(|s| &s == surface);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue