mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 23:07:46 +02:00
ListStream
touchup (#12524)
# Description Does some misc changes to `ListStream`: - Moves it into its own module/file separate from `RawStream`. - `ListStream`s now have an associated `Span`. - This required changes to `ListStreamInfo` in `nu-plugin`. Note sure if this is a breaking change for the plugin protocol. - Hides the internals of `ListStream` but also adds a few more methods. - This includes two functions to more easily alter a stream (these take a `ListStream` and return a `ListStream` instead of having to go through the whole `into_pipeline_data(..)` route). - `map`: takes a `FnMut(Value) -> Value` - `modify`: takes a function to modify the inner stream.
This commit is contained in:
@ -78,10 +78,7 @@ fn dice(
|
||||
Value::int(thread_rng.gen_range(1..sides + 1) as i64, span)
|
||||
});
|
||||
|
||||
Ok(PipelineData::ListStream(
|
||||
ListStream::from_stream(iter, engine_state.ctrlc.clone()),
|
||||
None,
|
||||
))
|
||||
Ok(ListStream::new(iter, span, engine_state.ctrlc.clone()).into())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
Reference in New Issue
Block a user