From eccb3d31ed80863c3c9782edda7e638755ced14c Mon Sep 17 00:00:00 2001 From: Louis Capitanchik <contact@louiscap.co> Date: Wed, 4 Jan 2023 15:31:08 +0000 Subject: [PATCH] Fix lints --- src/instant_desktop.rs | 3 ++- src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/instant_desktop.rs b/src/instant_desktop.rs index 73cf8b3..3c9a723 100644 --- a/src/instant_desktop.rs +++ b/src/instant_desktop.rs @@ -2,6 +2,7 @@ use std::fmt::{Debug, Formatter}; use std::ops::{Add, AddAssign, Sub, SubAssign}; use std::time::{Duration, Instant}; +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Copy, Clone, PartialEq, PartialOrd)] pub struct Spot { inner: Instant, @@ -39,7 +40,7 @@ impl Spot { /// Returns the amount of time elapsed from another instant to this one, /// or zero duration if that instant is later than this one. pub fn saturating_duration_since(&self, earlier: Spot) -> Duration { - self.inner.saturating_duration_since(earlier.inner).unwrap_or_default() + self.inner.saturating_duration_since(earlier.inner) } /// Returns `Some(t)` where `t` is the time `self + duration` if `t` can be represented as /// `Instant` (which means it's inside the bounds of the underlying data structure), `None` diff --git a/src/lib.rs b/src/lib.rs index 409aa99..97419ad 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,6 @@ #[cfg(not(target_family = "wasm"))] mod instant_desktop; -// #[cfg(target_family = "wasm")] +#[cfg(target_family = "wasm")] mod instant_web; #[cfg(not(target_arch = "wasm32"))] -- GitLab