Impl Default trait
This commit is contained in:
@@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
resident::{Resident, ResidentDTO},
|
resident::{Resident, ResidentDTO},
|
||||||
slot::Day
|
slot::Day,
|
||||||
};
|
};
|
||||||
|
|
||||||
const YEAR: i32 = 2026;
|
const YEAR: i32 = 2026;
|
||||||
@@ -78,8 +78,10 @@ impl UserConfig {
|
|||||||
day.is_weekend(self.month.number_from_month(), self.year)
|
day.is_weekend(self.month.number_from_month(), self.year)
|
||||||
|| self.holidays.contains(&(day.0 as usize))
|
|| self.holidays.contains(&(day.0 as usize))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn default() -> Self {
|
impl Default for UserConfig {
|
||||||
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
month: Month::try_from(2).unwrap(),
|
month: Month::try_from(2).unwrap(),
|
||||||
year: YEAR,
|
year: YEAR,
|
||||||
|
|||||||
@@ -88,8 +88,10 @@ impl Slot {
|
|||||||
position: other_pos,
|
position: other_pos,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn default() -> Self {
|
impl Default for Slot {
|
||||||
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
day: Day(1),
|
day: Day(1),
|
||||||
position: ShiftPosition::First,
|
position: ShiftPosition::First,
|
||||||
|
|||||||
Reference in New Issue
Block a user