aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorasoderman <5639572+asoderman@users.noreply.github.com>2018-06-19 17:27:47 -0400
committerChristian Duerr <chrisduerr@users.noreply.github.com>2018-06-19 21:27:47 +0000
commit128c25ee8b31473a6514e9bcaa59d8f9e66ea3a7 (patch)
tree727588a548639096db5c133887c68c52cf2cd739
parentf55252ec8537e68d0c98a1fac35728a2b596d328 (diff)
downloadalacritty-128c25ee8b31473a6514e9bcaa59d8f9e66ea3a7.tar.gz
alacritty-128c25ee8b31473a6514e9bcaa59d8f9e66ea3a7.zip
Change green implementation to use the macro
-rw-r--r--src/util.rs18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/util.rs b/src/util.rs
index f51a41f8..062e7651 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -74,24 +74,12 @@ pub mod fmt {
/// Write a `Display` or `Debug` escaped with Red
pub struct Red => "31";
+ /// Write a `Display` or `Debug` escaped with Green
+ pub struct Green => "32";
+
/// Write a `Display` or `Debug` escaped with Yellow
pub struct Yellow => "33";
}
-
- /// Write a `Display` or `Debug` escaped with Red
- pub struct Green<T>(pub T);
-
- impl<T: fmt::Display> fmt::Display for Green<T> {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "\x1b[32m{}\x1b[0m", self.0)
- }
- }
-
- impl<T: fmt::Debug> fmt::Debug for Green<T> {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "\x1b[32m{:?}\x1b[0m", self.0)
- }
- }
}
#[cfg(test)]