mirror of
https://github.com/nushell/nushell.git
synced 2025-08-13 20:07:13 +02:00
Refactor: introduce 2 associated functions to PipelineData
(#16233)
# Description As title: this pr is try to introduce 2 functions to `PipelineData`: 1. PipelineData::list_stream --> create a PipelineData::ListStream 2. PipelineData::byte_stream -> create a PipelineData::ByteStream And use these functions everywhere. ### Reason behind this change I tried to implement `pipefail` feature, but this would required to change `PipelineData` from enum to struct. So use these functions can reduce diff if I finally change to struct. [Discord message here](https://discord.com/channels/601130461678272522/615962413203718156/1396999539000479784) is my plan. # User-Facing Changes NaN # Tests + Formatting NaN # After Submitting NaN
This commit is contained in:
@ -194,7 +194,7 @@ impl PluginTest {
|
||||
/// # }
|
||||
/// ```
|
||||
pub fn eval(&mut self, nu_source: &str) -> Result<PipelineData, ShellError> {
|
||||
self.eval_with(nu_source, PipelineData::Empty)
|
||||
self.eval_with(nu_source, PipelineData::empty())
|
||||
}
|
||||
|
||||
/// Test a list of plugin examples. Prints an error for each failing example.
|
||||
|
@ -145,7 +145,7 @@ fn test_into_int_from_u32() -> Result<(), ShellError> {
|
||||
let result = PluginTest::new("custom_u32", CustomU32Plugin.into())?
|
||||
.eval_with(
|
||||
"into int from u32",
|
||||
PipelineData::Value(CustomU32(42).into_value(Span::test_data()), None),
|
||||
PipelineData::value(CustomU32(42).into_value(Span::test_data()), None),
|
||||
)?
|
||||
.into_value(Span::test_data())?;
|
||||
assert_eq!(Value::test_int(42), result);
|
||||
|
Reference in New Issue
Block a user