Use minidom 0.6.1’s Element::has_ns(), to simplify namespace comparisons.
This commit is contained in:
parent
c853a1ff4b
commit
f69f567448
4 changed files with 4 additions and 8 deletions
|
|
@ -208,8 +208,7 @@ impl TryFrom<Element> for ReasonElement {
|
|||
let mut reason = None;
|
||||
let mut text = None;
|
||||
for child in elem.children() {
|
||||
let child_ns = child.ns();
|
||||
if child_ns.as_ref().map(|ns| ns.as_str()) != Some(ns::JINGLE) {
|
||||
if !child.has_ns(ns::JINGLE) {
|
||||
return Err(Error::ParseError("Reason contains a foreign element."));
|
||||
}
|
||||
match child.name() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue