diff options
author | tom barrett <spalf0@gmail.com> | 2019-07-01 09:14:17 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2019-07-01 09:14:17 -0500 |
commit | 0947ce5a918207efeaf2a4f67a1cc410795f057a (patch) | |
tree | 30d601261754e236fc064faa9138eec9d1314d7c /src/xmlelements.rs | |
parent | 4b01b87d8aca041304c927560095af92feb406da (diff) |
simpilfied interfaces and added new xml properties
Diffstat (limited to 'src/xmlelements.rs')
-rw-r--r-- | src/xmlelements.rs | 32 |
1 files changed, 1 insertions, 31 deletions
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<XmlEvent>) -> 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<XmlEvent>, } @@ -143,7 +113,7 @@ impl XMLElements { false } }) - .unwrap(); + .ok_or(())?; if let StartElement { attributes, .. } = element { Ok(attributes |