xmpp-parsers: Remove two now-unused get_attr!() variants

OptionEmpty and RequiredNonEmpty were long gone.

skip-changelog, because this is internal API only.
This commit is contained in:
Emmanuel Gil Peyrot 2024-12-15 21:42:56 +01:00 committed by Jonas Schäfer
commit 7953524eb7

View file

@ -14,13 +14,6 @@ macro_rules! get_attr {
value.parse().map_err(xso::error::Error::text_parse_error)?
)
};
($elem:ident, $attr:tt, OptionEmpty, $value:ident, $func:expr) => {
match $elem.attr($attr) {
Some("") => None,
Some($value) => Some($func),
None => None,
}
};
($elem:ident, $attr:tt, Option, $value:ident, $func:expr) => {
match $elem.attr($attr) {
Some($value) => Some($func),
@ -38,23 +31,6 @@ macro_rules! get_attr {
}
}
};
($elem:ident, $attr:tt, RequiredNonEmpty, $value:ident, $func:expr) => {
match $elem.attr($attr) {
Some("") => {
return Err(xso::error::Error::Other(
concat!("Required attribute '", $attr, "' must not be empty.").into(),
)
.into());
}
Some($value) => $func,
None => {
return Err(xso::error::Error::Other(
concat!("Required attribute '", $attr, "' missing.").into(),
)
.into());
}
}
};
($elem:ident, $attr:tt, Default, $value:ident, $func:expr) => {
match $elem.attr($attr) {
Some($value) => $func,