mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 23:58:06 +02:00
Remove usages of Call::positional_nth
(#12871)
# Description Following from #12867, this PR replaces usages of `Call::positional_nth` with existing spans. This removes several `expect`s from the code. Also remove unused `positional_nth_mut` and `positional_iter_mut`
This commit is contained in:
10
crates/nu-command/src/env/with_env.rs
vendored
10
crates/nu-command/src/env/with_env.rs
vendored
@ -90,10 +90,7 @@ fn with_env(
|
||||
return Err(ShellError::CantConvert {
|
||||
to_type: "record".into(),
|
||||
from_type: x.get_type().to_string(),
|
||||
span: call
|
||||
.positional_nth(1)
|
||||
.expect("already checked through .req")
|
||||
.span,
|
||||
span: x.span(),
|
||||
help: None,
|
||||
});
|
||||
}
|
||||
@ -124,10 +121,7 @@ fn with_env(
|
||||
return Err(ShellError::CantConvert {
|
||||
to_type: "record".into(),
|
||||
from_type: x.get_type().to_string(),
|
||||
span: call
|
||||
.positional_nth(1)
|
||||
.expect("already checked through .req")
|
||||
.span,
|
||||
span: x.span(),
|
||||
help: None,
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user