File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ use sun_times::sun_times;
2626use toml:: Value ;
2727use toml:: value:: Offset as TomlDateTimeOffset ;
2828
29- static TZ_FINDER : LazyLock < tzf_rs:: DefaultFinder > = LazyLock :: new ( || tzf_rs:: DefaultFinder :: new ( ) ) ;
29+ static TZ_FINDER : LazyLock < tzf_rs:: DefaultFinder > = LazyLock :: new ( tzf_rs:: DefaultFinder :: new) ;
3030
3131fn default_constant_recorder ( ) -> bool {
3232 false
@@ -345,7 +345,7 @@ struct HourMin {
345345fn timezone_offset_seconds ( lat : f32 , lng : f32 ) -> i32 {
346346 let tz_from_lat_lng = TZ_FINDER . get_tz_name ( lat as f64 , lng as f64 ) ;
347347 let tz = Tz :: from_str ( tz_from_lat_lng)
348- . expect ( & format ! ( "Failed to parse timezone from lat lng {tz_from_lat_lng}" ) ) ;
348+ . unwrap_or_else ( |_| panic ! ( "Failed to parse timezone from lat lng {tz_from_lat_lng}" ) ) ;
349349 let now_utc = Local :: now ( ) . naive_utc ( ) ;
350350 let offset = tz. offset_from_utc_datetime ( & now_utc) ;
351351 offset. fix ( ) . local_minus_utc ( )
You can’t perform that action at this time.
0 commit comments