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 would prefer to stick with just the associated function for now, with the TryFrom impl being handwritten if the author wants one. This crate is <100 lines though, so it would be easy to fork into a library that produces TryFrom.
There's also some talk of putting a TryFrom derive in the standard library for this use case: rust-lang/rfcs#2783.
Subscribed to that issue. I just wanted to have a C-like enum that can deref to an integer and same way to use .try_into() for going backwards.
Boilerplate I had before was quote long and this library was the closest thing I found except it is missing actual deref and TryInto/TryFrom support, so code is still not as nice as it could have been.
::n()
method is useful, but it would be even nicer to have standard implementation forTryInto
trait in addition or instead of it.The text was updated successfully, but these errors were encountered: