summaryrefslogtreecommitdiff
path: root/src/componentwrapper.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-05-21 12:25:36 +0200
committertroido <troido@protonmail.com>2020-06-05 22:27:53 +0200
commitbd1da23cf18960b36f8683c09899044d64b4bd83 (patch)
tree605207d2a5219682d5aab2d6de2f601a5fc68834 /src/componentwrapper.rs
parentde4505121dd8b2216e8c797b4b7b7347e5d98c2f (diff)
made Talk its own component/system instead of part of interact
Diffstat (limited to 'src/componentwrapper.rs')
-rw-r--r--src/componentwrapper.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/componentwrapper.rs b/src/componentwrapper.rs
index 2619d9c..e1b5bb8 100644
--- a/src/componentwrapper.rs
+++ b/src/componentwrapper.rs
@@ -50,12 +50,13 @@ macro_rules! components {
ComponentType::$comp => Ok(Self::$comp({
use crate::components::$comp;
$(
- let $paramname = <$paramtype>::from_parameter(
- parameters
+ let $paramname = {
+ let param = parameters
.remove(stringify!($paramname))
- .ok_or(aerr!("required parameter '{}'not found", stringify!($paramname)))?
- )
- .ok_or(aerr!("parameter {} is invalid type", stringify!($paramname)))?;
+ .ok_or(aerr!("required parameter '{}'not found", stringify!($paramname)))?;
+ <$paramtype>::from_parameter(param.clone())
+ .ok_or(aerr!("parameter {} is invalid type: {:?} is not of type {}", stringify!($paramname), param, stringify!($paramtype)))?
+ };
)*
$creation
@@ -233,6 +234,7 @@ components!(all:
}
};
Substitute (into: Template);
+ Talkable (text: String);
);