diff --git a/vegafusion-core/src/planning/split_domain_data.rs b/vegafusion-core/src/planning/split_domain_data.rs index d2019f6a..5f13d775 100644 --- a/vegafusion-core/src/planning/split_domain_data.rs +++ b/vegafusion-core/src/planning/split_domain_data.rs @@ -248,8 +248,7 @@ impl<'a> SplitScaleDomainVisitor<'a> { } ] } - )) - .unwrap(); + ))?; // Create new domain specification that uses the new dataset let new_domain: ScaleDomainSpec = serde_json::from_value(serde_json::json!([ @@ -267,8 +266,7 @@ impl<'a> SplitScaleDomainVisitor<'a> { escape_field(&new_data_name) ) } - ])) - .unwrap(); + ]))?; (new_data, new_domain) } else { @@ -324,8 +322,7 @@ impl<'a> SplitScaleDomainVisitor<'a> { } ] } - )) - .unwrap() + ))? } else { // Will sort by the grouped field values serde_json::from_value(serde_json::json!( @@ -346,8 +343,7 @@ impl<'a> SplitScaleDomainVisitor<'a> { } ] } - )) - .unwrap() + ))? }) } } diff --git a/vegafusion-core/src/planning/stitch.rs b/vegafusion-core/src/planning/stitch.rs index 10516f06..fa34ec7a 100644 --- a/vegafusion-core/src/planning/stitch.rs +++ b/vegafusion-core/src/planning/stitch.rs @@ -21,30 +21,14 @@ pub fn stitch_specs( keep_variables: &[ScopedVariable], ) -> Result { // Get client spec variable types - let client_defs: HashSet<_> = client_spec.definition_vars().unwrap().into_iter().collect(); - let client_inputs: HashSet<_> = client_spec - .input_vars(task_scope) - .unwrap() - .into_iter() - .collect(); - let client_updates: HashSet<_> = client_spec - .update_vars(task_scope) - .unwrap() - .into_iter() - .collect(); + let client_defs: HashSet<_> = client_spec.definition_vars()?.into_iter().collect(); + let client_inputs: HashSet<_> = client_spec.input_vars(task_scope)?.into_iter().collect(); + let client_updates: HashSet<_> = client_spec.update_vars(task_scope)?.into_iter().collect(); // Get server spec variable types - let server_defs: HashSet<_> = server_spec.definition_vars().unwrap().into_iter().collect(); - let server_inputs: HashSet<_> = server_spec - .input_vars(task_scope) - .unwrap() - .into_iter() - .collect(); - let server_updates: HashSet<_> = server_spec - .update_vars(task_scope) - .unwrap() - .into_iter() - .collect(); + let server_defs: HashSet<_> = server_spec.definition_vars()?.into_iter().collect(); + let server_inputs: HashSet<_> = server_spec.input_vars(task_scope)?.into_iter().collect(); + let server_updates: HashSet<_> = server_spec.update_vars(task_scope)?.into_iter().collect(); // Determine communication requirements let mut server_to_client: HashSet<_> = client_inputs