summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSharif Haason <ssh128@scarletmail.rutgers.edu>2023-12-11 13:32:46 -0500
committerSharif Haason <ssh128@scarletmail.rutgers.edu>2023-12-11 13:32:46 -0500
commita56b3b0c462b992ddc6409656c6c8a01692c078b (patch)
treea5b84e6de687a9b3db6e0192dfd0d61b67692931
parent7ca00279ed2dd791d4a5d7233bb9828428d1dcc9 (diff)
Adjust color function to not include character_table
-rw-r--r--src/lib.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f06df56..32f55a1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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,
}
}