Skip to content

Commit

Permalink
yaml_rust2
Browse files Browse the repository at this point in the history
  • Loading branch information
burrbull committed Aug 5, 2024
1 parent c4863f6 commit d3c741b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
28 changes: 16 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>",
"MarcoIeni"
]
authors = ["Andrey Zgarbul <[email protected]>", "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"

Expand All @@ -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"
Expand All @@ -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"
2 changes: 1 addition & 1 deletion src/patch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pub fn yaml_includes(parent: &mut Hash) -> Result<Vec<PathBuf>> {

/// Recursively merge child.key into parent.key, with parent overriding
fn update_dict(parent: &mut Hash, child: &Hash) -> Result<()> {
use linked_hash_map::Entry;
use hashlink::linked_hash_map::Entry;
for (key, val) in child.iter() {
match key {
Yaml::String(key) if key == "_path" || key == "_include" => continue,
Expand Down
2 changes: 1 addition & 1 deletion src/patch/peripheral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ fn collect_in_cluster(
cmod: &Hash,
config: &Config,
) -> PatchResult {
let mut rdict = linked_hash_map::LinkedHashMap::new();
let mut rdict = hashlink::LinkedHashMap::new();
let mut first = None;
let mut dim = 0;
let mut dim_index = Vec::new();
Expand Down
2 changes: 1 addition & 1 deletion src/patch/yaml_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl<'a> Iterator for OverStringIter<'a> {
}
}

type HashIter<'a> = OptIter<linked_hash_map::Iter<'a, Yaml, Yaml>>;
type HashIter<'a> = OptIter<hashlink::linked_hash_map::Iter<'a, Yaml, Yaml>>;

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

0 comments on commit d3c741b

Please sign in to comment.