use enumset::EnumSetType;
use std::str::FromStr;
#[allow(clippy::derive_hash_xor_eq)] #[derive(EnumSetType, Debug, Hash)]
pub enum Effect {
Simple,
Reverse,
Dim,
Bold,
Italic,
Strikethrough,
Underline,
Blink,
}
impl FromStr for Effect {
type Err = super::NoSuchColor;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(match s {
"Simple" | "simple" => Effect::Simple,
"Reverse" | "reverse" => Effect::Reverse,
"Dim" | "dim" => Effect::Dim,
"Bold" | "bold" => Effect::Bold,
"Italic" | "italic" => Effect::Italic,
"Strikethrough" | "strikethrough" => Effect::Strikethrough,
"Underline" | "underline" => Effect::Underline,
"Blink" | "blink" => Effect::Blink,
_ => return Err(super::NoSuchColor),
})
}
}