diff options
author | Sharif Haason <ssh128@scarletmail.rutgers.edu> | 2023-12-11 13:33:44 -0500 |
---|---|---|
committer | Sharif Haason <ssh128@scarletmail.rutgers.edu> | 2023-12-11 13:33:44 -0500 |
commit | 1310b1d19ed3fd8c63ec002689619934d7de9def (patch) | |
tree | 93e21b0ce638fc13b74d4659f3e01f13185ea7f4 | |
parent | a56b3b0c462b992ddc6409656c6c8a01692c078b (diff) |
Adjust color function to not take character_table as arg
-rw-r--r-- | src/lib.rs | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -449,11 +449,9 @@ impl<'a, Writer: Write> Printer<'a, Writer> { Squeezer::Print | Squeezer::Delete => self.writer.write_all(b" ")?, Squeezer::Ignore | Squeezer::Disabled => { if let Some(&b) = self.line_buf.get(i as usize) { - if self.show_color - && self.curr_color != Some(Byte(b).color(self.character_table)) - { - self.writer.write_all(Byte(b).color(self.character_table))?; - self.curr_color = Some(Byte(b).color(self.character_table)); + if self.show_color && self.curr_color != Some(Byte(b).color()) { + self.writer.write_all(Byte(b).color())?; + self.curr_color = Some(Byte(b).color()); } self.writer .write_all(self.byte_char_panel[b as usize].as_bytes())?; @@ -520,9 +518,9 @@ impl<'a, Writer: Write> Printer<'a, Writer> { if i % (self.group_size as usize) == 0 { self.writer.write_all(b" ")?; } - if self.show_color && self.curr_color != Some(Byte(b).color(self.character_table)) { - self.writer.write_all(Byte(b).color(self.character_table))?; - self.curr_color = Some(Byte(b).color(self.character_table)); + if self.show_color && self.curr_color != Some(Byte(b).color()) { + self.writer.write_all(Byte(b).color())?; + self.curr_color = Some(Byte(b).color()); } self.writer .write_all(self.byte_hex_panel[b as usize].as_bytes())?; |