pub struct Attribute<'a> {
name: &'a str,
value: &'a str,
}
impl<'a> Attribute<'a> {
pub fn new(name: &'a str, value: &'a str) -> Self {
Attribute {
name,
value,
}
}
}
impl std::fmt::Display for Attribute<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}=\"{}\"", self.name, self.value)?;
Ok(())
}
}