Skip to content

Commit

Permalink
reverse rebase mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-dupre committed Feb 3, 2025
1 parent b40f97c commit 89dc9a1
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions opening-hours/src/filter/date_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,12 @@ impl DateFilter for ds::MonthdayRange {

fn on_year(date: ds::Date, for_year: i32) -> Option<NaiveDate> {
match date {
ds::Date::Fixed { year, month, day } => {
if year.is_some() && i32::from(year.unwrap()) != for_year {
return None;
}

Some(first_valid_ymd(
year.map(Into::into).unwrap_or(for_year),
month.into(),
day.into(),
))
}
ds::Date::Easter { year } => {
if year.is_some() && i32::from(year.unwrap()) != for_year {
return None;
}

easter(year.map(Into::into).unwrap_or(for_year))
}
ds::Date::Easter { year } => easter(year.map(Into::into).unwrap_or(for_year)),
ds::Date::Fixed { year, month, day } => Some(first_valid_ymd(
year.map(Into::into).unwrap_or(for_year),
month.into(),
day.into(),
)),
}
}

Expand Down

0 comments on commit 89dc9a1

Please sign in to comment.