Closed chanman3388 closed 11 months ago
The idea here was to allow the addition of the prefix attribute such that when displaying the enum variant that said variant will have the prefix. This should be exempt from other formatting. Example usage:
prefix
use strum::{Display, EnumString}; #[derive(Debug, EnumString, Display)] #[strum(prefix = "prefix")] enum Thing { Test, } fn main() { println!("{}", Thing::Test); // prints "prefixTest" }
Could possibly add some kind of skipping mechanism for individual variants.
Looks great! Merged
The idea here was to allow the addition of the
prefix
attribute such that when displaying the enum variant that said variant will have the prefix. This should be exempt from other formatting. Example usage:Could possibly add some kind of skipping mechanism for individual variants.