Skip to content

Commit

Permalink
Prefer and_local_timezone in map_local
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed May 23, 2023
1 parent 7ba72e1 commit fe54605
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ fn map_local<Tz: TimeZone, F>(dt: &DateTime<Tz>, mut f: F) -> Option<DateTime<Tz
where
F: FnMut(NaiveDateTime) -> Option<NaiveDateTime>,
{
f(dt.naive_local()).and_then(|datetime| dt.timezone().from_local_datetime(&datetime).single())
f(dt.naive_local()).and_then(|datetime| datetime.and_local_timezone(dt.timezone()).single())
}

impl DateTime<FixedOffset> {
Expand Down

0 comments on commit fe54605

Please sign in to comment.