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<Rectangle<i32, Local>>,
|
||||
)> {
|
||||
let surface = self.fullscreen.take()?;
|
||||
if surface.ended_at.is_some() {
|
||||
self.fullscreen = Some(surface);
|
||||
return None;
|
||||
}
|
||||
let surface = self.fullscreen.take_if(|s| s.ended_at.is_none())?;
|
||||
|
||||
for focus_stack in self.focus_stack.0.values_mut() {
|
||||
focus_stack.retain(|t| t != &surface.surface);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue