From a8024c7e824905d6bff9723a223824e98e0101a2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 18 Mar 2021 23:48:07 +0000 Subject: [PATCH] clock: Rename Current from Running This is the user whose turn it is but we might be paused, not running. Signed-off-by: Ian Jackson --- src/clock.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/clock.rs b/src/clock.rs index 13621821..3a3ab5fe 100644 --- a/src/clock.rs +++ b/src/clock.rs @@ -79,14 +79,14 @@ struct Clock { // PieceTrait #[derive(Debug,Serialize,Deserialize)] struct State { users: [UState; 2], - #[serde(skip)] running: Option, + #[serde(skip)] current: Option, } impl State { fn new() -> Self { State { users: [UState { player: default(), remaining: TVL::zero() }; N], - running: None, + current: None, } } } @@ -104,7 +104,7 @@ struct UState { } #[derive(Debug,Serialize,Deserialize)] -struct Running { +struct Current { user: User, } @@ -150,8 +150,8 @@ impl Clock { (URS::Flag, TVL::zero()) } else { ( - if let Some(running) = &state.running { - if running.user != user { + if let Some(current) = &state.current { + if current.user != user { URS::Inactive } else if held.is_some() { URS::ActiveHeld -- 2.30.2