body: Simplify the type of Body to an alias of String.

This commit is contained in:
Emmanuel Gil Peyrot 2017-04-22 20:49:17 +01:00
commit 6d6ac8a380

View file

@ -4,10 +4,7 @@ use error::Error;
use ns; use ns;
#[derive(Debug, Clone)] pub type Body = String;
pub struct Body {
pub body: String,
}
pub fn parse_body(root: &Element) -> Result<Body, Error> { pub fn parse_body(root: &Element) -> Result<Body, Error> {
// TODO: also support components and servers. // TODO: also support components and servers.
@ -17,7 +14,7 @@ pub fn parse_body(root: &Element) -> Result<Body, Error> {
for _ in root.children() { for _ in root.children() {
return Err(Error::ParseError("Unknown child in body element.")); return Err(Error::ParseError("Unknown child in body element."));
} }
Ok(Body { body: root.text() }) Ok(root.text())
} }
#[cfg(test)] #[cfg(test)]