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

@ -38,7 +38,8 @@ impl TryFrom<Element> for ChatState {
type Err = Error;
fn try_from(elem: Element) -> Result<ChatState, Error> {
if elem.ns() != Some(ns::CHATSTATES) {
let ns = elem.ns();
if ns.as_ref().map(|ns| ns.as_str()) != Some(ns::CHATSTATES) {
return Err(Error::ParseError("This is not a chatstate element."));
}
for _ in elem.children() {