Skip to content

Commit 92c25e7

Browse files
committed
- Clippy linting
1 parent 8644931 commit 92c25e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/device_config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use sun_times::sun_times;
2626
use toml::Value;
2727
use 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

3131
fn default_constant_recorder() -> bool {
3232
false
@@ -345,7 +345,7 @@ struct HourMin {
345345
fn 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()

0 commit comments

Comments
 (0)