From 0947ce5a918207efeaf2a4f67a1cc410795f057a Mon Sep 17 00:00:00 2001 From: tom barrett Date: Mon, 1 Jul 2019 09:14:17 -0500 Subject: simpilfied interfaces and added new xml properties --- src/xmlelements.rs | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'src/xmlelements.rs') diff --git a/src/xmlelements.rs b/src/xmlelements.rs index ea880c8..23dafc4 100644 --- a/src/xmlelements.rs +++ b/src/xmlelements.rs @@ -5,36 +5,6 @@ use xml::reader::{ XmlEvent::{self, EndElement, StartElement}, }; -#[derive(Debug, Clone)] -pub struct Property { - pub entity: String, - pub keyframe: usize, - pub delay: usize, -} - -impl Property { - pub fn new(property_elements: Vec) -> Property { - let entity = XMLElements::get_attribute_value(&property_elements, "entity") - .unwrap() - .parse() - .unwrap(); - let keyframe = XMLElements::get_attribute_value(&property_elements, "keyframe") - .unwrap() - .parse() - .unwrap(); - let delay = XMLElements::get_attribute_value(&property_elements, "delay") - .unwrap() - .parse() - .unwrap(); - - Property { - entity, - keyframe, - delay, - } - } -} - pub struct XMLElements { pub events: Vec, } @@ -143,7 +113,7 @@ impl XMLElements { false } }) - .unwrap(); + .ok_or(())?; if let StartElement { attributes, .. } = element { Ok(attributes -- cgit v1.2.3