diff options
| author | troido <troido@protonmail.com> | 2020-02-07 15:05:59 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-02-07 15:05:59 +0100 |
| commit | bed274c683ffd18a55282247d47780c4f1bf84b5 (patch) | |
| tree | 6e20e6ba099da68354e30b7f7450019188165159 /src/encyclopedia.rs | |
| parent | 70db58f688f0dbdd69231da570cf8dbb54e5ca81 (diff) | |
all entity construction now uses new templates
Diffstat (limited to 'src/encyclopedia.rs')
| -rw-r--r-- | src/encyclopedia.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/encyclopedia.rs b/src/encyclopedia.rs index 17e9857..19d4297 100644 --- a/src/encyclopedia.rs +++ b/src/encyclopedia.rs @@ -5,7 +5,7 @@ use crate::assemblage::Assemblage; use crate::componentwrapper::ComponentWrapper; use crate::template::Template; -#[derive(Default)] +#[derive(Default, Clone)] pub struct Encyclopedia { items: HashMap<String, Assemblage> } @@ -32,7 +32,7 @@ impl Encyclopedia { Ok(()) } - pub fn construct(&self, template: &Template) -> Result<Vec<ComponentWrapper>, &str> { + pub fn construct(&self, template: &Template) -> Result<Vec<ComponentWrapper>, &'static str> { let assemblage = self.items.get(&template.name).ok_or("unknown assemblage name")?; assemblage.instantiate(&template.args, &template.kwargs) } |
