mirror of
https://github.com/nushell/nushell.git
synced 2025-07-07 10:01:26 +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:
@ -57,13 +57,18 @@ impl Command for Mkdir {
|
||||
}
|
||||
|
||||
for (i, dir) in directories.enumerate() {
|
||||
let span = call.positional[i].span;
|
||||
let span = call
|
||||
.positional_nth(i)
|
||||
.expect("already checked through directories")
|
||||
.span;
|
||||
let dir_res = std::fs::create_dir_all(&dir);
|
||||
|
||||
if let Err(reason) = dir_res {
|
||||
return Err(ShellError::CreateNotPossible(
|
||||
format!("failed to create directory: {}", reason),
|
||||
call.positional[i].span,
|
||||
call.positional_nth(i)
|
||||
.expect("already checked through directories")
|
||||
.span,
|
||||
));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user