From e47c3cf6bb0b3d19ed0a35c249d2d4f13c309ebd Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Tue, 3 Jan 2023 12:29:26 +0530 Subject: [PATCH] feat: implement eq and partial eq for all types --- src/comment.rs | 2 +- src/identities.rs | 2 +- src/label.rs | 2 +- src/reaction.rs | 2 +- src/repository.rs | 2 +- src/topic.rs | 2 +- src/user.rs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/comment.rs b/src/comment.rs index e995736..960646c 100644 --- a/src/comment.rs +++ b/src/comment.rs @@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize}; use crate::Reaction; /// Comments associated to an issue or a pull/merge request within the repository of a forge (Gitea, GitLab, etc.).", -#[derive(Clone, Debug, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, Serialize, Deserialize, Default, Eq, PartialEq)] pub struct Comment { /// Unique identifier of the issue or pull/merge request containing the comment pub issue_index: usize, diff --git a/src/identities.rs b/src/identities.rs index 1363561..28c4bd9 100644 --- a/src/identities.rs +++ b/src/identities.rs @@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize}; /// forge, the second element is the id in the destination forge.Pairs of identities mapping one /// forge to another. The first element is the id in the source forge, the second element is the id /// in the destination forge. -#[derive(Clone, Debug, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, Serialize, Deserialize, Default, Eq, PartialEq)] pub struct Identities { pub pairs: Vec, } diff --git a/src/label.rs b/src/label.rs index 3227b0a..612eb9a 100644 --- a/src/label.rs +++ b/src/label.rs @@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize}; /// Label associated to an issue or a comment -#[derive(Clone, Debug, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, Serialize, Deserialize, Default, Eq, PartialEq)] pub struct Label { /// Unique identifier of the label pub index: usize, diff --git a/src/reaction.rs b/src/reaction.rs index b18f483..efa2d52 100644 --- a/src/reaction.rs +++ b/src/reaction.rs @@ -18,7 +18,7 @@ use serde::{Deserialize, Serialize}; /// Reaction associated to an issue or a comment -#[derive(Clone, Debug, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, Serialize, Deserialize, Default, Eq, PartialEq)] pub struct Reaction { /// Unique identifier of the reaction pub index: usize, diff --git a/src/repository.rs b/src/repository.rs index dfde4e5..8f00370 100644 --- a/src/repository.rs +++ b/src/repository.rs @@ -18,7 +18,7 @@ use serde::{Deserialize, Serialize}; /// VCS repository relative to a project. -#[derive(Clone, Debug, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, Serialize, Deserialize, Default, Eq, PartialEq)] pub struct Repository { /// Suffix to add to the clone URL of the project to access the repository. pub name: String, diff --git a/src/topic.rs b/src/topic.rs index 3456b0d..ef84cfc 100644 --- a/src/topic.rs +++ b/src/topic.rs @@ -18,7 +18,7 @@ use serde::{Deserialize, Serialize}; /// A list of categories associated with a project. -#[derive(Clone, Debug, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, Serialize, Deserialize, Default, Eq, PartialEq)] pub struct Topic { /// Unique identifier of the topic pub index: usize, diff --git a/src/user.rs b/src/user.rs index f3cfc56..3208971 100644 --- a/src/user.rs +++ b/src/user.rs @@ -18,7 +18,7 @@ use serde::{Deserialize, Serialize}; /// A forge user -#[derive(Clone, Debug, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, Serialize, Deserialize, Default, Eq, PartialEq)] pub struct User { /// Unique identifier of the user pub index: usize,