diff options
Diffstat (limited to 'src/status.rs')
-rw-r--r-- | src/status.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/status.rs b/src/status.rs index 9075377..811d1ca 100644 --- a/src/status.rs +++ b/src/status.rs @@ -1,3 +1,5 @@ +use serde::Deserialize; + /// Represent the status of a step in a roadmap. /// /// The unknown status allows the user to not specify the status, and @@ -5,7 +7,8 @@ /// example, a step is inferred to be blocked if any of it /// dependencies are not finished. -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize)] +#[serde(rename_all = "lowercase")] pub enum Status { Unknown, Goal, @@ -15,6 +18,12 @@ pub enum Status { Blocked, } +impl Default for Status { + fn default() -> Self { + Self::Unknown + } +} + impl Status { pub fn from_text(text: &str) -> Option<Status> { match text { |