summaryrefslogtreecommitdiff
path: root/src/encyclopedia.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-09-28 14:29:53 +0200
committertroido <troido@protonmail.com>2020-09-28 14:29:53 +0200
commiteb9853dec24045adb7447e1c8ac186e52204b690 (patch)
tree7fb944311d64ca5a8ff41748fbd5209a2eaf9806 /src/encyclopedia.rs
parent25abc71200803f7238c56c93b8b89160ff6c1086 (diff)
removed parametertype
Diffstat (limited to 'src/encyclopedia.rs')
-rw-r--r--src/encyclopedia.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/encyclopedia.rs b/src/encyclopedia.rs
index 16d26a8..2bb2960 100644
--- a/src/encyclopedia.rs
+++ b/src/encyclopedia.rs
@@ -62,7 +62,7 @@ impl<'de> Deserialize<'de> for Encyclopedia {
let ent = item.entity.unwrap_or_else(||{
let enttyp = EntityType(id.clone());
assemblages.insert(enttyp.clone(), Assemblage {
- arguments: Vec::new(),
+ arguments: HashMap::new(),
save: true,
extract: Vec::new(),
components: vec![
@@ -78,13 +78,10 @@ impl<'de> Deserialize<'de> for Encyclopedia {
action: item.action.unwrap_or(ItemAction::None)
});
}
- for (templatename, (baseent, mut args)) in templates {
+ for (templatename, (baseent, args)) in templates {
let mut assemblage = assemblages.get(&baseent).ok_or(de::Error::custom(format!("template name '{:?}' does not point to not an assemblage", baseent)))?.clone();
- for arg in assemblage.arguments.iter_mut() {
- if let Some(param) = args.remove(&arg.0) {
- // todo: verify argument type
- arg.2 = Some(param);
- }
+ for (key, val) in args {
+ assemblage.arguments.insert(key, Some(val));
}
assemblages.insert(templatename, assemblage);
}