chatstates: Use the new helper macros to simplify parsing.
This commit is contained in:
parent
a2b6033336
commit
ee243c4720
2 changed files with 11 additions and 9 deletions
|
|
@ -138,6 +138,14 @@ macro_rules! check_self {
|
|||
);
|
||||
}
|
||||
|
||||
macro_rules! check_ns_only {
|
||||
($elem:ident, $name:tt, $ns:expr) => (
|
||||
if !$elem.has_ns($ns) {
|
||||
return Err(Error::ParseError(concat!("This is not a ", $name, " element.")));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
macro_rules! check_no_children {
|
||||
($elem:ident, $name:tt) => (
|
||||
for _ in $elem.children() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue