Remove EvaluationContext::from_args (#3604)

This commit is contained in:
JT
2021-06-11 18:35:21 +12:00
committed by GitHub
parent 8ac572ed27
commit b9ca3b2039
32 changed files with 45 additions and 60 deletions

View File

@ -67,10 +67,6 @@ impl EvaluationContext {
}
}
pub fn from_args(args: &CommandArgs) -> EvaluationContext {
args.context.clone()
}
pub fn error(&self, error: ShellError) {
self.with_errors(|errors| errors.push(error))
}

View File

@ -1,7 +1,6 @@
use crate::command_args::CommandArgs;
use crate::documentation::get_full_help;
use crate::evaluate::block::run_block;
use crate::evaluation_context::EvaluationContext;
use crate::example::Example;
use nu_errors::ShellError;
use nu_parser::ParserScope;
@ -32,7 +31,7 @@ pub trait WholeStreamCommand: Send + Sync {
}
fn run(&self, args: CommandArgs) -> Result<InputStream, ShellError> {
let context = EvaluationContext::from_args(&args);
let context = args.context.clone();
let stream = self.run_with_actions(args)?;
Ok(Box::new(crate::evaluate::internal::InternalIterator {
@ -81,7 +80,7 @@ impl WholeStreamCommand for Arc<Block> {
let external_redirection = args.call_info.args.external_redirection;
let ctx = EvaluationContext::from_args(&args);
let ctx = &args.context;
let evaluated = call_info.evaluate(&ctx)?;
let input = args.input;