tasks: ui: simplify matches
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user