1 2 3 4 5 6 7 8 9 10 11 12 13 14
use std::fmt::Display; pub trait ToStyledString { fn to_styled_string(&self) -> String; } impl<T> ToStyledString for T where T: Display, { fn to_styled_string(&self) -> String { self.to_string() } }