From 0702ea943b801176649fee860715fed0f5348c8d Mon Sep 17 00:00:00 2001 From: troido Date: Fri, 3 Apr 2020 11:22:04 +0200 Subject: allow lists as parameter types, sacrificing some type safety for expressability --- src/componentwrapper.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/componentwrapper.rs') diff --git a/src/componentwrapper.rs b/src/componentwrapper.rs index 898ab1b..0fb46d0 100644 --- a/src/componentwrapper.rs +++ b/src/componentwrapper.rs @@ -202,11 +202,17 @@ components!( }; Equipment () {panic!("equipment from parameters not implemented")}; CreationTime (time: Int) {CreationTime{time: Timestamp(time)}}; - Flags (flags: Strings) { + Flags (flags: List) { Flags( flags .iter() - .map(|f| Flag::from_str(f)) + .map(|param| { + if let Parameter::String(f) = param { + Flag::from_str(f) + } else { + None + } + }) .collect::>>().ok_or(aerr!("invalid flag name"))? ) }; -- cgit