diff --git a/src/instant_desktop.rs b/src/instant_desktop.rs index 73cf8b3649bf0285f2c9ab5c3b65c88a185d1c87..3c9a723186d5aea819d8fa6e33d3c367052e7db4 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 409aa99d9775b193843a5f1fec6314a0224c1339..97419ad175b9c13c4a136c09fe793dfd635aff71 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"))]