diff options
-rw-r--r-- | src/parser.rs | 8 |
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: _, |