Skip to content

Conversation

chanman3388
Copy link
Contributor

@chanman3388 chanman3388 commented Sep 15, 2023

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:

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.

@Peternator7 Peternator7 merged commit 216e4de into Peternator7:master Dec 28, 2023
@Peternator7
Copy link
Owner

Looks great! Merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants