spec: &ChessClock,
ig: &InstanceRef) {
let state = self;
+
+ if_chain! {
+ if let Some(was_current) = was_current;
+ if let Some(now_current) = state.current;
+ if now_current != was_current;
+ then {
+ let remaining = &mut state.users[now_current.user].remaining;
+ *remaining = *remaining + TVL::seconds(spec.per_move.into());
+ }
+ }
+
if state.implies_running(held) == was_implied_running { return }
let now = now()?;
}
}
- if_chain! {
- if let Some(was_current) = was_current;
- if let Some(now_current) = state.current;
- if now_current != was_current;
- then {
- let remaining = &mut state.users[now_current.user].remaining;
- *remaining = *remaining + TVL::seconds(spec.per_move.into());
- }
- }
-
if_chain! {
if let Some(now_running_user) = state.implies_running(held);
then {