feat: implements Display for Status
This commit is contained in:
parent
eefb4c283c
commit
462c1168c3
@ -1,7 +1,5 @@
|
|||||||
use std::collections::HashMap;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use std::{collections::HashMap, fmt::Display};
|
||||||
|
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum Action {
|
pub enum Action {
|
||||||
@ -17,7 +15,6 @@ pub enum Action {
|
|||||||
Exit,
|
Exit,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub enum Status {
|
pub enum Status {
|
||||||
Open,
|
Open,
|
||||||
@ -26,6 +23,17 @@ pub enum Status {
|
|||||||
Closed,
|
Closed,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Display for Status {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
match self {
|
||||||
|
Self::Open => write!(f, "OPEN"),
|
||||||
|
Self::InProgress => write!(f, "IN PROGRESS"),
|
||||||
|
Self::Resolved => write!(f, "RESOLVED"),
|
||||||
|
Self::Closed => write!(f, "Closed"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct Epic {
|
pub struct Epic {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
@ -40,7 +48,7 @@ impl Epic {
|
|||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
status: Status::Open,
|
status: Status::Open,
|
||||||
stories: vec![]
|
stories: vec![],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user