diff --git a/compositor/src/effects.rs b/compositor/src/effects.rs index 4f0a57e..90782bc 100644 --- a/compositor/src/effects.rs +++ b/compositor/src/effects.rs @@ -590,7 +590,7 @@ mod tests { assert_eq!(decode_region_opacities(&[]), Some(vec![])); assert!(decode_region_opacities(&bytes[..11]).is_none()); assert!(decode_region_opacities(&1001u32.to_ne_bytes()).is_none()); - assert!(decode_region_opacities(&vec![0; 33 * 4]).is_none()); + assert!(decode_region_opacities(&[0; 33 * 4]).is_none()); } #[test] diff --git a/compositor/src/state/animation.rs b/compositor/src/state/animation.rs index ce20d7a..421a1d6 100644 --- a/compositor/src/state/animation.rs +++ b/compositor/src/state/animation.rs @@ -160,12 +160,11 @@ impl Ferese { .focus_swipe .as_ref() .is_some_and(|swipe| !self.focus_swipe_is_current(swipe)) + && let Some(swipe) = self.focus_swipe.take() { - if let Some(swipe) = self.focus_swipe.take() { - self.presentation_dependencies - .restore_viewport(swipe.workspace, swipe.dependencies); - self.release_presentation_dependencies(); - } + self.presentation_dependencies + .restore_viewport(swipe.workspace, swipe.dependencies); + self.release_presentation_dependencies(); } let mut active_animation = false; diff --git a/compositor/src/state/presentation_dependencies.rs b/compositor/src/state/presentation_dependencies.rs index 334f471..021ca5c 100644 --- a/compositor/src/state/presentation_dependencies.rs +++ b/compositor/src/state/presentation_dependencies.rs @@ -330,7 +330,7 @@ impl Ferese { .as_ref() .filter(|swipe| swipe.workspace == workspace.id) .and_then(|swipe| swipe.layout.as_ref()) - .or_else(|| match &workspace.layout { + .or(match &workspace.layout { WorkspaceLayout::Scrolling(layout) => Some(layout), _ => None, }); diff --git a/shell/ferese-shell/src/recording.rs b/shell/ferese-shell/src/recording.rs index b197752..c28b608 100644 --- a/shell/ferese-shell/src/recording.rs +++ b/shell/ferese-shell/src/recording.rs @@ -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" => { diff --git a/shell/ferese-shell/src/status_ui/lifecycle.rs b/shell/ferese-shell/src/status_ui/lifecycle.rs index 1e8f305..32f6b7e 100644 --- a/shell/ferese-shell/src/status_ui/lifecycle.rs +++ b/shell/ferese-shell/src/status_ui/lifecycle.rs @@ -153,10 +153,11 @@ impl FereseShell { } pub fn animate_menu(&mut self) -> Task { - 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() }