tasks: ui: simplify matches

This commit is contained in:
2026-03-14 23:51:49 +01:00
parent bf2d1c6077
commit 3a4ce6344e

View File

@@ -128,12 +128,9 @@ impl<S: Debug + Surface<Uniforms = Uniforms, CoordinateSpace = SegmentSpace, Pix
pub async fn on_event(&mut self, event: Prediction) {
match event {
Prediction::SetPersonality(personality) => match personality {
Personality::Active => self.apply_scene(Scene::Ready).await,
Personality::Parked => self.apply_scene(Scene::Idle).await,
Personality::Waking => self.show().await,
_ => ()
},
Prediction::SetPersonality(Personality::Active) => self.apply_scene(Scene::Ready).await,
Prediction::SetPersonality(Personality::Parked) => self.apply_scene(Scene::Idle).await,
Prediction::SetPersonality(Personality::Waking) => self.show().await,
Prediction::Motion { prev: _, next: MotionState::Accelerating } => self.apply_scene(Scene::Accelerating).await,
Prediction::Motion { prev: _, next: MotionState::Decelerating } => self.apply_scene(Scene::Decelerating).await,
Prediction::Motion { prev: _, next: MotionState::Steady } => self.apply_scene(Scene::Ready).await,