We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6aa4fdc + 9cc400a commit ee26f02Copy full SHA for ee26f02
src/svd/device.rs
@@ -18,7 +18,7 @@ use svd::peripheral::Peripheral;
18
#[derive(Clone, Debug)]
19
pub struct Device {
20
pub name: String,
21
- schema_version: String,
+ schema_version: Option<String>,
22
pub version: Option<String>,
23
pub description: Option<String>,
24
pub address_unit_bits: Option<u32>,
@@ -40,8 +40,7 @@ impl Parse for Device {
40
name: tree.get_child_text("name")?,
41
schema_version: tree.attributes
42
.get("schemaVersion")
43
- .unwrap()
44
- .clone(),
+ .map(|s| s.clone()),
45
cpu: parse::optional::<Cpu>("cpu", tree)?,
46
version: tree.get_child_text_opt("version")?,
47
description: tree.get_child_text_opt("description")?,
0 commit comments