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
This is probably doable. Our MSRV is 1.31 and TryFrom wasn't stablized until 1.34, but I believe there are some workarounds with cfg attrs to only include features for specific versions.
The implementation is simple enough, I have coded up something here: dspicher@d5e16d4
However, the requirement to make this work with Rust 1.31 (or rather 1.32 as is stated in the current strum README) is more difficult. cfg_version is still unstable. There is the rustversioncrate one could use. However, this would force all users of EnumString to take this crate up in their dependencies once the macro is expanded. Or is there any way I don't know of to circumvent this? EDIT: Solved by inlining rustversion usage into the strum crate by annotating local methods. Thx @toxeus for the hint.
The
EnumString
macro providesstd::str::FromStr
.I wonder whether it would be possible to also provide an implementation of the nearly equivalent
std::convert::TryFrom<&str>
?The text was updated successfully, but these errors were encountered: