forked from extern/nushell
Reuse Closure
type in Value::Closure
(#10894)
# Description Reuses the existing `Closure` type in `Value::Closure`. This will help with the span refactoring for `Value`. Additionally, this allows us to more easily box or unbox the `Closure` case should we chose to do so in the future. # User-Facing Changes Breaking API change for `nu_protocol`.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
use nu_protocol::{
|
||||
ast::Call,
|
||||
engine::{Command, EngineState, Stack, StateWorkingSet},
|
||||
engine::{Closure, Command, EngineState, Stack, StateWorkingSet},
|
||||
record, Category, Example, IntoPipelineData, PipelineData, PipelineMetadata, Record,
|
||||
ShellError, Signature, Type, Value,
|
||||
};
|
||||
@ -328,7 +328,11 @@ fn describe_value(
|
||||
),
|
||||
head,
|
||||
),
|
||||
Value::Block { val, .. } | Value::Closure { val, .. } => {
|
||||
Value::Block { val, .. }
|
||||
| Value::Closure {
|
||||
val: Closure { block_id: val, .. },
|
||||
..
|
||||
} => {
|
||||
let block = engine_state.map(|engine_state| engine_state.get_block(val));
|
||||
|
||||
if let Some(block) = block {
|
||||
|
Reference in New Issue
Block a user