mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 03:38:07 +02:00
Convert ShellError::UnsupportedInput to named fields (#10971)
# Description This is easy to do with rust-analyzer, but I didn't want to just pump these all out without feedback. Part of #10700 # User-Facing Changes None # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting N/A --------- Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
@ -176,13 +176,12 @@ fn action(input: &Value, args: &Arguments, head: Span) -> Value {
|
||||
Value::Error { .. } => input.clone(),
|
||||
|
||||
other => Value::error(
|
||||
ShellError::UnsupportedInput(
|
||||
"Only binary values are supported".into(),
|
||||
format!("input type: {:?}", other.get_type()),
|
||||
head,
|
||||
// This line requires the Value::Error match above.
|
||||
other.span(),
|
||||
),
|
||||
ShellError::UnsupportedInput {
|
||||
msg: "Only binary values are supported".into(),
|
||||
input: format!("input type: {:?}", other.get_type()),
|
||||
msg_span: head,
|
||||
input_span: other.span(),
|
||||
},
|
||||
head,
|
||||
),
|
||||
}
|
||||
|
Reference in New Issue
Block a user