color_span/view/convert.rs
1use super::*;
2
3impl Debug for ColorView {
4 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
5 f.debug_tuple("ColorView")
6 .field(&self.text())
7 .field(&self.span.get_info().iter().map(|v| v.clone().unwrap_or_default()))
8 .finish()
9 }
10}
11
12impl From<&str> for ColorView {
13 fn from(s: &str) -> Self {
14 ColorView::new(s)
15 }
16}
17
18impl From<String> for ColorView {
19 fn from(s: String) -> Self {
20 ColorView::new(&s)
21 }
22}