mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 17:01:49 +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:
@ -198,18 +198,15 @@ fn action(input: &Value, arg: &Arguments, head: Span) -> Value {
|
||||
}
|
||||
_ => input.clone(),
|
||||
},
|
||||
ActionMode::Local => {
|
||||
Value::error(
|
||||
ShellError::UnsupportedInput(
|
||||
"Only string values are supported".into(),
|
||||
format!("input type: {:?}", other.get_type()),
|
||||
head,
|
||||
// This line requires the Value::Error match above.
|
||||
other.span(),
|
||||
),
|
||||
head,
|
||||
)
|
||||
}
|
||||
ActionMode::Local => Value::error(
|
||||
ShellError::UnsupportedInput {
|
||||
msg: "Only string 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