1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use super::*;

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ProjectEdition {
    pub year: i32,
    pub minor: u8,
    pub patch: u8,
}

impl Default for ProjectEdition {
    fn default() -> Self {
        Self { year: 2020, minor: 0, patch: 0 }
    }
}

impl Display for ProjectEdition {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(f, "\"{}.{}.{}\"", self.year, self.minor, self.patch)
    }
}