macros: Simplify generated code for check_no_attributes!().

This commit is contained in:
Emmanuel Gil Peyrot 2018-05-12 20:25:59 +02:00
parent 6bb466eea2
commit 84355f9e1d

View file

@ -206,7 +206,9 @@ macro_rules! check_no_children {
macro_rules! check_no_attributes { macro_rules! check_no_attributes {
($elem:ident, $name:tt) => ( ($elem:ident, $name:tt) => (
check_no_unknown_attributes!($elem, $name, []); for _ in $elem.attrs() {
return Err(Error::ParseError(concat!("Unknown attribute in ", $name, " element.")));
}
); );
} }