From 0a057cdfef4549b986f1b531ecc6fa84ce91f025 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 1 Mar 2018 17:31:49 +0100 Subject: [PATCH] =?UTF-8?q?component:=20Fix=20handshake=20content,=20it?= =?UTF-8?q?=E2=80=99s=20hex,=20not=20base64!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/component.rs b/src/component.rs index 9c54118..f9ac62f 100644 --- a/src/component.rs +++ b/src/component.rs @@ -8,11 +8,11 @@ use try_from::TryFrom; use minidom::Element; use error::Error; -use helpers::Base64; +use helpers::PlainText; use ns; generate_element_with_text!(Handshake, "handshake", ns::COMPONENT, - data: Base64> + data: PlainText> ); #[cfg(test)] @@ -23,10 +23,10 @@ mod tests { fn test_simple() { let elem: Element = "".parse().unwrap(); let handshake = Handshake::try_from(elem).unwrap(); - assert!(handshake.data.is_empty()); + assert_eq!(handshake.data, None); - let elem: Element = "AAAA".parse().unwrap(); + let elem: Element = "Coucou".parse().unwrap(); let handshake = Handshake::try_from(elem).unwrap(); - assert_eq!(handshake.data, b"\0\0\0"); + assert_eq!(handshake.data, Some(String::from("Coucou"))); } }