Change Map keys to Identifier.

This commit is contained in:
Stephen Chung
2021-03-29 17:14:22 +08:00
parent 41b48d591f
commit e306a92ea0
7 changed files with 21 additions and 14 deletions

View File

@@ -1573,12 +1573,12 @@ impl Engine {
self.make_type_mismatch_err::<ImmutableString>(idx.type_name(), idx_pos)
})?;
if _create && !map.contains_key(index) {
map.insert(index.clone(), Default::default());
if _create && !map.contains_key(index.as_str()) {
map.insert(index.clone().into(), Default::default());
}
Ok(map
.get_mut(index)
.get_mut(index.as_str())
.map(Target::from)
.unwrap_or_else(|| Target::from(())))
}