aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-12-18 00:29:24 -0800
committeriximeow <me@iximeow.net>2020-01-12 16:26:39 -0800
commita6c2fba0ffe00e2d7a86d9ca7f4dae1611c151dc (patch)
treeff387d6e869d5d16756208a59558a12bbced1089
parentc5021c15a8a16d789711c8043562b5f52f607642 (diff)
color helper for misc instructions
-rw-r--r--src/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c8996ee..53807ac 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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) }