Adjust color function to not include character_table

This commit is contained in:
Sharif Haason committed 2023-12-11 13:32:46 -05:00
1 parent 7ca00279ed
commit a56b3b0c46
1 file changed
+7 -9
+7 -9
View File
@@ -61,16 +61,14 @@ impl Byte {
}
}
fn color(self, character_table: CharacterTable) -> &'static [u8] {
fn color(self) -> &'static [u8] {
use crate::ByteCategory::*;
match character_table {
CharacterTable::AsciiOnly | CharacterTable::CP437 => match self.category() {
Null => COLOR_NULL,
AsciiPrintable => COLOR_ASCII_PRINTABLE,
AsciiWhitespace => COLOR_ASCII_WHITESPACE,
AsciiOther => COLOR_ASCII_OTHER,
NonAscii => COLOR_NONASCII,
},
match self.category() {
Null => COLOR_NULL,
AsciiPrintable => COLOR_ASCII_PRINTABLE,
AsciiWhitespace => COLOR_ASCII_WHITESPACE,
AsciiOther => COLOR_ASCII_OTHER,
NonAscii => COLOR_NONASCII,
}
}