diff options
author | Jesse Luehrs <doy@tozt.net> | 2023-03-09 01:45:05 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2023-03-09 01:45:05 -0500 |
commit | b615e03beb20cb836fe643b57291657b9c2845d8 (patch) | |
tree | 9880823cbc1235ea84f1d5e60c9b4dbddd88b678 /src/cell.rs | |
parent | e11519d403f5ac0cdff70f1029791c0aa9dbe8d5 (diff) | |
download | vt100-rust-b615e03beb20cb836fe643b57291657b9c2845d8.tar.gz vt100-rust-b615e03beb20cb836fe643b57291657b9c2845d8.zip |
stop implementing Default for Cell
Diffstat (limited to 'src/cell.rs')
-rw-r--r-- | src/cell.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cell.rs b/src/cell.rs index 240ddf9..b7ddd26 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -3,7 +3,7 @@ use unicode_width::UnicodeWidthChar as _; const CODEPOINTS_IN_CELL: usize = 6; /// Represents a single terminal cell. -#[derive(Clone, Debug, Default, Eq)] +#[derive(Clone, Debug, Eq)] pub struct Cell { contents: [char; CODEPOINTS_IN_CELL], len: u8, @@ -25,6 +25,14 @@ impl PartialEq<Self> for Cell { } impl Cell { + pub(crate) fn new() -> Self { + Self { + contents: Default::default(), + len: 0, + attrs: crate::attrs::Attrs::default(), + } + } + #[inline] fn len(&self) -> usize { usize::from(self.len & 0x0f) |