use compact_str::CompactString;
use crate::style::Style;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Cell {
pub symbol: CompactString,
pub style: Style,
}
impl Default for Cell {
fn default() -> Self {
Self {
symbol: CompactString::const_new(" "),
style: Style::default(),
}
}
}
impl Cell {
pub fn new(symbol: impl Into<CompactString>) -> Self {
Self {
symbol: symbol.into(),
style: Style::default(),
}
}
pub fn styled(symbol: impl Into<CompactString>, style: Style) -> Self {
Self {
symbol: symbol.into(),
style,
}
}
pub fn reset(&mut self) {
self.symbol = CompactString::const_new(" ");
self.style = Style::default();
}
}