mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-28 08:05:52 +00:00
Adjust color function to not include character_table
This commit is contained in:
1 parent
7ca00279ed
commit
a56b3b0c46
1 file changed
+7
-9
+7
-9
@@ -61,16 +61,14 @@ impl Byte {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn color(self, character_table: CharacterTable) -> &'static [u8] {
|
fn color(self) -> &'static [u8] {
|
||||||
use crate::ByteCategory::*;
|
use crate::ByteCategory::*;
|
||||||
match character_table {
|
match self.category() {
|
||||||
CharacterTable::AsciiOnly | CharacterTable::CP437 => match self.category() {
|
Null => COLOR_NULL,
|
||||||
Null => COLOR_NULL,
|
AsciiPrintable => COLOR_ASCII_PRINTABLE,
|
||||||
AsciiPrintable => COLOR_ASCII_PRINTABLE,
|
AsciiWhitespace => COLOR_ASCII_WHITESPACE,
|
||||||
AsciiWhitespace => COLOR_ASCII_WHITESPACE,
|
AsciiOther => COLOR_ASCII_OTHER,
|
||||||
AsciiOther => COLOR_ASCII_OTHER,
|
NonAscii => COLOR_NONASCII,
|
||||||
NonAscii => COLOR_NONASCII,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user