shell: Simplify early return with take_if
This commit is contained in:
parent
90ce9cab90
commit
07d584dadd
1 changed files with 1 additions and 5 deletions
|
|
@ -1242,11 +1242,7 @@ impl Workspace {
|
||||||
Option<FullscreenRestoreState>,
|
Option<FullscreenRestoreState>,
|
||||||
Option<Rectangle<i32, Local>>,
|
Option<Rectangle<i32, Local>>,
|
||||||
)> {
|
)> {
|
||||||
let surface = self.fullscreen.take()?;
|
let surface = self.fullscreen.take_if(|s| s.ended_at.is_none())?;
|
||||||
if surface.ended_at.is_some() {
|
|
||||||
self.fullscreen = Some(surface);
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
|
|
||||||
for focus_stack in self.focus_stack.0.values_mut() {
|
for focus_stack in self.focus_stack.0.values_mut() {
|
||||||
focus_stack.retain(|t| t != &surface.surface);
|
focus_stack.retain(|t| t != &surface.surface);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue