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

chore: enhance ReservedTag::to_field #309

Merged
merged 1 commit into from
Sep 24, 2024
Merged

chore: enhance ReservedTag::to_field #309

merged 1 commit into from
Sep 24, 2024

Conversation

arthurpaulino
Copy link
Member

Make it so that Tag::to_field doesn't need to skip reserved tags by pushing reserved tags to start from where tags end.

Make it so that `Tag::to_field` doesn't need to skip reserved tags
by pushing reserved tags to start from where tags end.
#[test]
fn test_strum() {
assert_eq!(14, Tag::COUNT);
assert_eq!(Tag::COUNT, Tag::iter().count());
Copy link
Member

@wwared wwared Sep 24, 2024

Choose a reason for hiding this comment

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

nit: This specific assert seems unnecessary (but we can leave it for sanity checking strum)


#[test]
fn test_strum() {
assert_eq!(2, ReservedTag::iter().count());
Copy link
Member

@wwared wwared Sep 24, 2024

Choose a reason for hiding this comment

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

nit: I feel like it would make more sense to derive EnumCount for ReservedTag and use ReservedTag::COUNT. But I can also see keeping just EnumIter since I think we would only use ReservedTag::COUNT in this particular test

@arthurpaulino arthurpaulino merged commit d2b0489 into main Sep 24, 2024
3 checks passed
@arthurpaulino arthurpaulino deleted the ap/strum branch September 24, 2024 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants