aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2019-01-27 03:08:02 +0300
committerValentin Popov <info@valentineus.link>2019-01-27 03:08:02 +0300
commitafe4062e43fd647a588f94792dfd2b9630fcb2b2 (patch)
tree91ff596e6722623c14db7845dd7b36299aa89c69 /src
parented9f8387f140f29b34004108ed05990fd25bdcd5 (diff)
downloadbbb2json-afe4062e43fd647a588f94792dfd2b9630fcb2b2.tar.xz
bbb2json-afe4062e43fd647a588f94792dfd2b9630fcb2b2.zip
Sun, 27 Jan 2019 04:08:02 +0400
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'src')
-rw-r--r--src/parser.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/parser.rs b/src/parser.rs
index ccc082a..19543e1 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -4,23 +4,21 @@ use std::io::BufReader;
extern crate xml;
use xml::reader::{EventReader, XmlEvent};
-#[derive(RustcEncodable)]
+#[derive(Serialize)]
pub struct ParserResult {
pub external_id: String,
pub meeting_id: String,
pub meeting_name: String,
}
-pub fn parse(content: BufReader<File>) -> ParserResult {
- let parser = EventReader::new(content);
-
+pub fn parser(content: BufReader<File>) -> ParserResult {
let mut data = ParserResult {
external_id: "".to_string(),
meeting_id: "".to_string(),
meeting_name: "".to_string(),
};
- for element in parser {
+ for element in EventReader::new(content) {
match element {
Ok(XmlEvent::StartElement {
name: _,