diff options
author | Sharif Haason <ssh128@scarletmail.rutgers.edu> | 2023-12-11 13:32:46 -0500 |
---|---|---|
committer | Sharif Haason <ssh128@scarletmail.rutgers.edu> | 2023-12-11 13:32:46 -0500 |
commit | a56b3b0c462b992ddc6409656c6c8a01692c078b (patch) | |
tree | a5b84e6de687a9b3db6e0192dfd0d61b67692931 | |
parent | 7ca00279ed2dd791d4a5d7233bb9828428d1dcc9 (diff) |
Adjust color function to not include character_table
-rw-r--r-- | src/lib.rs | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -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, } } |