1 #[strum(to_string = “XXX”)]
use strum::ToString;
#[derive(ToString)]
pub enum ProjectName {
#[strum(to_string = "probe")]
Probe,
#[strum(to_string = "nspm")]
Nspm,
#[strum(to_string = "all")]
All,
}
#[test]
fn test2() {
let a = ProjectName::Probe;
let s = a.to_string();
println!("{}", s);
}
/*
output
probe
*/