parsers: update for minidom API changes
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
40b92d64e2
commit
6308250c17
26 changed files with 140 additions and 190 deletions
|
|
@ -193,22 +193,21 @@ impl TryFrom<Element> for File {
|
|||
|
||||
impl From<File> for Element {
|
||||
fn from(file: File) -> Element {
|
||||
Element::builder("file")
|
||||
.ns(ns::JINGLE_FT)
|
||||
.append_all(file.date.map(|date| Element::builder("date").append(date)))
|
||||
Element::builder("file", ns::JINGLE_FT)
|
||||
.append_all(file.date.map(|date| Element::builder("date", ns::JINGLE_FT).append(date)))
|
||||
.append_all(
|
||||
file.media_type
|
||||
.map(|media_type| Element::builder("media-type").append(media_type)),
|
||||
.map(|media_type| Element::builder("media-type", ns::JINGLE_FT).append(media_type)),
|
||||
)
|
||||
.append_all(file.name.map(|name| Element::builder("name").append(name)))
|
||||
.append_all(file.name.map(|name| Element::builder("name", ns::JINGLE_FT).append(name)))
|
||||
.append_all(file.descs.into_iter().map(|(lang, desc)| {
|
||||
Element::builder("desc")
|
||||
Element::builder("desc", ns::JINGLE_FT)
|
||||
.attr("xml:lang", lang)
|
||||
.append(desc.0)
|
||||
}))
|
||||
.append_all(
|
||||
file.size
|
||||
.map(|size| Element::builder("size").append(format!("{}", size))),
|
||||
.map(|size| Element::builder("size", ns::JINGLE_FT).append(format!("{}", size))),
|
||||
)
|
||||
.append_all(file.range)
|
||||
.append_all(file.hashes)
|
||||
|
|
@ -251,8 +250,7 @@ impl TryFrom<Element> for Description {
|
|||
|
||||
impl From<Description> for Element {
|
||||
fn from(description: Description) -> Element {
|
||||
Element::builder("description")
|
||||
.ns(ns::JINGLE_FT)
|
||||
Element::builder("description", ns::JINGLE_FT)
|
||||
.append(Node::Element(description.file.into()))
|
||||
.build()
|
||||
}
|
||||
|
|
@ -301,8 +299,7 @@ impl TryFrom<Element> for Checksum {
|
|||
|
||||
impl From<Checksum> for Element {
|
||||
fn from(checksum: Checksum) -> Element {
|
||||
Element::builder("checksum")
|
||||
.ns(ns::JINGLE_FT)
|
||||
Element::builder("checksum", ns::JINGLE_FT)
|
||||
.attr("name", checksum.name)
|
||||
.attr("creator", checksum.creator)
|
||||
.append(Node::Element(checksum.file.into()))
|
||||
|
|
|
|||
Loading…
Reference in a new issue