Remove duplicate implementations of CallExt::rest (#14484)

# Description

Removes unnecessary usages of `Call::rest_iter_flattened` and
`get_rest_for_glob_pattern` and replaces them with `CallExt::rest`.

# User-Facing Changes

None
This commit is contained in:
Ian Manske
2024-12-01 06:03:45 -08:00
committed by GitHub
parent c4b919b24c
commit bcd85b6f3e
13 changed files with 27 additions and 71 deletions

View File

@ -1,5 +1,5 @@
use nu_cmd_base::hook::eval_hook;
use nu_engine::{command_prelude::*, env_to_strings, get_eval_expression};
use nu_engine::{command_prelude::*, env_to_strings};
use nu_path::{dots::expand_ndots, expand_tilde, AbsolutePath};
use nu_protocol::{did_you_mean, process::ChildProcess, ByteStream, NuGlob, OutDest, Signals};
use nu_system::ForegroundChild;
@ -295,8 +295,7 @@ pub fn eval_arguments_from_call(
call: &Call,
) -> Result<Vec<Spanned<OsString>>, ShellError> {
let cwd = engine_state.cwd(Some(stack))?;
let eval_expression = get_eval_expression(engine_state);
let call_args = call.rest_iter_flattened(engine_state, stack, eval_expression, 1)?;
let call_args = call.rest::<Value>(engine_state, stack, 1)?;
let mut args: Vec<Spanned<OsString>> = Vec::with_capacity(call_args.len());
for arg in call_args {