diff --git a/src/svd/device.rs b/src/svd/device.rs index bd324b12..50c1f310 100644 --- a/src/svd/device.rs +++ b/src/svd/device.rs @@ -18,7 +18,7 @@ use svd::peripheral::Peripheral; #[derive(Clone, Debug)] pub struct Device { pub name: String, - schema_version: String, + schema_version: Option, pub version: Option, pub description: Option, pub address_unit_bits: Option, @@ -40,8 +40,7 @@ impl Parse for Device { name: tree.get_child_text("name")?, schema_version: tree.attributes .get("schemaVersion") - .unwrap() - .clone(), + .map(|s| s.clone()), cpu: parse::optional::("cpu", tree)?, version: tree.get_child_text_opt("version")?, description: tree.get_child_text_opt("description")?,