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

Merged
merged 3 commits into from
Oct 19, 2024
Merged

feat(model): add invite type #2346

merged 3 commits into from
Oct 19, 2024

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

@Erk- Erk- requested a review from laralove143 October 8, 2024 14:53
@github-actions github-actions bot added the c-http Affects the http crate label Oct 8, 2024
@suneettipirneni suneettipirneni enabled auto-merge (squash) October 8, 2024 14:55
@suneettipirneni suneettipirneni merged commit 6e0e2a5 into main Oct 19, 2024
9 checks passed
@suneettipirneni suneettipirneni deleted the feat/invite-type branch October 19, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-http Affects the http crate 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