use std::fmt::{self, Display, Formatter};
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Comment {
pub comment: String,
}
impl Display for Comment {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
write!(f, "<!-- {} -->", self.comment)
}
}
impl<C> From<C> for Comment
where
C: Into<String>,
{
fn from(comment: C) -> Self {
Self {
comment: comment.into(),
}
}
}