1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
use std::fmt::{Debug, Formatter};
use super::*;
impl<T> Debug for CodeView<T> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.debug_tuple("CodeSpan").field(&self.text).finish()
}
}
impl<T> From<&str> for CodeView<T>
where
T: Clone,
{
fn from(s: &str) -> Self {
CodeView::new(s)
}
}
impl<T> From<String> for CodeView<T>
where
T: Clone,
{
fn from(s: String) -> Self {
CodeView::new(s)
}
}