Skip to content

Commit 955ed02

Browse files
authored
Merge pull request #238 from rust-embedded/yaml-rust2
yaml_rust -> yaml_rust2
2 parents d6b4e9d + 226f9ce commit 955ed02

File tree

5 files changed

+21
-14
lines changed

5 files changed

+21
-14
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 <zgarbul.andrey@gmail.com>",
8-
"MarcoIeni"
9-
]
6+
authors = ["Andrey Zgarbul <zgarbul.andrey@gmail.com>", "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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ use svd_parser::SVDError::DimIndexParse;
1717
use svd_rs::{BitRange, DimArrayIndex, DimElement, DimElementBuilder, MaybeArray};
1818
use yaml_rust::{yaml::Hash, Yaml, YamlLoader};
1919

20+
use hashlink::linked_hash_map;
21+
2022
use anyhow::{anyhow, Context, Result};
2123
pub type PatchResult = anyhow::Result<()>;
2224

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 = super::linked_hash_map::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<super::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)