Match cleanup (#2290)

This commit is contained in:
Joseph T. Lyons
2020-08-02 18:34:33 -04:00
committed by GitHub
parent f33da33626
commit c48ea46c4f
16 changed files with 102 additions and 152 deletions

View File

@ -121,16 +121,15 @@ impl Inc {
let got = replace_for?;
let replacement = self.inc(got)?;
match value
value
.replace_data_at_column_path(&f, replacement.value.into_untagged_value())
{
Some(v) => Ok(v),
None => Err(ShellError::labeled_error(
"inc could not find field to replace",
"column name",
value.tag(),
)),
}
.ok_or_else(|| {
ShellError::labeled_error(
"inc could not find field to replace",
"column name",
value.tag(),
)
})
}
None => Err(ShellError::untagged_runtime_error(
"inc needs a field when incrementing a column in a table",