Introduce comparing with namespace support.

This commit is contained in:
Astro 2017-08-19 00:04:18 +01:00
commit 1b1661fd82
16 changed files with 156 additions and 20 deletions

View file

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