diff --git a/twilight-cache-inmemory/src/permission.rs b/twilight-cache-inmemory/src/permission.rs index f9b2c2ce257..e2086398081 100644 --- a/twilight-cache-inmemory/src/permission.rs +++ b/twilight-cache-inmemory/src/permission.rs @@ -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 { diff --git a/twilight-model/src/gateway/payload/incoming/guild_create.rs b/twilight-model/src/gateway/payload/incoming/guild_create.rs index 26e757a369c..348d647a6dd 100644 --- a/twilight-model/src/gateway/payload/incoming/guild_create.rs +++ b/twilight-model/src/gateway/payload/incoming/guild_create.rs @@ -12,7 +12,7 @@ pub enum GuildCreate { } impl GuildCreate { - /// Extract guild id. + /// ID of the guild. pub const fn id(&self) -> Id { match self { GuildCreate::Available(g) => g.id, @@ -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, &[