mirror of
https://github.com/nushell/nushell.git
synced 2025-08-12 01:00:29 +02:00
Remove the Value::Block
case (#12582)
# Description `Value` describes the types of first-class values that users and scripts can create, manipulate, pass around, and store. However, `Block`s are not first-class values in the language, so this PR removes it from `Value`. This removes some unnecessary code, and this change should be invisible to the user except for the change to `scope modules` described below. # User-Facing Changes Breaking change: the output of `scope modules` was changed so that `env_block` is now `has_env_block` which is a boolean value instead of a `Block`. # After Submitting Update the language guide possibly.
This commit is contained in:
@ -39,7 +39,7 @@ pub enum ToStyle {
|
||||
|
||||
/// convert an actual Nushell [`Value`] to a raw string representation of the NUON data
|
||||
///
|
||||
/// > **Note**
|
||||
/// > **Note**
|
||||
/// > a [`Span`] can be passed to [`to_nuon`] if there is context available to the caller, e.g. when
|
||||
/// > using this function in a command implementation such as [`to nuon`](https://www.nushell.sh/commands/docs/to_nuon.html).
|
||||
///
|
||||
@ -84,12 +84,6 @@ fn value_to_string(
|
||||
}
|
||||
Ok(format!("0x[{s}]"))
|
||||
}
|
||||
Value::Block { .. } => Err(ShellError::UnsupportedInput {
|
||||
msg: "blocks are currently not nuon-compatible".into(),
|
||||
input: "value originates from here".into(),
|
||||
msg_span: span,
|
||||
input_span: v.span(),
|
||||
}),
|
||||
Value::Closure { .. } => Err(ShellError::UnsupportedInput {
|
||||
msg: "closures are currently not nuon-compatible".into(),
|
||||
input: "value originates from here".into(),
|
||||
|
Reference in New Issue
Block a user