Add a new check_no_attributes macro, to avoid the empty list.

This commit is contained in:
Emmanuel Gil Peyrot 2017-10-31 15:47:38 +00:00
commit f85b451fcf
4 changed files with 13 additions and 7 deletions

View file

@ -40,7 +40,7 @@ impl TryFrom<Element> for ChatState {
fn try_from(elem: Element) -> Result<ChatState, Error> {
check_ns_only!(elem, "chatstate", ns::CHATSTATES);
check_no_children!(elem, "chatstate");
check_no_unknown_attributes!(elem, "chatstate", []);
check_no_attributes!(elem, "chatstate");
Ok(match elem.name() {
"active" => ChatState::Active,
"composing" => ChatState::Composing,