1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crossterm::style::ContentStyle;

use crate::Drawable;

pub trait Stylable: Drawable {
    fn styled(&self, style: ContentStyle) -> (ContentStyle, &Self);
}

impl<D> Stylable for D
where
    D: Drawable + ?Sized,
    for<'a> (ContentStyle, &'a D): Drawable,
{
    fn styled(&self, style: ContentStyle) -> (ContentStyle, &Self) {
        (style, self)
    }
}