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

@ -121,15 +121,12 @@ impl CallExt for ast::Call {
starting_pos: usize,
) -> Result<Vec<T>, ShellError> {
let stack = &mut stack.use_call_arg_out_dest();
let mut output = vec![];
for result in self.rest_iter_flattened(starting_pos, |expr| {
self.rest_iter_flattened(starting_pos, |expr| {
eval_expression::<WithoutDebug>(engine_state, stack, expr)
})? {
output.push(FromValue::from_value(result)?);
}
Ok(output)
})?
.into_iter()
.map(FromValue::from_value)
.collect()
}
fn opt<T: FromValue>(