From 4338d9d6384135f68d7201b9733175cf9d518c1d Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 25 Jun 2017 22:20:24 +0100 Subject: [PATCH] jingle_s5b: Make jid a Jid and not a String. --- src/jingle_s5b.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/jingle_s5b.rs b/src/jingle_s5b.rs index cc916a3b..57807be3 100644 --- a/src/jingle_s5b.rs +++ b/src/jingle_s5b.rs @@ -8,6 +8,7 @@ use std::convert::TryFrom; use std::str::FromStr; use minidom::{Element, IntoAttributeValue}; +use jid::Jid; use error::Error; @@ -33,7 +34,7 @@ generate_id!(StreamId); pub struct Candidate { pub cid: CandidateId, pub host: String, - pub jid: String, + pub jid: Jid, pub port: Option, pub priority: u32, pub type_: Type, @@ -45,7 +46,7 @@ impl Into for Candidate { .ns(ns::JINGLE_S5B) .attr("cid", self.cid) .attr("host", self.host) - .attr("jid", self.jid) + .attr("jid", String::from(self.jid)) .attr("port", self.port) .attr("priority", self.priority) .attr("type", self.type_) @@ -217,7 +218,7 @@ mod tests { payload: TransportPayload::Candidates(vec!(Candidate { cid: CandidateId(String::from("coucou")), host: String::from("coucou"), - jid: String::from("coucou@coucou"), + jid: Jid::from_str("coucou@coucou").unwrap(), port: None, priority: 0u32, type_: Type::Direct,