add any -> record to metadata (#9755)

# Description
in the help page of `metadata`, there is the following example
```nushell
ls | metadata
```
which gives the following error
```
Error: nu::parser::input_type_mismatch

  × Command does not support table input.
   ╭─[entry #2:1:1]
 1 │ ls | metadata
   ·      ────┬───
   ·          ╰── command doesn't support table input
   ╰────
```

this PR adds `any -> record` to the signatures of `metadata` to allow
the use of that kind of example.

# User-Facing Changes
`ls | metadata` will work again

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
-  `toolkit test`
-  `toolkit test stdlib`

# After Submitting
This commit is contained in:
Antoine Stevan 2023-07-20 21:11:20 +02:00 committed by GitHub
parent d104efdf68
commit 693cb5c142
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ impl Command for Metadata {
fn signature(&self) -> nu_protocol::Signature {
Signature::build("metadata")
.input_output_types(vec![(Type::Nothing, Type::Record(vec![]))])
.input_output_types(vec![(Type::Any, Type::Record(vec![]))])
.allow_variants_without_examples(true)
.optional(
"expression",