From 6d6ac8a380043f3361fc2879da7eba6b813d2c16 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 22 Apr 2017 20:49:17 +0100 Subject: [PATCH] body: Simplify the type of Body to an alias of String. --- src/body.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/body.rs b/src/body.rs index 45406e6c..dcc4389d 100644 --- a/src/body.rs +++ b/src/body.rs @@ -4,10 +4,7 @@ use error::Error; use ns; -#[derive(Debug, Clone)] -pub struct Body { - pub body: String, -} +pub type Body = String; pub fn parse_body(root: &Element) -> Result { // TODO: also support components and servers. @@ -17,7 +14,7 @@ pub fn parse_body(root: &Element) -> Result { for _ in root.children() { return Err(Error::ParseError("Unknown child in body element.")); } - Ok(Body { body: root.text() }) + Ok(root.text()) } #[cfg(test)]