Skip to content

Commit a29ba4d

Browse files
committed
drop: removed dot notation for value paths
1 parent cd4bb19 commit a29ba4d

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

crates/core/src/context/context.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ impl Context {
5858

5959
if let ContextResult::Success(value) = res {
6060
let mut curr = value;
61+
log::debug!("Tracing down value: {:?}", curr);
6162

6263
for path in reference.paths {
6364
if let Some(index) = path.array_index {
@@ -75,23 +76,20 @@ impl Context {
7576
}
7677
}
7778

78-
if let Some(path) = path.path {
79-
let splits = path.split(".");
80-
81-
for part in splits {
82-
match curr.kind {
83-
Some(ref kind) => {
84-
if let Kind::StructValue(struct_value) = &kind {
85-
match struct_value.fields.get(part) {
86-
Some(x) => {
87-
curr = x.clone();
88-
}
89-
None => return ContextResult::NotFound,
79+
if let Some(field_name) = path.path {
80+
match curr.kind {
81+
Some(ref kind) => {
82+
if let Kind::StructValue(struct_value) = &kind {
83+
match struct_value.fields.get(&field_name) {
84+
Some(x) => {
85+
log::debug!("Updating trace value to: {:?}", x);
86+
curr = x.clone();
9087
}
88+
None => return ContextResult::NotFound,
9189
}
9290
}
93-
None => return ContextResult::NotFound,
9491
}
92+
None => return ContextResult::NotFound,
9593
}
9694
}
9795
}

0 commit comments

Comments
 (0)