Use minidom 0.6.1’s Element::has_ns(), to simplify namespace comparisons.

This commit is contained in:
Emmanuel Gil Peyrot 2017-08-27 01:04:56 +01:00
commit f69f567448
4 changed files with 4 additions and 8 deletions

View file

@ -47,8 +47,7 @@ impl TryFrom<Element> for JingleMI {
type Err = Error;
fn try_from(elem: Element) -> Result<JingleMI, Error> {
let ns = elem.ns();
if ns.as_ref().map(|ns| ns.as_str()) != Some(ns::JINGLE_MESSAGE) {
if !elem.has_ns(ns::JINGLE_MESSAGE) {
return Err(Error::ParseError("This is not a Jingle message element."));
}
Ok(match elem.name() {