diff --git a/Cargo.toml b/Cargo.toml index d8b0826..700d7f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ categories = ["parsing", "network-programming"] license = "MPL-2.0" [dependencies] -minidom = "0.4.1" +minidom = "0.4.3" jid = "0.2.0" base64 = "0.5.0" digest = "0.5.0" diff --git a/src/ibb.rs b/src/ibb.rs index 71bf695..18cb14e 100644 --- a/src/ibb.rs +++ b/src/ibb.rs @@ -113,7 +113,7 @@ impl Into for IBB { IBB::Open { block_size, sid, stanza } => { Element::builder("open") .ns(ns::IBB) - .attr("block-size", format!("{}", block_size)) + .attr("block-size", block_size) .attr("sid", sid) .attr("stanza", stanza) .build() @@ -121,7 +121,7 @@ impl Into for IBB { IBB::Data { seq, sid, data } => { Element::builder("data") .ns(ns::IBB) - .attr("seq", format!("{}", seq)) + .attr("seq", seq) .attr("sid", sid) .append(base64::encode(&data)) .build() diff --git a/src/jingle_ft.rs b/src/jingle_ft.rs index 1a4550c..1d37b6a 100644 --- a/src/jingle_ft.rs +++ b/src/jingle_ft.rs @@ -24,11 +24,8 @@ impl IntoElements for Range { fn into_elements(self, emitter: &mut ElementEmitter) { let mut elem = Element::builder("range") .ns(ns::JINGLE_FT) - .attr("offset", format!("{}", self.offset)) - .attr("length", match self.length { - Some(length) => Some(format!("{}", length)), - None => None - }) + .attr("offset", self.offset) + .attr("length", self.length) .build(); for hash in self.hashes { elem.append_child(hash.into()); diff --git a/src/jingle_ibb.rs b/src/jingle_ibb.rs index 6f789d3..afbf11c 100644 --- a/src/jingle_ibb.rs +++ b/src/jingle_ibb.rs @@ -43,7 +43,7 @@ impl Into for Transport { fn into(self) -> Element { Element::builder("transport") .ns(ns::JINGLE_IBB) - .attr("block-size", format!("{}", self.block_size)) + .attr("block-size", self.block_size) .attr("sid", self.sid) .attr("stanza", self.stanza) .build() diff --git a/src/jingle_s5b.rs b/src/jingle_s5b.rs index 42c188f..316a321 100644 --- a/src/jingle_s5b.rs +++ b/src/jingle_s5b.rs @@ -70,8 +70,8 @@ impl Into for Candidate { .attr("cid", self.cid) .attr("host", self.host) .attr("jid", self.jid) - .attr("port", match self.port { Some(port) => Some(format!("{}", port)), None => None }) - .attr("priority", format!("{}", self.priority)) + .attr("port", self.port) + .attr("priority", self.priority) .attr("type", self.type_) .build() } diff --git a/src/rsm.rs b/src/rsm.rs index 21d86ee..e8d7109 100644 --- a/src/rsm.rs +++ b/src/rsm.rs @@ -103,7 +103,7 @@ impl Into for Set { if self.first.is_some() { elem.append_child(Element::builder("first") .ns(ns::RSM) - .attr("index", self.first_index.map(|index| format!("{}", index))) + .attr("index", self.first_index) .append(self.first).build()); } if self.index.is_some() {