webserver_base/templates/schema/
copyright.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use chrono::{Datelike, Utc};
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Copyright {
    pub start: String,
    pub end: String,
}

impl Copyright {
    #[must_use]
    pub fn new(start: String) -> Self {
        Self {
            start,
            end: Utc::now().year().to_string(),
        }
    }
}