From 7953524eb79fa854fb32520e06bf08c602033e8a Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 15 Dec 2024 21:42:56 +0100 Subject: [PATCH] xmpp-parsers: Remove two now-unused get_attr!() variants OptionEmpty and RequiredNonEmpty were long gone. skip-changelog, because this is internal API only. --- parsers/src/util/macros.rs | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/parsers/src/util/macros.rs b/parsers/src/util/macros.rs index d5cd47af6aafc89e115bdb212e4a16c1abee5602..e26bba83cd06ffa843f7f365e8057750a8ae436d 100644 --- a/parsers/src/util/macros.rs +++ b/parsers/src/util/macros.rs @@ -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,