mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 13:11:15 +02:00
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:
@@ -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>>()?;
|
||||
|
||||
|
Reference in New Issue
Block a user