jingle_message, muc, presence, version: Always use the check_no_attributes macro.

This commit is contained in:
Emmanuel Gil Peyrot 2018-05-12 17:59:04 +02:00
commit e0438f9b88
5 changed files with 9 additions and 37 deletions

View file

@ -28,11 +28,7 @@ pub enum JingleMI {
}
fn get_sid(elem: Element) -> Result<SessionId, Error> {
for (attr, _) in elem.attrs() {
if attr != "id" {
return Err(Error::ParseError("Unknown attribute in Jingle message element."));
}
}
check_no_unknown_attributes!(elem, "Jingle message", ["id"]);
Ok(SessionId(get_attr!(elem, "id", required)))
}