mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 04:45:04 +02:00
Fix issue in external subexpression paths (#3642)
* Fix issue in external subexpression paths * new clippy dropped * clippy
This commit is contained in:
@ -6,7 +6,7 @@ use crate::evaluation_context::EvaluationContext;
|
||||
use nu_errors::ShellError;
|
||||
use nu_protocol::hir::SpannedExpression;
|
||||
use nu_protocol::{UntaggedValue, Value};
|
||||
use nu_stream::{InputStream, ToInputStream};
|
||||
use nu_stream::{InputStream, IntoInputStream};
|
||||
|
||||
pub(crate) fn run_expression_block(
|
||||
expr: &SpannedExpression,
|
||||
@ -24,6 +24,6 @@ pub(crate) fn run_expression_block(
|
||||
value: UntaggedValue::Table(x),
|
||||
..
|
||||
} => Ok(InputStream::from_stream(x.into_iter())),
|
||||
output => Ok(std::iter::once(Ok(output)).to_input_stream()),
|
||||
output => Ok(std::iter::once(Ok(output)).into_input_stream()),
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ use encoding_rs::Encoding;
|
||||
use nu_data::config::LocalConfigDiff;
|
||||
use nu_protocol::{CommandAction, ConfigPath, TaggedDictBuilder, Value};
|
||||
use nu_source::{Span, Tag};
|
||||
use nu_stream::{ActionStream, Interruptible, OutputStream, ToActionStream};
|
||||
use nu_stream::{ActionStream, Interruptible, IntoActionStream, OutputStream};
|
||||
use std::collections::VecDeque;
|
||||
use std::io::ErrorKind;
|
||||
use std::path::{Path, PathBuf};
|
||||
@ -225,7 +225,7 @@ impl Shell for FilesystemShell {
|
||||
Some(entry)
|
||||
})
|
||||
.interruptible(ctrl_c_copy)
|
||||
.to_action_stream())
|
||||
.into_action_stream())
|
||||
}
|
||||
|
||||
fn cd(&self, args: CdArgs, name: Tag) -> Result<ActionStream, ShellError> {
|
||||
@ -772,7 +772,7 @@ impl Shell for FilesystemShell {
|
||||
))
|
||||
}
|
||||
})
|
||||
.to_action_stream())
|
||||
.into_action_stream())
|
||||
}
|
||||
|
||||
fn path(&self) -> String {
|
||||
|
@ -11,7 +11,7 @@ use nu_errors::ShellError;
|
||||
use nu_plugin::jsonrpc::JsonRpc;
|
||||
use nu_protocol::{hir, Primitive, ReturnValue, Signature, UntaggedValue, Value};
|
||||
use nu_source::Tag;
|
||||
use nu_stream::{ActionStream, InputStream, ToActionStream};
|
||||
use nu_stream::{ActionStream, InputStream, IntoActionStream};
|
||||
use serde::{self, Deserialize, Serialize};
|
||||
use std::collections::VecDeque;
|
||||
use std::io::prelude::*;
|
||||
@ -204,9 +204,9 @@ fn run_filter(path: String, args: CommandArgs) -> Result<ActionStream, ShellErro
|
||||
|
||||
match response {
|
||||
Ok(NuResult::response { params }) => match params {
|
||||
Ok(params) => params.into_iter().to_action_stream(),
|
||||
Ok(params) => params.into_iter().into_action_stream(),
|
||||
Err(e) => {
|
||||
vec![ReturnValue::Err(e)].into_iter().to_action_stream()
|
||||
vec![ReturnValue::Err(e)].into_iter().into_action_stream()
|
||||
}
|
||||
},
|
||||
|
||||
@ -265,9 +265,9 @@ fn run_filter(path: String, args: CommandArgs) -> Result<ActionStream, ShellErro
|
||||
|
||||
match response {
|
||||
Ok(NuResult::response { params }) => match params {
|
||||
Ok(params) => params.into_iter().to_action_stream(),
|
||||
Ok(params) => params.into_iter().into_action_stream(),
|
||||
Err(e) => {
|
||||
vec![ReturnValue::Err(e)].into_iter().to_action_stream()
|
||||
vec![ReturnValue::Err(e)].into_iter().into_action_stream()
|
||||
}
|
||||
},
|
||||
Err(e) => vec![Err(ShellError::untagged_runtime_error(format!(
|
||||
@ -275,7 +275,7 @@ fn run_filter(path: String, args: CommandArgs) -> Result<ActionStream, ShellErro
|
||||
e, input
|
||||
)))]
|
||||
.into_iter()
|
||||
.to_action_stream(),
|
||||
.into_action_stream(),
|
||||
}
|
||||
}
|
||||
Err(e) => vec![Err(ShellError::untagged_runtime_error(format!(
|
||||
@ -283,7 +283,7 @@ fn run_filter(path: String, args: CommandArgs) -> Result<ActionStream, ShellErro
|
||||
e
|
||||
)))]
|
||||
.into_iter()
|
||||
.to_action_stream(),
|
||||
.into_action_stream(),
|
||||
};
|
||||
|
||||
let stdin = child.stdin.as_mut().expect("Failed to open stdin");
|
||||
@ -339,9 +339,9 @@ fn run_filter(path: String, args: CommandArgs) -> Result<ActionStream, ShellErro
|
||||
|
||||
match response {
|
||||
Ok(NuResult::response { params }) => match params {
|
||||
Ok(params) => params.into_iter().to_action_stream(),
|
||||
Ok(params) => params.into_iter().into_action_stream(),
|
||||
Err(e) => {
|
||||
vec![ReturnValue::Err(e)].into_iter().to_action_stream()
|
||||
vec![ReturnValue::Err(e)].into_iter().into_action_stream()
|
||||
}
|
||||
},
|
||||
Err(e) => ActionStream::one(Err(
|
||||
@ -360,7 +360,7 @@ fn run_filter(path: String, args: CommandArgs) -> Result<ActionStream, ShellErro
|
||||
}
|
||||
})
|
||||
.flatten()
|
||||
.to_action_stream())
|
||||
.into_action_stream())
|
||||
}
|
||||
|
||||
#[derive(new)]
|
||||
|
@ -9,7 +9,7 @@ use nu_protocol::hir::{
|
||||
NamedArguments, SpannedExpression,
|
||||
};
|
||||
use nu_protocol::{Primitive, UntaggedValue, Value};
|
||||
use nu_stream::{InputStream, ToInputStream};
|
||||
use nu_stream::{InputStream, IntoInputStream};
|
||||
|
||||
use crate::EvaluationContext;
|
||||
use log::{debug, trace};
|
||||
@ -206,7 +206,7 @@ pub fn process_script(
|
||||
panic!("Internal error: could not read lines of text from stdin")
|
||||
}
|
||||
});
|
||||
stream.to_input_stream()
|
||||
stream.into_input_stream()
|
||||
} else {
|
||||
InputStream::empty()
|
||||
};
|
||||
|
@ -7,7 +7,7 @@ use nu_parser::ParserScope;
|
||||
use nu_protocol::hir::Block;
|
||||
use nu_protocol::{ReturnSuccess, Signature, UntaggedValue};
|
||||
use nu_source::{DbgDocBldr, DebugDocBuilder, PrettyDebugWithSource, Span, Tag};
|
||||
use nu_stream::{ActionStream, InputStream, OutputStream, ToOutputStream};
|
||||
use nu_stream::{ActionStream, InputStream, IntoOutputStream, OutputStream};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub trait WholeStreamCommand: Send + Sync {
|
||||
@ -39,7 +39,7 @@ pub trait WholeStreamCommand: Send + Sync {
|
||||
input: stream,
|
||||
leftovers: InputStream::empty(),
|
||||
})
|
||||
.to_output_stream())
|
||||
.into_output_stream())
|
||||
}
|
||||
|
||||
fn is_binary(&self) -> bool {
|
||||
|
Reference in New Issue
Block a user