mirror of
https://github.com/nushell/nushell.git
synced 2025-08-18 18:58:24 +02:00
Fix issue in external subexpression paths (#3642)
* Fix issue in external subexpression paths * new clippy dropped * clippy
This commit is contained in:
@@ -164,17 +164,16 @@ impl From<Vec<Value>> for InputStream {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::clippy::wrong_self_convention)]
|
||||
pub trait ToInputStream {
|
||||
fn to_input_stream(self) -> InputStream;
|
||||
pub trait IntoInputStream {
|
||||
fn into_input_stream(self) -> InputStream;
|
||||
}
|
||||
|
||||
impl<T, U> ToInputStream for T
|
||||
impl<T, U> IntoInputStream for T
|
||||
where
|
||||
T: Iterator<Item = U> + Send + Sync + 'static,
|
||||
U: Into<Result<nu_protocol::Value, nu_errors::ShellError>>,
|
||||
{
|
||||
fn to_input_stream(self) -> InputStream {
|
||||
fn into_input_stream(self) -> InputStream {
|
||||
InputStream {
|
||||
empty: false,
|
||||
values: Box::new(self.map(|item| match item.into() {
|
||||
|
@@ -7,5 +7,5 @@ mod output;
|
||||
pub use input::*;
|
||||
pub use interruptible::*;
|
||||
pub use output::*;
|
||||
pub use prelude::ToActionStream;
|
||||
pub use prelude::ToOutputStream;
|
||||
pub use prelude::IntoActionStream;
|
||||
pub use prelude::IntoOutputStream;
|
||||
|
@@ -38,31 +38,29 @@ use nu_protocol::Value;
|
||||
|
||||
pub(crate) use crate::{ActionStream, InputStream, OutputStream};
|
||||
|
||||
#[allow(clippy::wrong_self_convention)]
|
||||
pub trait ToOutputStream {
|
||||
fn to_output_stream(self) -> OutputStream;
|
||||
pub trait IntoOutputStream {
|
||||
fn into_output_stream(self) -> OutputStream;
|
||||
}
|
||||
|
||||
impl<T> ToOutputStream for T
|
||||
impl<T> IntoOutputStream for T
|
||||
where
|
||||
T: Iterator<Item = Value> + Send + Sync + 'static,
|
||||
{
|
||||
fn to_output_stream(self) -> OutputStream {
|
||||
fn into_output_stream(self) -> OutputStream {
|
||||
OutputStream::from_stream(self)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::wrong_self_convention)]
|
||||
pub trait ToActionStream {
|
||||
fn to_action_stream(self) -> ActionStream;
|
||||
pub trait IntoActionStream {
|
||||
fn into_action_stream(self) -> ActionStream;
|
||||
}
|
||||
|
||||
impl<T, U> ToActionStream for T
|
||||
impl<T, U> IntoActionStream for T
|
||||
where
|
||||
T: Iterator<Item = U> + Send + Sync + 'static,
|
||||
U: Into<nu_protocol::ReturnValue>,
|
||||
{
|
||||
fn to_action_stream(self) -> ActionStream {
|
||||
fn into_action_stream(self) -> ActionStream {
|
||||
ActionStream {
|
||||
values: Box::new(self.map(|item| item.into())),
|
||||
}
|
||||
|
Reference in New Issue
Block a user