mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 22:54:24 +02:00
Fix to nuon --serialize
of closure (#15357)
# Description Closes #15351 Adds quotes that were missed in #14698 with the proper escaping. # User-Facing Changes `to nuon --serialize` will now produce a quoted string instead of illegal nuon when given a closure # Tests + Formatting Reenable the `to nuon` rejection of closures in the base state test. Added test for quoting.
This commit is contained in:
committed by
GitHub
parent
2ea2a904e8
commit
7a6cfa24fc
@ -99,7 +99,9 @@ fn value_to_string(
|
||||
}
|
||||
Value::Closure { val, .. } => {
|
||||
if serialize_types {
|
||||
Ok(val.coerce_into_string(engine_state, span)?.to_string())
|
||||
Ok(escape_quote_string(
|
||||
&val.coerce_into_string(engine_state, span)?,
|
||||
))
|
||||
} else {
|
||||
Err(ShellError::UnsupportedInput {
|
||||
msg: "closures are currently not deserializable (use --serialize to serialize as a string)".into(),
|
||||
|
Reference in New Issue
Block a user