Introduce comparing with namespace support.
This commit is contained in:
parent
04ec34bed8
commit
1b1661fd82
16 changed files with 156 additions and 20 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue