-
Notifications
You must be signed in to change notification settings - Fork 180
Closed
Description
This is similar to #296 , but instead of prefixing str infront, we add it behind:
use strum_macros::AsRefStr;
#[derive(AsRefStr)]
#[strum(prefix = "path/to/file/", suffix = ".asset")]
enum AssetTypes {
Filename,
}
fn main() {
println!("{}", AssetTypes::Filename.as_ref()); // prints "path/to/file/Filename.asset"
}This could be useful for using enum types for specifying file paths, among many other things.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels