diff --git a/src/opaque_error.rs b/src/opaque_error.rs index 6db5a7a..07c65d7 100644 --- a/src/opaque_error.rs +++ b/src/opaque_error.rs @@ -61,9 +61,10 @@ impl OpaqueError { true }); let str = vec.iter().rfold(String::new(), |mut acc, x| { - let first = acc.len() != 0; - if first { - acc.push_str(":"); + let first = acc.len() == 0; + if !first { + // TODO: should this code be hardcoded? + acc.push_str("\x1b[2m:\x1b[0m"); } acc.push_str(x.0); @@ -74,6 +75,7 @@ impl OpaqueError { } acc }); + FancyTrace { str } } pub fn set_level(mut self, lvl: Level) -> Self { @@ -92,7 +94,7 @@ pub struct FancyTrace { } impl fmt::Display for FancyTrace { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}", self.str) + write!(f, "\x1b[2m{{{{\x1b[0m {} \x1b[2m}}}}\x1b[0m", self.str) } }