Skip to content

Commit 507e8af

Browse files
committed
string _include
1 parent eb91f92 commit 507e8af

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG-rust.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This changelog tracks the Rust `svdtools` project. See
1616
* Refactor `RegisterBlockExt`, use `BlockPath` for better errors
1717
* Allow specs started with `_`
1818
* Allow process, `_delete` and `_modify` cluster without `_clusters` specifier
19+
* Allow 1 string `_include`
1920

2021
## [v0.3.11] 2024-03-06
2122

src/patch/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,12 @@ pub fn yaml_includes(parent: &mut Hash) -> Result<Vec<PathBuf>> {
162162
}
163163
}
164164

165-
let inc = parent.get_vec("_include")?.unwrap_or(&Vec::new()).clone();
165+
let inc = parent
166+
.str_vec_iter("_include")?
167+
.map(|s| s.to_string())
168+
.collect::<Vec<_>>();
166169
for relpath in inc {
167-
let relpath = relpath.as_str().unwrap();
170+
let relpath = relpath.as_str();
168171
let path = abspath(&self_path, Path::new(relpath))
169172
.with_context(|| anyhow!("Opening file \"{relpath}\" from file {self_path:?}"))?;
170173
if included.contains(&path) {

0 commit comments

Comments
 (0)