fix: remove undefined crossterm attributes in windows builds

This commit is contained in:
Florian Dehau 2019-01-23 07:20:11 +01:00
parent a78fa73b34
commit 52a40ec99a

View File

@ -108,6 +108,7 @@ impl From<Color> for Option<crossterm::Color> {
} }
impl From<Modifier> for Option<crossterm::Attribute> { impl From<Modifier> for Option<crossterm::Attribute> {
#[cfg(unix)]
fn from(modifier: Modifier) -> Option<crossterm::Attribute> { fn from(modifier: Modifier) -> Option<crossterm::Attribute> {
match modifier { match modifier {
Modifier::Blink => Some(crossterm::Attribute::SlowBlink), Modifier::Blink => Some(crossterm::Attribute::SlowBlink),
@ -120,4 +121,13 @@ impl From<Modifier> for Option<crossterm::Attribute> {
_ => None, _ => None,
} }
} }
#[cfg(windows)]
fn from(modifier: Modifier) -> Option<crossterm::Attribute> {
match modifier {
Modifier::Bold => Some(crossterm::Attribute::Bold),
Modifier::Underline => Some(crossterm::Attribute::Underlined),
_ => None,
}
}
} }