mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 08:26:22 +02:00
Match cleanup (#2290)
This commit is contained in:
@ -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",
|
||||
|
Reference in New Issue
Block a user