diff --git a/CHANGELOG-rust.md b/CHANGELOG-rust.md index 728c812..d18f18d 100644 --- a/CHANGELOG-rust.md +++ b/CHANGELOG-rust.md @@ -5,6 +5,7 @@ This changelog tracks the Rust `svdtools` project. See ## [Unreleased] +* Replace `yaml-rust` with `yaml-rust2`. Check for duplicate keys and other YAML parse errors * Prevent collapsing columns in HTML `register-map-table` with `min-width` * Protect from using one `enumeratedValues` in fields with different width diff --git a/Cargo.toml b/Cargo.toml index 63372e4..6ee1e6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,24 +3,25 @@ name = "svdtools" version = "0.3.17" repository = "https://github.com/rust-embedded/svdtools/" description = "Tool for modifying bugs in CMSIS SVD" -authors = [ - "Andrey Zgarbul ", - "MarcoIeni" -] +authors = ["Andrey Zgarbul ", "MarcoIeni"] categories = [ "command-line-utilities", "embedded", "hardware-support", "no-std", ] -keywords = [ - "svd", - "embedded", - "register", -] +keywords = ["svd", "embedded", "register"] license = "MIT OR Apache-2.0" readme = "README.md" -include = ["/res", "/src", "/tests", "CHANGELOG-rust.md", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] +include = [ + "/res", + "/src", + "/tests", + "CHANGELOG-rust.md", + "README.md", + "LICENSE-APACHE", + "LICENSE-MIT", +] edition = "2021" rust-version = "1.70" @@ -31,13 +32,12 @@ quick-xml = { version = "0.31", features = ["serialize"] } svd-rs = { version = "0.14.8", features = ["serde", "derive-from"] } svd-parser = { version = "0.14.5", features = ["expand"] } svd-encoder = "0.14.4" -yaml-rust = "0.4" # serde_yaml 0.9.x looks broken serde_yaml = "0.8.26" serde_json = { version = "1.0", features = ["preserve_order"] } anyhow = "1.0.65" thiserror = "1.0.35" -linked-hash-map = "0.5" +hashlink = "0.8.4" globset = "0.4.14" commands = "0.0.5" env_logger = "0.11" @@ -50,6 +50,10 @@ regex = "1.10" itertools = "0.12.0" phf = { version = "0.11", features = ["macros"] } +[dependencies.yaml-rust] +package = "yaml-rust2" +version = "0.8" + [dev-dependencies] similar = "2.5.0" tempfile = "3.3" diff --git a/src/patch/mod.rs b/src/patch/mod.rs index 558ce69..bb5bd7f 100644 --- a/src/patch/mod.rs +++ b/src/patch/mod.rs @@ -17,6 +17,8 @@ use svd_parser::SVDError::DimIndexParse; use svd_rs::{BitRange, DimArrayIndex, DimElement, DimElementBuilder, MaybeArray}; use yaml_rust::{yaml::Hash, Yaml, YamlLoader}; +use hashlink::linked_hash_map; + use anyhow::{anyhow, Context, Result}; pub type PatchResult = anyhow::Result<()>; diff --git a/src/patch/peripheral.rs b/src/patch/peripheral.rs index c4d08bf..cc78945 100644 --- a/src/patch/peripheral.rs +++ b/src/patch/peripheral.rs @@ -1314,7 +1314,7 @@ fn collect_in_cluster( cmod: &Hash, config: &Config, ) -> PatchResult { - let mut rdict = linked_hash_map::LinkedHashMap::new(); + let mut rdict = super::linked_hash_map::LinkedHashMap::new(); let mut first = None; let mut dim = 0; let mut dim_index = Vec::new(); diff --git a/src/patch/yaml_ext.rs b/src/patch/yaml_ext.rs index 2565013..c4ae7ff 100644 --- a/src/patch/yaml_ext.rs +++ b/src/patch/yaml_ext.rs @@ -146,7 +146,7 @@ impl<'a> Iterator for OverStringIter<'a> { } } -type HashIter<'a> = OptIter>; +type HashIter<'a> = OptIter>; pub trait GetVal { fn get_yaml(&self, k: &str) -> Option<&Yaml>;