mirror of
https://github.com/nushell/nushell.git
synced 2025-07-09 02:48:17 +02:00
Revert "Revert "Migrate most uses of the Span concept to Tag""
This reverts commit bee7c5639c
.
This commit is contained in:
@ -134,7 +134,7 @@ fn to_csv(
|
||||
ToCSVArgs { headerless }: ToCSVArgs,
|
||||
RunnableContext { input, name, .. }: RunnableContext,
|
||||
) -> Result<OutputStream, ShellError> {
|
||||
let name_span = name;
|
||||
let name_tag = name;
|
||||
let stream = async_stream_block! {
|
||||
let input: Vec<Tagged<Value>> = input.values.collect().await;
|
||||
|
||||
@ -155,15 +155,15 @@ fn to_csv(
|
||||
} else {
|
||||
x
|
||||
};
|
||||
yield ReturnSuccess::value(Value::Primitive(Primitive::String(converted)).simple_spanned(name_span))
|
||||
yield ReturnSuccess::value(Value::Primitive(Primitive::String(converted)).tagged(name_tag))
|
||||
}
|
||||
_ => {
|
||||
yield Err(ShellError::labeled_error_with_secondary(
|
||||
"Expected a table with CSV-compatible structure.span() from pipeline",
|
||||
"Expected a table with CSV-compatible structure.tag() from pipeline",
|
||||
"requires CSV-compatible input",
|
||||
name_span,
|
||||
name_tag,
|
||||
"originates from here".to_string(),
|
||||
value.span(),
|
||||
value.tag(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user