User error propagation operator (#2201)

This commit is contained in:
Joseph T. Lyons
2020-07-17 21:12:06 -04:00
committed by GitHub
parent b358804904
commit dbe0effd67
3 changed files with 12 additions and 28 deletions

View File

@ -50,12 +50,7 @@ pub fn calculate(values: &[Value], name: &Tag, mf: MathFunction) -> Result<Value
// The mathematical function operates over the columns of the table
let mut column_totals = IndexMap::new();
for (col_name, col_vals) in column_values {
match mf(&col_vals, &name) {
Ok(result) => {
column_totals.insert(col_name, result);
}
Err(err) => return Err(err),
}
column_totals.insert(col_name, mf(&col_vals, &name)?);
}
Ok(UntaggedValue::Row(Dictionary {