mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 12:55:47 +02:00
Track call arguments in a single list (#5125)
* Initial implementation of ordered call args * Run cargo fmt * Fix some clippy lints * Add positional len and nth * Cargo fmt * Remove more old nth calls * Good ole rustfmt * Add named len Co-authored-by: Hristo Filaretov <h.filaretov@protonmail.com>
This commit is contained in:
@ -24,13 +24,12 @@ impl EvaluatedCall {
|
||||
stack: &mut Stack,
|
||||
) -> Result<Self, ShellError> {
|
||||
let positional = call
|
||||
.positional
|
||||
.iter()
|
||||
.positional_iter()
|
||||
.map(|expr| eval_expression(engine_state, stack, expr))
|
||||
.collect::<Result<Vec<Value>, ShellError>>()?;
|
||||
|
||||
let mut named = Vec::with_capacity(call.named.len());
|
||||
for (string, expr) in call.named.iter() {
|
||||
let mut named = Vec::with_capacity(call.named_len());
|
||||
for (string, expr) in call.named_iter() {
|
||||
let value = match expr {
|
||||
None => None,
|
||||
Some(expr) => Some(eval_expression(engine_state, stack, expr)?),
|
||||
|
Reference in New Issue
Block a user