Simplify check_self macro.

This commit is contained in:
Emmanuel Gil Peyrot 2017-10-31 20:35:25 +00:00
parent 5cdb2d77ab
commit 6eba0e7d87

View file

@ -127,9 +127,7 @@ macro_rules! generate_attribute {
macro_rules! check_self { macro_rules! check_self {
($elem:ident, $name:tt, $ns:expr) => ( ($elem:ident, $name:tt, $ns:expr) => (
if !$elem.is($name, $ns) { check_self!($elem, $name, $ns, $name);
return Err(Error::ParseError(concat!("This is not a ", $name, " element.")));
}
); );
($elem:ident, $name:tt, $ns:expr, $pretty_name:tt) => ( ($elem:ident, $name:tt, $ns:expr, $pretty_name:tt) => (
if !$elem.is($name, $ns) { if !$elem.is($name, $ns) {