Move valid_residents to the scheduler impl and simplify it
This commit is contained in:
@@ -77,6 +77,18 @@ impl Slot {
|
||||
self.day.greater_than(&Day(limit))
|
||||
}
|
||||
|
||||
pub fn other_position(&self) -> Self {
|
||||
let other_pos = match self.position {
|
||||
ShiftPosition::First => ShiftPosition::Second,
|
||||
ShiftPosition::Second => ShiftPosition::First,
|
||||
};
|
||||
|
||||
Self {
|
||||
day: self.day,
|
||||
position: other_pos,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn default() -> Self {
|
||||
Self {
|
||||
day: Day(1),
|
||||
|
||||
Reference in New Issue
Block a user