From 57dad533c546b9c58cdee409964d20dda7d147c6 Mon Sep 17 00:00:00 2001 From: Caio Date: Sat, 22 Oct 2022 12:22:00 +0200 Subject: [PATCH] clippy: derive Eq when deriving PartialEq --- src/member.rs | 4 ++-- src/payload.rs | 4 ++-- src/runtime.rs | 4 ++-- src/testing.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/member.rs b/src/member.rs index 495b055..166f6ef 100644 --- a/src/member.rs +++ b/src/member.rs @@ -13,7 +13,7 @@ use rand::{ /// /// This is part of the Suspicion Mechanism described in section 4.2 of the /// original SWIM paper. -#[derive(Debug, PartialEq, Clone, Copy)] +#[derive(Debug, PartialEq, Eq, Clone, Copy)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum State { /// Member is active. @@ -43,7 +43,7 @@ pub type Incarnation = u16; /// [`crate::Identity`]. An individual cluster update is simply a /// serialized Member which other Foca instances receive and use to /// update their own cluster state representation. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Member { id: T, diff --git a/src/payload.rs b/src/payload.rs index a884c83..a4f4539 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -12,7 +12,7 @@ use crate::Incarnation; /// expected; /// - A sequence of said `u16` updates (`foca::Member`); /// - And finally a tail of custom broadcasts, if at all used. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Header { /// The identity of the sender @@ -69,7 +69,7 @@ pub struct Header { /// to one or more identities. If a recipient decides to accept it, /// it replies with a `Feed` message, containing other active cluster /// members. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Message { /// A Ping message. Replied with `Ack`. diff --git a/src/runtime.rs b/src/runtime.rs index 0dbb1cc..e4e6c49 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -58,7 +58,7 @@ where /// A Notification contains information about high-level relevant /// state changes in the cluster or Foca itself. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Notification { /// Foca discovered a new active member with identity T. @@ -99,7 +99,7 @@ pub enum Notification { /// Timer is an event that's scheduled by a [`Runtime`]. You won't need /// to construct or understand these, just ensure a timely delivery. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Timer { /// Pick a random active member and initiate the probe cycle. diff --git a/src/testing.rs b/src/testing.rs index d37af5a..092cbba 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -82,7 +82,7 @@ impl Identity for ID { pub struct BadCodec; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum BadCodecError { BufTooSmall, BadMessageID(u8),