You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am curious if you would be interested in providing a derive implementation to allow AsRef<Primitive>. I have found when attempting to use this crate with some of the standard collections can start to get complicated. It would be nice to have a way to return a &'static Primitive from any given instance of Enum. I threw together a POC of what this might look like here. If you are interested in change I can open this PR against the main branch.
Thanks for this awesome crate!
The text was updated successfully, but these errors were encountered:
Hello! Thanks for the thoughts and POC! I think implementation-wise, that looks pretty reasonable. I'm curious if you have an example or two of where you've needed this in real code - I haven't really hit such a need, and I can kind of imagine the shape of where it may be useful but not quite a full use-case.
Either way, feel free to put together a PR :)
A couple of questions on the code itself:
Should be add an explicit 'static lifetime to the returned refs?
Can you add a section to the root README.md basically duplicating the rustdoc from derive_as_ref_primitive?
I am curious if you would be interested in providing a derive implementation to allow
AsRef<Primitive>
. I have found when attempting to use this crate with some of the standard collections can start to get complicated. It would be nice to have a way to return a&'static Primitive
from any given instance ofEnum
. I threw together a POC of what this might look like here. If you are interested in change I can open this PR against the main branch.Thanks for this awesome crate!
The text was updated successfully, but these errors were encountered: