Remove usages of internal_span (#14700)

# Description
Remove usages of `internal_span` in matches and initializers. I think
this should be the last of the usages, meaning `internal_span` can
finally be refactored out of `Value`(!?)
This commit is contained in:
132ikl
2024-12-30 03:47:06 -05:00
committed by GitHub
parent 2bcf2389aa
commit 378395c22c
10 changed files with 84 additions and 94 deletions

View File

@@ -52,14 +52,17 @@ pub fn table_to_query_string(
) -> Result<String, ShellError> {
let row_vec = table
.iter()
.map(|val| match val {
Value::Record { val, internal_span } => key_value_from_record(val, *internal_span),
_ => Err(ShellError::UnsupportedInput {
msg: "expected a table".into(),
input: "not a table, contains non-record values".into(),
msg_span: head,
input_span: span,
}),
.map(|val| {
let val_span = val.span();
match val {
Value::Record { val, .. } => key_value_from_record(val, val_span),
_ => Err(ShellError::UnsupportedInput {
msg: "expected a table".into(),
input: "not a table, contains non-record values".into(),
msg_span: head,
input_span: span,
}),
}
})
.collect::<Result<Vec<_>, ShellError>>()?;