From ea4d08b6cf6f17b18b515326261f9b37e6f43856 Mon Sep 17 00:00:00 2001 From: Grant Miller Date: Tue, 1 Nov 2022 14:23:22 -0500 Subject: [PATCH] stm32-metapac-gen: Use `serde_json` to parse json files --- stm32-metapac-gen/Cargo.toml | 2 ++ stm32-metapac-gen/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/stm32-metapac-gen/Cargo.toml b/stm32-metapac-gen/Cargo.toml index 3c1dab57..9598a594 100644 --- a/stm32-metapac-gen/Cargo.toml +++ b/stm32-metapac-gen/Cargo.toml @@ -9,5 +9,7 @@ license = "MIT OR Apache-2.0" regex = "1.5.4" chiptool = { git = "https://github.com/embassy-rs/chiptool", rev = "28ffa8a19d84914089547f52900ffb5877a5dc23" } serde = { version = "1.0.130", features = [ "derive" ] } +serde_json = "1.0.87" serde_yaml = "0.8.21" proc-macro2 = "1.0.29" + diff --git a/stm32-metapac-gen/src/lib.rs b/stm32-metapac-gen/src/lib.rs index 9bd60cb7..64045986 100644 --- a/stm32-metapac-gen/src/lib.rs +++ b/stm32-metapac-gen/src/lib.rs @@ -223,7 +223,7 @@ impl Gen { fn load_chip(&mut self, name: &str) -> Chip { let chip_path = self.opts.data_dir.join("chips").join(&format!("{}.json", name)); let chip = fs::read(chip_path).expect(&format!("Could not load chip {}", name)); - serde_yaml::from_slice(&chip).unwrap() + serde_json::from_slice(&chip).unwrap() } pub fn gen(&mut self) {