Rename Value::CustomValue to Value::Custom (#12309)

# Description
The second `Value` is redundant and will consume five extra bytes on
each transmission of a custom value to/from a plugin.

# User-Facing Changes
This is a breaking change to the plugin protocol.

The [example in the protocol
reference](https://www.nushell.sh/contributor-book/plugin_protocol_reference.html#value)
becomes

```json
{
  "Custom": {
    "val": {
      "type": "PluginCustomValue",
      "name": "database",
      "data": [36, 190, 127, 40, 12, 3, 46, 83],
      "notify_on_drop": true
    },
    "span": {
      "start": 320,
      "end": 340
    }
  }
}
```

instead of 

```json
{
  "CustomValue": {
    ...
  }
}
```


# After Submitting
Update plugin protocol reference
This commit is contained in:
Stefan Holderbach
2024-03-27 22:10:56 +01:00
committed by GitHub
parent dfbbacfdf8
commit b19da158d5
48 changed files with 144 additions and 148 deletions

View File

@ -281,7 +281,7 @@ fn describe_value(
options: Options,
) -> Result<Value, ShellError> {
Ok(match value {
Value::CustomValue { val, .. } => Value::record(
Value::Custom { val, .. } => Value::record(
record!(
"type" => Value::string("custom", head),
"subtype" => Value::string(val.type_name(), head),

View File

@ -274,7 +274,7 @@ impl<'a> std::fmt::Debug for DebuggableValue<'a> {
Value::CellPath { val, .. } => {
write!(f, "CellPath({:?})", val.to_string())
}
Value::CustomValue { val, .. } => {
Value::Custom { val, .. } => {
write!(f, "CustomValue({:?})", val)
}
Value::LazyRecord { val, .. } => {