Skip to content

Commit

Permalink
fix treediff key usage
Browse files Browse the repository at this point in the history
the string is actually a serialized yaml value in order to support other
key types than String
  • Loading branch information
glehmann committed Feb 2, 2024
1 parent c6cc0b4 commit f4f3916
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ fn yaml_get<'a>(data: &'a sy::Value, keys: &[Key]) -> Result<&'a sy::Value> {
if keys.is_empty() {
return Ok(data);
}
let key = &keys[0];
match key {
match &keys[0] {
Key::String(k) => {
let k: sy::Value = sy::from_str(k)?;
let value = data.get(k).ok_or(YageError::KeyNotFound)?;
yaml_get(value, &keys[1..])
}
Expand Down

0 comments on commit f4f3916

Please sign in to comment.