Add Style::add

This commit is contained in:
Alexandre Bury 2018-01-16 22:41:22 -08:00
parent 770bc86eb2
commit d9215a2b39

View File

@ -1,4 +1,4 @@
use super::{ColorStyle, Effect};
use super::{ColorStyle, Effect, Color};
use enumset::EnumSet;
/// Combine a color and an effect.
@ -49,6 +49,11 @@ impl Style {
Style { color, effects }
}
/// Returns a combination of `self` and `other`.
pub fn add<S>(self, other: S) -> Self where S: Into<Style> {
Self::merge(&[self, other.into()])
}
}
impl From<Effect> for Style {