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/template.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/template.rs') diff --git a/src/template.rs b/src/template.rs index 51bba8b..b6b34cb 100644 --- a/src/template.rs +++ b/src/template.rs @@ -13,11 +13,15 @@ pub struct Template { impl Template { - pub fn empty(name: &str) -> Self { + pub fn new(name: &str, kwargs: HashMap) -> Self { Self { name: name.to_string(), args: Vec::new(), - kwargs: HashMap::new() + kwargs } } + + pub fn empty(name: &str) -> Self { + Self::new(name, HashMap::new()) + } } -- cgit