Skip to content

Commit

Permalink
resolved comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Erk- committed Apr 1, 2024
1 parent 48b1f66 commit a5c2202
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion twilight-cache-inmemory/src/permission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ mod tests {
everyone_permissions,
)]);

cache.update(&GuildCreate::Availableg(guild));
cache.update(&GuildCreate::Available(guild));
let mut member = test::member(USER_ID);
member.communication_disabled_until = Some(in_future);
cache.update(&MemberAdd {
Expand Down
9 changes: 3 additions & 6 deletions twilight-model/src/gateway/payload/incoming/guild_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub enum GuildCreate {
}

impl GuildCreate {
/// Extract guild id.
/// ID of the guild.
pub const fn id(&self) -> Id<GuildMarker> {
match self {
GuildCreate::Available(g) => g.id,
Expand All @@ -36,11 +36,8 @@ mod tests {
unavailable: true,
});

// Note: This looks a bit strange because it does not use
// Token::TupleVariant, this is because it will
// serialize back into a struct, and thus make it
// fails. This also tests that the enum is transparent
// for serde.
// Note: serde(untagged) makes the enum transparent which is
// the reason we don't use the variant here.
serde_test::assert_tokens(
&expected,
&[
Expand Down

0 comments on commit a5c2202

Please sign in to comment.