impl TryFrom<T::Type> for BitFlags<T> #14
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Misc notes:
std
flag because althoughTryFrom
doesn't have atype Error: std::error::Error
bound, it's often useful to have that impl. I'm wary of making it default though, because it still seems ideal to keep the core crateno_std
by default?default-features = false
)BitFlags<Self>
might work but that's not good enough for the orphan rules it seems.BitFlagNum
modified to includefmt::Debug
constraint because we kind of want#[derive(Debug)] struct S<T>(BitFlags<T>)
to work?BitFlags<T>
in context though... We hideBitFlagsRaw
as an internal trait despite the fact that it's required forBitFlags<T>
and thus pretty crucial for doing any generic operations over bitflags... I'm questioning whether we shouldn't re-export this publicly at the root of the crate? (if we don't want manual impls and want to still require use of the proc macro, we can still make the trait fns themselvesdoc(hidden)
)BitFlags<T>
vsT
that I'd like to address I think... Hm.