diff options
author | iximeow <me@iximeow.net> | 2019-12-18 00:29:24 -0800 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2020-01-12 16:26:39 -0800 |
commit | a6c2fba0ffe00e2d7a86d9ca7f4dae1611c151dc (patch) | |
tree | ff387d6e869d5d16756208a59558a12bbced1089 /src/lib.rs | |
parent | c5021c15a8a16d789711c8043562b5f52f607642 (diff) |
color helper for misc instructions
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -272,6 +272,7 @@ pub trait YaxColors { fn comparison_op<T: Display>(&self, t: T) -> Colored<T>; fn invalid_op<T: Display>(&self, t: T) -> Colored<T>; fn platform_op<T: Display>(&self, t: T) -> Colored<T>; + fn misc_op<T: Display>(&self, t: T) -> Colored<T>; fn register<T: Display>(&self, t: T) -> Colored<T>; fn program_counter<T: Display>(&self, t: T) -> Colored<T>; @@ -309,6 +310,9 @@ impl YaxColors for ColorSettings { fn invalid_op<T: Display>(&self, t: T) -> Colored<T> { Colored::Color(t, self.invalid) } + fn misc_op<T: Display>(&self, t: T) -> Colored<T> { + Colored::Color(t, self.misc) + } fn platform_op<T: Display>(&self, t: T) -> Colored<T> { Colored::Color(t, self.platform) } @@ -391,6 +395,12 @@ impl <'a> YaxColors for Option<&'a ColorSettings> { None => { Colored::Just(t) } } } + fn misc_op<T: Display>(&self, t: T) -> Colored<T> { + match self { + Some(colors) => { colors.misc_op(t) } + None => { Colored::Just(t) } + } + } fn platform_op<T: Display>(&self, t: T) -> Colored<T> { match self { Some(colors) => { colors.platform_op(t) } |