Revert "Revert "Migrate most uses of the Span concept to Tag""

This reverts commit bee7c5639c.
This commit is contained in:
Yehuda Katz
2019-09-14 11:30:24 -05:00
parent 52e71cad18
commit ab915f1c44
98 changed files with 1178 additions and 1248 deletions

View File

@ -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(),
))
}
}