From db9ef3ef305cedb2e2de6bf83f1487cc505d9a3e Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 31 Oct 2017 16:11:09 +0000 Subject: [PATCH] =?UTF-8?q?jingle=5Fft:=20Use=20jingle=E2=80=99s=20Content?= =?UTF-8?q?Id=20type=20to=20identify=20content=20names.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jingle_ft.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/jingle_ft.rs b/src/jingle_ft.rs index 97ad5cd..3558d30 100644 --- a/src/jingle_ft.rs +++ b/src/jingle_ft.rs @@ -10,7 +10,7 @@ use std::collections::BTreeMap; use std::str::FromStr; use hashes::Hash; -use jingle::Creator; +use jingle::{Creator, ContentId}; use minidom::{Element, IntoElements, IntoAttributeValue, ElementEmitter}; use chrono::{DateTime, FixedOffset}; @@ -61,14 +61,14 @@ pub struct Description { #[derive(Debug, Clone)] pub struct Checksum { - pub name: String, + pub name: ContentId, pub creator: Creator, pub file: File, } #[derive(Debug, Clone)] pub struct Received { - pub name: String, + pub name: ContentId, pub creator: Creator, } @@ -337,11 +337,11 @@ mod tests { fn test_received() { let elem: Element = "".parse().unwrap(); let received = Received::try_from(elem).unwrap(); - assert_eq!(received.name, String::from("coucou")); + assert_eq!(received.name, ContentId(String::from("coucou"))); assert_eq!(received.creator, Creator::Initiator); let elem2 = Element::from(received.clone()); let received2 = Received::try_from(elem2).unwrap(); - assert_eq!(received2.name, String::from("coucou")); + assert_eq!(received2.name, ContentId(String::from("coucou"))); assert_eq!(received2.creator, Creator::Initiator); let elem: Element = "".parse().unwrap();