aboutsummaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/util.rs b/src/util.rs
index f51a41f8..6065e01b 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -15,7 +15,6 @@ use std::cmp;
#[cfg(not(feature = "nightly"))]
#[inline(always)]
-#[cfg_attr(feature = "clippy", allow(inline_always))]
pub unsafe fn unlikely(x: bool) -> bool {
x
}
@@ -74,24 +73,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)]