hooks::types: Implement PartialEq on hooks
Signed-off-by: pep <pep@bouah.net>
This commit is contained in:
parent
c3eee99d2a
commit
1ad82dfeac
2 changed files with 16 additions and 14 deletions
|
|
@ -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 <pep@bouah.net>
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@
|
|||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
/// 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<IssueAction>,
|
||||
pub repository: Repository,
|
||||
|
|
@ -68,13 +68,13 @@ pub struct Issue {
|
|||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
#[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<MergeRequestAction>,
|
||||
pub repository: Repository,
|
||||
|
|
@ -97,13 +97,13 @@ pub struct MergeRequest {
|
|||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
#[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<Commit>,
|
||||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue