Impl Default trait

This commit is contained in:
2026-01-14 21:19:14 +02:00
parent 1ce55675db
commit 70de9bcbf1
2 changed files with 7 additions and 3 deletions

View File

@@ -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,

View File

@@ -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,