mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 07:16:05 +02:00
Remove some clones and improve when autoview reads config (#3285)
This commit is contained in:
@ -6,7 +6,7 @@ use log::trace;
|
||||
use nu_errors::{ArgumentError, ShellError};
|
||||
use nu_protocol::did_you_mean;
|
||||
use nu_protocol::{
|
||||
hir::{self, CapturedBlock, Expression, ExternalRedirection, RangeOperator, SpannedExpression},
|
||||
hir::{self, CapturedBlock, Expression, RangeOperator, SpannedExpression},
|
||||
Dictionary,
|
||||
};
|
||||
use nu_protocol::{
|
||||
@ -154,11 +154,8 @@ pub fn evaluate_baseline_expr(
|
||||
}
|
||||
}
|
||||
|
||||
let mut block = block.clone();
|
||||
block.infer_params();
|
||||
|
||||
Ok(
|
||||
UntaggedValue::Block(Box::new(CapturedBlock::new(block, captured)))
|
||||
UntaggedValue::Block(Box::new(CapturedBlock::new(block.clone(), captured)))
|
||||
.into_value(&tag),
|
||||
)
|
||||
}
|
||||
@ -276,9 +273,6 @@ fn evaluate_invocation(block: &hir::Block, ctx: &EvaluationContext) -> Result<Va
|
||||
None => InputStream::empty(),
|
||||
};
|
||||
|
||||
let mut block = block.clone();
|
||||
block.set_redirect(ExternalRedirection::Stdout);
|
||||
|
||||
let result = run_block(&block, ctx, input)?;
|
||||
|
||||
let output = result.into_vec();
|
||||
|
Reference in New Issue
Block a user