use `if let Some()` over `match` with `None => ()`
Browse files at this commitb9fd0a405e1b15398c2f84e66ff5b2f47744d6bcParent: 1b44e0c1 changed file +4 -7
- src/layout/workspace.rs +4 -7
src/layout/workspace.rsmodified+4 -7
| @@ -3102,14 +3102,11 @@ impl<W: LayoutElement> Column<W> { | |||
| 3102 | } | 3102 | } |
| 3103 | 3103 | ||
| 3104 | pub fn advance_animations(&mut self, current_time: Duration) { | 3104 | pub fn advance_animations(&mut self, current_time: Duration) { |
| 3105 | - match &mut self.move_animation { | 3105 | + if let Some(anim) = &mut self.move_animation { |
| 3106 | - Some(anim) => { | 3106 | + anim.set_current_time(current_time); |
| 3107 | - anim.set_current_time(current_time); | 3107 | + if anim.is_done() { |
| 3108 | - if anim.is_done() { | 3108 | + self.move_animation = None; |
| 3109 | - self.move_animation = None; | ||
| 3110 | - } | ||
| 3111 | } | 3109 | } |
| 3112 | - None => (), | ||
| 3113 | } | 3110 | } |
| 3114 | 3111 | ||
| 3115 | for tile in &mut self.tiles { | 3112 | for tile in &mut self.tiles { |