From 693cb5c142699fd2fb913f80bf05e3e39450413e Mon Sep 17 00:00:00 2001 From: Antoine Stevan <44101798+amtoine@users.noreply.github.com> Date: Thu, 20 Jul 2023 21:11:20 +0200 Subject: [PATCH] add `any -> record` to `metadata` (#9755) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 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 - :green_circle: `toolkit fmt` - :green_circle: `toolkit clippy` - :black_circle: `toolkit test` - :black_circle: `toolkit test stdlib` # After Submitting --- crates/nu-command/src/debug/metadata.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nu-command/src/debug/metadata.rs b/crates/nu-command/src/debug/metadata.rs index d4c8ff8567..2faa35cd59 100644 --- a/crates/nu-command/src/debug/metadata.rs +++ b/crates/nu-command/src/debug/metadata.rs @@ -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",