-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
Conversation
There was a problem hiding this 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
pub const fn name(&self) -> &str { | ||
match self { | ||
Self::Guild => "Guild", | ||
Self::GroupDM => "Group DM", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this 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
There was a problem hiding this 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"); |
There was a problem hiding this comment.
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
There was a problem hiding this 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
Ref: