Closed ayrapetovai closed 3 years ago
For the first way, ColoredString
dereferences to the unstyled str
, so I believe that's why the style is being removed when you use &*
. When you use format!
, then the ColoredString
is properly formatted with the styles.
That is correct. I also believe ColoredString.to_string()
would work, but I have not tested this.
Thanks, now I see, &"".color(Color::BrightGreen).to_string() works. Still cant understand why Deref is implemented this way, returns standard String with no escape chars written to it...
Hi, I have a strange issue. First of those two ways does not work, the second does (paints text with green as expected).