use std::fmt;
#[derive(Clone, Debug, Default)]
pub struct Html(String);
impl Html {
pub fn new(raw_html: impl Into<String>) -> Self { Html(raw_html.into()) }
pub fn into_string(self) -> String { self.0 }
pub fn as_str(&self) -> &str { &self.0 }
}
impl fmt::Display for Html {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.0)
}
}
impl From<String> for Html {
fn from(s: String) -> Self { Html(s) }
}
impl From<&str> for Html {
fn from(s: &str) -> Self { Html(s.to_owned()) }
}
#[cfg(feature = "maud")]
impl From<maud::Markup> for Html {
fn from(m: maud::Markup) -> Self { Html(m.into_string()) }
}