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
Maybe this isn't supposed to work, but the changelist kind of implies it should:
use strum_macros::{Display,EnumString};#[derive(Debug,PartialEq,EnumString,Display)]#[strum(prefix = "colour/")]enumColor{#[strum(to_string = "RedRed")]Red,}fnmain(){assert_eq!(String::from("colour/RedRed"),(Color::Red).to_string());// worksassert_eq!(Color::try_from("colour/Red"),Ok(Color::Red));// this failsassert_eq!(Color::try_from("colour/RedRed"),Ok(Color::Red));// this fails}
The text was updated successfully, but these errors were encountered:
Flipping through the code, this is definitely not implemented for TryFrom/FromStr 😟. Must've been an oversight back then. I think fixing it for consistency is reasonable, but it is a breaking change so I'll probably be strategic about when it merges.
Maybe this isn't supposed to work, but the changelist kind of implies it should:
The text was updated successfully, but these errors were encountered: