Skip to content

Commit b58a43a

Browse files
committed
yaml_rust2
1 parent d6b4e9d commit b58a43a

File tree

5 files changed

+20
-15
lines changed

5 files changed

+20
-15
lines changed

CHANGELOG-rust.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This changelog tracks the Rust `svdtools` project. See
55

66
## [Unreleased]
77

8+
* Replace `yaml-rust` with `yaml-rust2`. Check for duplicate keys and other YAML parse errors
89
* Prevent collapsing columns in HTML `register-map-table` with `min-width`
910
* Protect from using one `enumeratedValues` in fields with different width
1011

Cargo.toml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@ name = "svdtools"
33
version = "0.3.17"
44
repository = "https://github.com/rust-embedded/svdtools/"
55
description = "Tool for modifying bugs in CMSIS SVD"
6-
authors = [
7-
"Andrey Zgarbul <[email protected]>",
8-
"MarcoIeni"
9-
]
6+
authors = ["Andrey Zgarbul <[email protected]>", "MarcoIeni"]
107
categories = [
118
"command-line-utilities",
129
"embedded",
1310
"hardware-support",
1411
"no-std",
1512
]
16-
keywords = [
17-
"svd",
18-
"embedded",
19-
"register",
20-
]
13+
keywords = ["svd", "embedded", "register"]
2114
license = "MIT OR Apache-2.0"
2215
readme = "README.md"
23-
include = ["/res", "/src", "/tests", "CHANGELOG-rust.md", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
16+
include = [
17+
"/res",
18+
"/src",
19+
"/tests",
20+
"CHANGELOG-rust.md",
21+
"README.md",
22+
"LICENSE-APACHE",
23+
"LICENSE-MIT",
24+
]
2425
edition = "2021"
2526
rust-version = "1.70"
2627

@@ -31,13 +32,12 @@ quick-xml = { version = "0.31", features = ["serialize"] }
3132
svd-rs = { version = "0.14.8", features = ["serde", "derive-from"] }
3233
svd-parser = { version = "0.14.5", features = ["expand"] }
3334
svd-encoder = "0.14.4"
34-
yaml-rust = "0.4"
3535
# serde_yaml 0.9.x looks broken
3636
serde_yaml = "0.8.26"
3737
serde_json = { version = "1.0", features = ["preserve_order"] }
3838
anyhow = "1.0.65"
3939
thiserror = "1.0.35"
40-
linked-hash-map = "0.5"
40+
hashlink = "0.8.4"
4141
globset = "0.4.14"
4242
commands = "0.0.5"
4343
env_logger = "0.11"
@@ -50,6 +50,10 @@ regex = "1.10"
5050
itertools = "0.12.0"
5151
phf = { version = "0.11", features = ["macros"] }
5252

53+
[dependencies.yaml-rust]
54+
package = "yaml-rust2"
55+
version = "0.8"
56+
5357
[dev-dependencies]
5458
similar = "2.5.0"
5559
tempfile = "3.3"

src/patch/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ pub fn yaml_includes(parent: &mut Hash) -> Result<Vec<PathBuf>> {
202202

203203
/// Recursively merge child.key into parent.key, with parent overriding
204204
fn update_dict(parent: &mut Hash, child: &Hash) -> Result<()> {
205-
use linked_hash_map::Entry;
205+
use hashlink::linked_hash_map::Entry;
206206
for (key, val) in child.iter() {
207207
match key {
208208
Yaml::String(key) if key == "_path" || key == "_include" => continue,

src/patch/peripheral.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ fn collect_in_cluster(
13141314
cmod: &Hash,
13151315
config: &Config,
13161316
) -> PatchResult {
1317-
let mut rdict = linked_hash_map::LinkedHashMap::new();
1317+
let mut rdict = hashlink::LinkedHashMap::new();
13181318
let mut first = None;
13191319
let mut dim = 0;
13201320
let mut dim_index = Vec::new();

src/patch/yaml_ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl<'a> Iterator for OverStringIter<'a> {
146146
}
147147
}
148148

149-
type HashIter<'a> = OptIter<linked_hash_map::Iter<'a, Yaml, Yaml>>;
149+
type HashIter<'a> = OptIter<hashlink::linked_hash_map::Iter<'a, Yaml, Yaml>>;
150150

151151
pub trait GetVal {
152152
fn get_yaml(&self, k: &str) -> Option<&Yaml>;

0 commit comments

Comments
 (0)