From bed274c683ffd18a55282247d47780c4f1bf84b5 Mon Sep 17 00:00:00 2001 From: troido Date: Fri, 7 Feb 2020 15:05:59 +0100 Subject: all entity construction now uses new templates --- src/encyclopedia.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/encyclopedia.rs') 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 } @@ -32,7 +32,7 @@ impl Encyclopedia { Ok(()) } - pub fn construct(&self, template: &Template) -> Result, &str> { + pub fn construct(&self, template: &Template) -> Result, &'static str> { let assemblage = self.items.get(&template.name).ok_or("unknown assemblage name")?; assemblage.instantiate(&template.args, &template.kwargs) } -- cgit