Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(model): add invite type #2346

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

feat(model): add invite type #2346

wants to merge 2 commits into from

Conversation

suneettipirneni
Copy link
Member

@suneettipirneni suneettipirneni self-assigned this May 15, 2024
@suneettipirneni suneettipirneni requested a review from a team May 15, 2024 19:06
@github-actions github-actions bot added c-model Affects the model crate t-feature Addition of a new feature labels May 15, 2024
Copy link
Member

@laralove143 laralove143 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the great addition, i just have some suggestions

twilight-model/src/guild/invite/invite_type.rs Outdated Show resolved Hide resolved
pub const fn name(&self) -> &str {
match self {
Self::Guild => "Guild",
Self::GroupDM => "Group DM",
Copy link
Member

@laralove143 laralove143 May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in other similar types we follow the name of the variant itself so it'd be GroupDm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the reason you used Group instead of GroupDm

Copy link
Member

@laralove143 laralove143 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the repeated review, added another request

twilight-model/src/guild/invite/invite_type.rs Outdated Show resolved Hide resolved
Copy link
Member

@laralove143 laralove143 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requested small change in tests

serde_test::assert_tokens(&InviteType::Friend, &[Token::U8(2)]);
serde_test::assert_tokens(&InviteType::Unknown(99), &[Token::U8(99)]);
}

#[test]
fn names() {
assert_eq!(InviteType::Guild.name(), "Guild");
assert_eq!(InviteType::GroupDM.name(), "Group DM");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test doesnt seem to be updated according to the changes on name function

@suneettipirneni suneettipirneni requested a review from a team June 15, 2024 16:03
Copy link
Member

@AEnterprise AEnterprise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good but still has a failing test that needs updating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-model Affects the model crate t-feature Addition of a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants