Add a custom #[flag_name] attribute #483
No reviewers
Labels
No labels
bug
good first issue
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-bitflags/bitflags!483
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/flag-name"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #470
This PR introduces a
#[flag_name]attribute you can apply to flags to give them a different name. I've tried to avoid adding these kinds of attributes in the past, but there's no way to get around this one withbitflags, so we support it. It lets you write:There isn't any validation done on the
flag_namegiven, so you could pick strange names like_, ora | bora, etc. I need to add some more test coverage before this is ready.Should add some compile-fail tests for malformed
#[flag_name]s