Skip to content

Commit

Permalink
Merge pull request #242 from rust-embedded/sugar
Browse files Browse the repository at this point in the history
Sugar for _split and _merge
  • Loading branch information
burrbull authored Aug 11, 2024
2 parents 7e46093 + 72f2f3d commit f30e86b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This changelog tracks the Rust `svdtools` project. See

## [Unreleased]

* Sugar for simple `_split` and `_merge`

## [v0.3.18] 2024-08-10

* Replace `yaml-rust` with `yaml-rust2`. Check for duplicate keys and other YAML parse errors
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ _rebase:
ARRAY*:
name: NEW_NAME%s
_modify:
FIELD: [MINIMUM, MAXIMUM]
FIELD:
description: NEWDESC
OTHER_ARRAY*: {}
Expand Down
8 changes: 8 additions & 0 deletions src/patch/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ impl RegisterExt for Register {
.with_context(|| format!("Merging fields matched to `{fspec}`"))?;
}
}
Some(Yaml::String(fspec)) => {
self.merge_fields(fspec, None, &rpath)
.with_context(|| format!("Merging fields matched to `{fspec}`"))?;
}
_ => {}
}

Expand All @@ -222,6 +226,10 @@ impl RegisterExt for Register {
.with_context(|| format!("Splitting fields matched to `{fspec}`"))?;
}
}
Some(Yaml::String(fspec)) => {
self.split_fields(fspec, &Hash::new(), &rpath)
.with_context(|| format!("Splitting fields matched to `{fspec}`"))?;
}
_ => {}
}

Expand Down

0 comments on commit f30e86b

Please sign in to comment.