mirror of
https://github.com/nushell/nushell.git
synced 2025-08-13 06:58:09 +02:00
User error propagation operator (#2201)
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user