From f6d1d4ea258490670ee1605c596a6ba9a49a77db Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 10 Feb 2020 11:55:20 +0100 Subject: inventories have capacity --- src/componentparameter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/componentparameter.rs') diff --git a/src/componentparameter.rs b/src/componentparameter.rs index a76f243..6003b0d 100644 --- a/src/componentparameter.rs +++ b/src/componentparameter.rs @@ -39,7 +39,7 @@ impl ComponentParameter { } pub fn from_json(value: &Value) -> Result { - let paramvalue = value.get(1).ok_or("index 0 not in component parameter")?; + let paramvalue = value.get(1).ok_or("index 1 not in component parameter")?; let typename = value.get(0).ok_or("index 0 not in component parameter")?.as_str().ok_or("compparam type not a string")?; if let Some(paramtype) = ParameterType::from_str(typename) { Ok(Self::Constant(Parameter::from_typed_json(paramtype, paramvalue).ok_or("failed to parse parameter constant")?)) -- cgit