summaryrefslogtreecommitdiffstats
path: root/src/path/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/path/mod.rs')
-rw-r--r--src/path/mod.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/path/mod.rs b/src/path/mod.rs
index 04c424c..b056467 100644
--- a/src/path/mod.rs
+++ b/src/path/mod.rs
@@ -209,7 +209,11 @@ impl Expression {
_ => {
if let ValueKind::Table(ref mut map) = root.kind {
// Just do a simple set
- map.insert(id.clone(), value);
+ if let Some(existing) = map.get_mut(id) {
+ *existing = value;
+ } else {
+ map.insert(id.clone(), value);
+ }
}
}
}