add MyFlags::Abc::iter_equal_names() method #469
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!469
Loading…
Reference in a new issue
No description provided.
Delete branch "main"
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?
Sometimes we need to retrieve the string names of the Flags values we defined, so I added the method
names.Hi @ssrlive 👋
Sorry I seem to have missed this in my inbox. I think this functionality is already covered by the
iter_namesmethod, which iterates over defined flags in a value, including both their name and their value.Thanks for the PR @ssrlive! I do believe we've already got this functionality in
iter_names, so will go ahead and close this one.Based on my testing,
iter_namesis completely unrelated to the content of my PR. My test code is provided below; the commented-out sections represent the parts that do not align with my original intent.the out put
@ssrlive I see, so you want to iterate over all named flags that are equivalent to a particular value? I worry this does have too much overlap with the existing
iter_namesmethod, which is maybe better named asiter_contained_names, and this one asiter_equal_names.I'd be open to exploring it a bit more if we can figure out how to untangle those concepts a bit.
So, how about I start by renaming the relevant parts of my PR to
iter_equal_names?I have renamed all of that.
@ssrlive It looks like I can't re-open the PR anymore, would you be happy to submit a fresh one and we can take a look?
Pull request closed