From fe5460507b4be898b3a77aa8d97510883223ebaf Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Fri, 19 May 2023 19:06:32 +0200 Subject: [PATCH] Prefer `and_local_timezone` in `map_local` --- src/datetime/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datetime/mod.rs b/src/datetime/mod.rs index 975b28cd61..6f1c06f5a2 100644 --- a/src/datetime/mod.rs +++ b/src/datetime/mod.rs @@ -548,7 +548,7 @@ fn map_local(dt: &DateTime, mut f: F) -> Option Option, { - 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 {