Simplify compositor and shell conditionals

Flatten nested guards in swipe cleanup, recording updates and popup dismissal. Use an eager optional fallback for workspace layouts and an array in the malformed-opacity test.
This commit is contained in:
Samuel Onoja committed 2026-10-04 14:43:43 +01:00
1 parent 3ba1f3522d
commit 5706a71941
5 files changed
+13 -15

No files matched your search

+2 -4
View File
@@ -159,10 +159,8 @@ impl Recorder {
match event {
Event::Update(update) => match update.state.as_str() {
"selecting" if self.control.is_some() => self.state = State::Selecting,
"recording" if self.control.is_some() => {
if !matches!(self.state, State::Recording(_)) {
self.state = State::Recording(Instant::now());
}
"recording" if self.control.is_some() && !matches!(self.state, State::Recording(_)) => {
self.state = State::Recording(Instant::now());
}
"saving" => self.state = State::Saving,
"saved" => {
@@ -153,10 +153,11 @@ impl FereseShell {
}
pub fn animate_menu(&mut self) -> Task<Message> {
if let Some(menu) = &self.menu {
if menu.motion.closing() && !menu.animating() {
return self.destroy_menu();
}
if let Some(menu) = &self.menu
&& menu.motion.closing()
&& !menu.animating()
{
return self.destroy_menu();
}
Task::none()
}