diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-11-11 05:00:49 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-11-11 05:00:49 -0500 |
commit | c61c85a7985358d726cc0ba0649ce9b269b62d5c (patch) | |
tree | e26d6e4964e2845fbadc7381ecf4a1f5d2e18ce7 /src/attrs.rs | |
parent | 805f9348bfdbfea6cc48e2f03946ec84de4a3c53 (diff) | |
download | vt100-rust-c61c85a7985358d726cc0ba0649ce9b269b62d5c.tar.gz vt100-rust-c61c85a7985358d726cc0ba0649ce9b269b62d5c.zip |
stop using formats at all
they are too slow
Diffstat (limited to 'src/attrs.rs')
-rw-r--r-- | src/attrs.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/attrs.rs b/src/attrs.rs index 8ba4e7c..08ec857 100644 --- a/src/attrs.rs +++ b/src/attrs.rs @@ -1,4 +1,4 @@ -use std::io::Write as _; +use crate::term::BufWrite as _; /// Represents a foreground or background color for cells. #[derive(Eq, PartialEq, Debug, Copy, Clone)] @@ -95,8 +95,7 @@ impl Attrs { other: &Self, ) { if self != other && self == &Self::default() { - write!(contents, "{}", crate::term::ClearAttrs::default()) - .unwrap(); + crate::term::ClearAttrs::default().write_buf(contents); return; } @@ -133,6 +132,6 @@ impl Attrs { attrs.inverse(self.inverse()) }; - write!(contents, "{}", attrs).unwrap(); + attrs.write_buf(contents); } } |