diff --git a/Changelog b/Changelog index bf44600..28f3949 100644 --- a/Changelog +++ b/Changelog @@ -6,6 +6,8 @@ Version NEXT: bot. - Add 'admins' config, trusted accounts for admin tasks - Add 'rejoin' command to rejoin (leave/join) all rooms + * Added: + - Add PartialEq on hook types. Version 0.2.0: 2023-08-23 Maxime “pep” Buquet diff --git a/src/hooks/types.rs b/src/hooks/types.rs index bfe61a5..11cb374 100644 --- a/src/hooks/types.rs +++ b/src/hooks/types.rs @@ -14,13 +14,13 @@ // along with this program. If not, see . /// Defines a generic user that can be used for many purposes. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct User { /// Name of the user pub name: String, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Commit { /// Reference of the commit pub ref_: String, @@ -30,13 +30,13 @@ pub struct Commit { pub url: String, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Repository { /// Name of the project. pub name: String, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Push { /// Reference where commits have been pushed to. pub ref_: String, @@ -50,7 +50,7 @@ pub struct Push { pub pusher: User, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub enum IssueAction { Update, Open, @@ -58,7 +58,7 @@ pub enum IssueAction { Reopen, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Issue { pub action: Option, pub repository: Repository, @@ -68,13 +68,13 @@ pub struct Issue { pub url: Option, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct IssueAttrs { pub id: u64, pub title: String, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub enum MergeRequestAction { Update, Open, @@ -87,7 +87,7 @@ pub enum MergeRequestAction { Unapproval, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct MergeRequest { pub action: Option, pub repository: Repository, @@ -97,13 +97,13 @@ pub struct MergeRequest { pub url: Option, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct MergeRequestAttrs { pub id: u64, pub title: String, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Note { pub snippet: bool, pub commit: Option, @@ -114,13 +114,13 @@ pub struct Note { pub url: String, } -#[derive(Debug)] +#[derive(Debug, Clone, PartialEq)] pub enum WikiAction { Create, Update, } -#[derive(Debug)] +#[derive(Debug, Clone, PartialEq)] pub struct Wiki { pub action: WikiAction, pub repository: Repository, @@ -131,7 +131,7 @@ pub struct Wiki { /// Lowest common denominator struct so that we don't have to duplicate our code for each platform /// we support. -#[derive(Debug)] +#[derive(Debug, Clone, PartialEq)] pub enum Hook { /// Push event Push(Push),