lib: Fix column spacing

This commit is contained in:
Erik Kundt
2025-12-11 09:52:09 +01:00
parent a541323f1e
commit 3cd7833e29
8 changed files with 88 additions and 19 deletions
+20
View File
@@ -95,6 +95,26 @@ impl<'a> Column<'a> {
}
}
pub struct Spacing(u16);
impl From<u16> for Spacing {
fn from(value: u16) -> Self {
Self(value)
}
}
impl Default for Spacing {
fn default() -> Self {
Self(0)
}
}
impl From<Spacing> for u16 {
fn from(spacing: Spacing) -> Self {
spacing.0
}
}
/// Needs to be implemented for items that are supposed to be rendered in tables.
pub trait ToRow<const W: usize> {
fn to_row(&self) -> [Cell; W];