From 6eba0e7d8738137e29e2b206474ca50b18287359 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 31 Oct 2017 20:35:25 +0000 Subject: [PATCH] Simplify check_self macro. --- src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 68302afe..db57ce26 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -127,9 +127,7 @@ macro_rules! generate_attribute { macro_rules! check_self { ($elem:ident, $name:tt, $ns:expr) => ( - if !$elem.is($name, $ns) { - return Err(Error::ParseError(concat!("This is not a ", $name, " element."))); - } + check_self!($elem, $name, $ns, $name); ); ($elem:ident, $name:tt, $ns:expr, $pretty_name:tt) => ( if !$elem.is($name, $ns) {