use std::fmt::{Display, Formatter};
use strum_macros::AsRefStr;
#[derive(AsRefStr, Clone, Copy, Debug, enum_utils::FromStr, Eq, PartialEq)]
#[enumeration(case_insensitive)]
pub enum Arch {
WarboyA0,
#[enumeration(alias = "Warboy")]
WarboyB0,
Renegade,
U250,
}
impl Display for Arch {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
use Arch::*;
match self {
WarboyA0 => write!(f, "warboy-a0"),
WarboyB0 => write!(f, "warboy"),
Renegade => write!(f, "renegade"),
U250 => write!(f, "u250"),
}
}
}
#[cfg(test)]
mod tests {
use std::str::FromStr;
use super::*;
#[test]
fn test_archkind() {
assert!(Arch::from_str("Warboy").is_ok());
}
}