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 means that after strum 0.22 it is no longer possible to implement From<&str> for MyEnum and/or Into<MyEnum> for &str. We would want to implement those especially if we have a #[strum(default)] field which would make parsing infallible (?).
Besides reverting, another fix would be to automatically implement From/Into if parsing is infallible
The text was updated successfully, but these errors were encountered:
MingweiSamuel
changed the title
strum::EnumString deriving std::convert::TryFrom<&str> means From<&str> cannot be implementedstrum::EnumString deriving TryFrom<&str> means From<&str> cannot be implemented
Feb 26, 2023
In strum 0.23 the
EnumString
derive now implementsTryFrom<&str>
as well in #186Problem with this is that
TryFrom<&str>
is automatically derived for&str: Into<MyEnum>
: https://doc.rust-lang.org/stable/std/convert/trait.TryFrom.html#impl-TryFrom%3CU%3E-for-TThis means that after strum 0.22 it is no longer possible to implement
From<&str> for MyEnum
and/orInto<MyEnum> for &str
. We would want to implement those especially if we have a#[strum(default)]
field which would make parsing infallible (?).Besides reverting, another fix would be to automatically implement
From
/Into
if parsing is infallibleSame as #228 I imagine
The text was updated successfully, but these errors were encountered: