From 5ccfd6a0d8d1f8a77523a0f1679b8da00fa2c7b3 Mon Sep 17 00:00:00 2001 From: George Hilliard Date: Mon, 14 Dec 2020 22:40:28 -0600 Subject: [PATCH] Fix clippy lints --- src/bc_protocol.rs | 2 +- src/main.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bc_protocol.rs b/src/bc_protocol.rs index 72fb7bd..ec5e737 100644 --- a/src/bc_protocol.rs +++ b/src/bc_protocol.rs @@ -111,7 +111,7 @@ impl BcCamera { }); } - return Err(Error::Timeout); + Err(Error::Timeout) } pub fn disconnect(&mut self) { diff --git a/src/main.rs b/src/main.rs index 29e60d9..1ee8a39 100644 --- a/src/main.rs +++ b/src/main.rs @@ -242,7 +242,8 @@ fn do_camera_management( use time::OffsetDateTime; // We'd like now_local() but it's deprecated - try to get the local time, but if no // time zone, fall back to UTC. - let new_time = OffsetDateTime::try_now_local().unwrap_or(OffsetDateTime::now_utc()); + let new_time = + OffsetDateTime::try_now_local().unwrap_or_else(|_| OffsetDateTime::now_utc()); warn!( "{}: Camera has no time set, setting to {}",