Skip to content

Commit

Permalink
fix!(model): rename audit log event 'guildcreate' to 'guildupdate' (t…
Browse files Browse the repository at this point in the history
…wilight-rs#966)

Rename the `AuditLogEntry` variant `GuildCreate` to `GuildUpdate` due to
`GuildUpdate` being the correct name.

Docs:
<https://github.com/discord/discord-api-docs/blob/101c24dc80460e2e168ffd66551ea22eab72e796/docs/resources/Audit_Log.md#audit-log-events>

Closes twilight-rs#616.

BREAKING CHANGES: `twilight_model::guild::audit_log::AuditLogEvent`'s
`GuildCreate` variant has been renamed to `GuildUpdate`.
  • Loading branch information
zeylahellyer authored and 7596ff committed Jul 31, 2021
1 parent 2e12bcd commit 496d44c
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion model/src/guild/audit_log/event.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
use serde_repr::{Deserialize_repr, Serialize_repr};

/// Action to cause an audit log entry.
#[derive(
Clone, Copy, Debug, Deserialize_repr, Eq, Hash, PartialEq, PartialOrd, Ord, Serialize_repr,
)]
#[repr(u8)]
pub enum AuditLogEvent {
GuildCreate = 1,
/// Guild was updated.
GuildUpdate = 1,
ChannelCreate = 10,
ChannelUpdate = 11,
ChannelDelete = 12,
Expand Down Expand Up @@ -44,3 +46,25 @@ pub enum AuditLogEvent {
StageInstanceUpdate = 84,
StageInstanceDelete = 85,
}

#[cfg(test)]
mod tests {
use super::AuditLogEvent;
use serde::{Deserialize, Serialize};
use static_assertions::{assert_impl_all, const_assert_eq};
use std::{fmt::Debug, hash::Hash};

assert_impl_all!(
AuditLogEvent: Clone,
Copy,
Debug,
Deserialize<'static>,
Eq,
Hash,
PartialEq,
PartialOrd,
Ord,
Serialize
);
const_assert_eq!(1, AuditLogEvent::GuildUpdate as u8);
}

0 comments on commit 496d44c

Please sign in to comment.