diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b0f1c63..bb47d1da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Next Version - Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360) +- Add traits `PartialEq` and `Eq` to `EventListenerOptions`, and `EventListenerPhase` in `gloo-events` (#363) ### Version "0.2.3" diff --git a/crates/events/src/lib.rs b/crates/events/src/lib.rs index 5a32d329..118c28f6 100644 --- a/crates/events/src/lib.rs +++ b/crates/events/src/lib.rs @@ -28,7 +28,7 @@ use web_sys::{AddEventListenerOptions, Event, EventTarget}; /// EventListenerPhase::Bubble /// # ; /// ``` -#[derive(Default, Debug, Clone, Copy)] +#[derive(Default, Debug, Clone, Copy, PartialEq, Eq)] pub enum EventListenerPhase { #[default] #[allow(missing_docs)] @@ -91,7 +91,7 @@ impl EventListenerPhase { /// passive: false, /// }; /// ``` -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct EventListenerOptions { /// The phase that the event listener should be run in. pub phase: EventListenerPhase,