body: Simplify the type of Body to an alias of String.
This commit is contained in:
parent
24d563ff18
commit
6d6ac8a380
1 changed files with 2 additions and 5 deletions
|
|
@ -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)]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue