mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
macros: Implement Display for attributes.
This commit is contained in:
parent
8c21efb2ac
commit
7b536e5bfc
1 changed files with 7 additions and 0 deletions
|
@ -85,6 +85,13 @@ macro_rules! generate_attribute {
|
|||
})
|
||||
}
|
||||
}
|
||||
impl std::fmt::Display for $elem {
|
||||
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
|
||||
write!(fmt, "{}", match self {
|
||||
$($elem::$a => $b),+
|
||||
})
|
||||
}
|
||||
}
|
||||
impl ::minidom::IntoAttributeValue for $elem {
|
||||
fn into_attribute_value(self) -> Option<String> {
|
||||
Some(String::from(match self {
|
||||
|
|
Loading…
Reference in a new issue