From afe4062e43fd647a588f94792dfd2b9630fcb2b2 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sun, 27 Jan 2019 04:08:02 +0400 Subject: Sun, 27 Jan 2019 04:08:02 +0400 Signed-off-by: Valentin Popov --- src/parser.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') 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) -> ParserResult { - let parser = EventReader::new(content); - +pub fn parser(content: BufReader) -> 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: _, -- cgit v1.2.3