caio.co/de/foca

clippy: derive Eq when deriving PartialEq

Id
57dad533c546b9c58cdee409964d20dda7d147c6
Author
Caio
Commit time
2022-10-22T12:22:00+02:00

Modified src/member.rs

@@ -13,7 +13,7
///
/// 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
/// [`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<T> {
id: T,

Modified src/payload.rs

@@ -12,7 +12,7
/// 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<T> {
/// The identity of the sender
@@ -69,7 +69,7
/// 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<T> {
/// A Ping message. Replied with `Ack`.

Modified src/runtime.rs

@@ -58,7 +58,7

/// 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<T> {
/// Foca discovered a new active member with identity T.
@@ -99,7 +99,7

/// 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<T> {
/// Pick a random active member and initiate the probe cycle.

Modified src/testing.rs

@@ -82,7 +82,7

pub struct BadCodec;

-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum BadCodecError {
BufTooSmall,
BadMessageID(u8),