Use check_no_children!() where it makes sense.

This commit is contained in:
Emmanuel Gil Peyrot 2018-05-14 16:33:47 +02:00
commit 3d495ccf41
6 changed files with 13 additions and 37 deletions

View file

@ -33,9 +33,7 @@ fn get_sid(elem: Element) -> Result<SessionId, Error> {
}
fn check_empty_and_get_sid(elem: Element) -> Result<SessionId, Error> {
for _ in elem.children() {
return Err(Error::ParseError("Unknown child in Jingle message element."));
}
check_no_children!(elem, "Jingle message");
get_sid(elem)
}