diff --git a/crates/nu-cmd-extra/src/example_test.rs b/crates/nu-cmd-extra/src/example_test.rs index af353520c..8ee7f1b1b 100644 --- a/crates/nu-cmd-extra/src/example_test.rs +++ b/crates/nu-cmd-extra/src/example_test.rs @@ -43,7 +43,6 @@ mod test_examples { &mut make_engine_state(cmd.clone_box()), &signature.input_output_types, signature.operates_on_cell_paths(), - signature.vectorizes_over_list, ), ); check_example_evaluates_to_expected_output(&example, cwd.as_path(), &mut engine_state); diff --git a/crates/nu-cmd-extra/src/extra/bits/and.rs b/crates/nu-cmd-extra/src/extra/bits/and.rs index 104cbe7de..5a3e245bd 100644 --- a/crates/nu-cmd-extra/src/extra/bits/and.rs +++ b/crates/nu-cmd-extra/src/extra/bits/and.rs @@ -22,7 +22,6 @@ impl Command for BitsAnd { Type::List(Box::new(Type::Int)), ), ]) - .vectorizes_over_list(true) .required( "target", SyntaxShape::Int, diff --git a/crates/nu-cmd-extra/src/extra/bits/not.rs b/crates/nu-cmd-extra/src/extra/bits/not.rs index 851458f95..4d21a2698 100644 --- a/crates/nu-cmd-extra/src/extra/bits/not.rs +++ b/crates/nu-cmd-extra/src/extra/bits/not.rs @@ -23,7 +23,6 @@ impl Command for BitsNot { Type::List(Box::new(Type::Int)), ), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .switch( "signed", diff --git a/crates/nu-cmd-extra/src/extra/bits/or.rs b/crates/nu-cmd-extra/src/extra/bits/or.rs index 41110e17c..037d9cd78 100644 --- a/crates/nu-cmd-extra/src/extra/bits/or.rs +++ b/crates/nu-cmd-extra/src/extra/bits/or.rs @@ -22,7 +22,6 @@ impl Command for BitsOr { Type::List(Box::new(Type::Int)), ), ]) - .vectorizes_over_list(true) .required( "target", SyntaxShape::Int, diff --git a/crates/nu-cmd-extra/src/extra/bits/rotate_left.rs b/crates/nu-cmd-extra/src/extra/bits/rotate_left.rs index 363c01042..6e9fe7480 100644 --- a/crates/nu-cmd-extra/src/extra/bits/rotate_left.rs +++ b/crates/nu-cmd-extra/src/extra/bits/rotate_left.rs @@ -25,7 +25,6 @@ impl Command for BitsRol { Type::List(Box::new(Type::Int)), ), ]) - .vectorizes_over_list(true) .required("bits", SyntaxShape::Int, "number of bits to rotate left") .switch( "signed", diff --git a/crates/nu-cmd-extra/src/extra/bits/rotate_right.rs b/crates/nu-cmd-extra/src/extra/bits/rotate_right.rs index c9f4f9ce9..f7edded5f 100644 --- a/crates/nu-cmd-extra/src/extra/bits/rotate_right.rs +++ b/crates/nu-cmd-extra/src/extra/bits/rotate_right.rs @@ -25,7 +25,6 @@ impl Command for BitsRor { Type::List(Box::new(Type::Int)), ), ]) - .vectorizes_over_list(true) .required("bits", SyntaxShape::Int, "number of bits to rotate right") .switch( "signed", diff --git a/crates/nu-cmd-extra/src/extra/bits/shift_left.rs b/crates/nu-cmd-extra/src/extra/bits/shift_left.rs index 05289b282..983513f5d 100644 --- a/crates/nu-cmd-extra/src/extra/bits/shift_left.rs +++ b/crates/nu-cmd-extra/src/extra/bits/shift_left.rs @@ -25,7 +25,6 @@ impl Command for BitsShl { Type::List(Box::new(Type::Int)), ), ]) - .vectorizes_over_list(true) .required("bits", SyntaxShape::Int, "number of bits to shift left") .switch( "signed", diff --git a/crates/nu-cmd-extra/src/extra/bits/shift_right.rs b/crates/nu-cmd-extra/src/extra/bits/shift_right.rs index f94d81829..dcb0a563e 100644 --- a/crates/nu-cmd-extra/src/extra/bits/shift_right.rs +++ b/crates/nu-cmd-extra/src/extra/bits/shift_right.rs @@ -25,7 +25,6 @@ impl Command for BitsShr { Type::List(Box::new(Type::Int)), ), ]) - .vectorizes_over_list(true) .required("bits", SyntaxShape::Int, "number of bits to shift right") .switch( "signed", diff --git a/crates/nu-cmd-extra/src/extra/bits/xor.rs b/crates/nu-cmd-extra/src/extra/bits/xor.rs index c40d5ea58..7819af433 100644 --- a/crates/nu-cmd-extra/src/extra/bits/xor.rs +++ b/crates/nu-cmd-extra/src/extra/bits/xor.rs @@ -22,7 +22,6 @@ impl Command for BitsXor { Type::List(Box::new(Type::Int)), ), ]) - .vectorizes_over_list(true) .required( "target", SyntaxShape::Int, diff --git a/crates/nu-cmd-extra/src/extra/bytes/add.rs b/crates/nu-cmd-extra/src/extra/bytes/add.rs index 1a6476248..a3aba9691 100644 --- a/crates/nu-cmd-extra/src/extra/bytes/add.rs +++ b/crates/nu-cmd-extra/src/extra/bytes/add.rs @@ -39,7 +39,6 @@ impl Command for BytesAdd { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .required("data", SyntaxShape::Binary, "the binary to add") .named( diff --git a/crates/nu-cmd-extra/src/extra/bytes/at.rs b/crates/nu-cmd-extra/src/extra/bytes/at.rs index 180d319bc..2e60c88a4 100644 --- a/crates/nu-cmd-extra/src/extra/bytes/at.rs +++ b/crates/nu-cmd-extra/src/extra/bytes/at.rs @@ -46,7 +46,6 @@ impl Command for BytesAt { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .required("range", SyntaxShape::Range, "the range to get bytes") .rest( "rest", diff --git a/crates/nu-cmd-extra/src/extra/bytes/length.rs b/crates/nu-cmd-extra/src/extra/bytes/length.rs index 11e22eb1c..bfca8fd6d 100644 --- a/crates/nu-cmd-extra/src/extra/bytes/length.rs +++ b/crates/nu-cmd-extra/src/extra/bytes/length.rs @@ -26,7 +26,6 @@ impl Command for BytesLen { (Type::Record(vec![]), Type::Record(vec![])), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .rest( "rest", SyntaxShape::CellPath, diff --git a/crates/nu-cmd-extra/src/extra/math/arccos.rs b/crates/nu-cmd-extra/src/extra/math/arccos.rs index 7be63d6a5..3798cea75 100644 --- a/crates/nu-cmd-extra/src/extra/math/arccos.rs +++ b/crates/nu-cmd-extra/src/extra/math/arccos.rs @@ -21,7 +21,6 @@ impl Command for SubCommand { ), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/math/arccosh.rs b/crates/nu-cmd-extra/src/extra/math/arccosh.rs index 277a76dcd..70acfcb6a 100644 --- a/crates/nu-cmd-extra/src/extra/math/arccosh.rs +++ b/crates/nu-cmd-extra/src/extra/math/arccosh.rs @@ -20,7 +20,6 @@ impl Command for SubCommand { ), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/math/arcsin.rs b/crates/nu-cmd-extra/src/extra/math/arcsin.rs index 501793c63..774a4e76b 100644 --- a/crates/nu-cmd-extra/src/extra/math/arcsin.rs +++ b/crates/nu-cmd-extra/src/extra/math/arcsin.rs @@ -21,7 +21,6 @@ impl Command for SubCommand { ), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/math/arcsinh.rs b/crates/nu-cmd-extra/src/extra/math/arcsinh.rs index 719671e48..72665a4cf 100644 --- a/crates/nu-cmd-extra/src/extra/math/arcsinh.rs +++ b/crates/nu-cmd-extra/src/extra/math/arcsinh.rs @@ -20,7 +20,6 @@ impl Command for SubCommand { ), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/math/arctan.rs b/crates/nu-cmd-extra/src/extra/math/arctan.rs index 284a6b8a5..40d7f8927 100644 --- a/crates/nu-cmd-extra/src/extra/math/arctan.rs +++ b/crates/nu-cmd-extra/src/extra/math/arctan.rs @@ -21,7 +21,6 @@ impl Command for SubCommand { ), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/math/arctanh.rs b/crates/nu-cmd-extra/src/extra/math/arctanh.rs index 716cf8e33..9082cd051 100644 --- a/crates/nu-cmd-extra/src/extra/math/arctanh.rs +++ b/crates/nu-cmd-extra/src/extra/math/arctanh.rs @@ -20,7 +20,6 @@ impl Command for SubCommand { ), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/math/cos.rs b/crates/nu-cmd-extra/src/extra/math/cos.rs index 96486431c..a7d899e47 100644 --- a/crates/nu-cmd-extra/src/extra/math/cos.rs +++ b/crates/nu-cmd-extra/src/extra/math/cos.rs @@ -20,7 +20,6 @@ impl Command for SubCommand { Type::List(Box::new(Type::Float)), ), ]) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/math/cosh.rs b/crates/nu-cmd-extra/src/extra/math/cosh.rs index 23f4d72b8..dcfd854e4 100644 --- a/crates/nu-cmd-extra/src/extra/math/cosh.rs +++ b/crates/nu-cmd-extra/src/extra/math/cosh.rs @@ -20,7 +20,6 @@ impl Command for SubCommand { ), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/math/exp.rs b/crates/nu-cmd-extra/src/extra/math/exp.rs index 75fb15646..5b7aa0cb3 100644 --- a/crates/nu-cmd-extra/src/extra/math/exp.rs +++ b/crates/nu-cmd-extra/src/extra/math/exp.rs @@ -20,7 +20,6 @@ impl Command for SubCommand { ), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/math/ln.rs b/crates/nu-cmd-extra/src/extra/math/ln.rs index d93e94080..b6ce3ba30 100644 --- a/crates/nu-cmd-extra/src/extra/math/ln.rs +++ b/crates/nu-cmd-extra/src/extra/math/ln.rs @@ -20,7 +20,6 @@ impl Command for SubCommand { ), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/math/sin.rs b/crates/nu-cmd-extra/src/extra/math/sin.rs index 276163eb0..95b799493 100644 --- a/crates/nu-cmd-extra/src/extra/math/sin.rs +++ b/crates/nu-cmd-extra/src/extra/math/sin.rs @@ -20,7 +20,6 @@ impl Command for SubCommand { Type::List(Box::new(Type::Float)), ), ]) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/math/sinh.rs b/crates/nu-cmd-extra/src/extra/math/sinh.rs index 24a755172..490ac3910 100644 --- a/crates/nu-cmd-extra/src/extra/math/sinh.rs +++ b/crates/nu-cmd-extra/src/extra/math/sinh.rs @@ -20,7 +20,6 @@ impl Command for SubCommand { ), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/math/tan.rs b/crates/nu-cmd-extra/src/extra/math/tan.rs index 65b8b6138..7470ef3a7 100644 --- a/crates/nu-cmd-extra/src/extra/math/tan.rs +++ b/crates/nu-cmd-extra/src/extra/math/tan.rs @@ -20,7 +20,6 @@ impl Command for SubCommand { Type::List(Box::new(Type::Float)), ), ]) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/math/tanh.rs b/crates/nu-cmd-extra/src/extra/math/tanh.rs index 2f4f99cbf..0dbf6413f 100644 --- a/crates/nu-cmd-extra/src/extra/math/tanh.rs +++ b/crates/nu-cmd-extra/src/extra/math/tanh.rs @@ -20,7 +20,6 @@ impl Command for SubCommand { ), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-cmd-extra/src/extra/platform/ansi/gradient.rs b/crates/nu-cmd-extra/src/extra/platform/ansi/gradient.rs index 2bf71eb89..ba9cd34e5 100644 --- a/crates/nu-cmd-extra/src/extra/platform/ansi/gradient.rs +++ b/crates/nu-cmd-extra/src/extra/platform/ansi/gradient.rs @@ -53,7 +53,6 @@ impl Command for SubCommand { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .category(Category::Platform) } diff --git a/crates/nu-cmd-extra/src/extra/platform/ansi/link.rs b/crates/nu-cmd-extra/src/extra/platform/ansi/link.rs index a5505d66b..8d577de51 100644 --- a/crates/nu-cmd-extra/src/extra/platform/ansi/link.rs +++ b/crates/nu-cmd-extra/src/extra/platform/ansi/link.rs @@ -39,7 +39,6 @@ impl Command for SubCommand { SyntaxShape::CellPath, "for a data structure input, add links to all strings at the given cell paths", ) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .category(Category::Platform) } diff --git a/crates/nu-cmd-extra/src/extra/strings/encode_decode/decode_hex.rs b/crates/nu-cmd-extra/src/extra/strings/encode_decode/decode_hex.rs index 1bba8c65a..47cad4627 100644 --- a/crates/nu-cmd-extra/src/extra/strings/encode_decode/decode_hex.rs +++ b/crates/nu-cmd-extra/src/extra/strings/encode_decode/decode_hex.rs @@ -25,7 +25,6 @@ impl Command for DecodeHex { (Type::Record(vec![]), Type::Record(vec![])), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .rest( "rest", SyntaxShape::CellPath, diff --git a/crates/nu-cmd-extra/src/extra/strings/encode_decode/encode_hex.rs b/crates/nu-cmd-extra/src/extra/strings/encode_decode/encode_hex.rs index e0629684d..80681e30f 100644 --- a/crates/nu-cmd-extra/src/extra/strings/encode_decode/encode_hex.rs +++ b/crates/nu-cmd-extra/src/extra/strings/encode_decode/encode_hex.rs @@ -25,7 +25,6 @@ impl Command for EncodeHex { (Type::Record(vec![]), Type::Record(vec![])), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .rest( "rest", SyntaxShape::CellPath, diff --git a/crates/nu-cmd-lang/src/example_support.rs b/crates/nu-cmd-lang/src/example_support.rs index aac09d98a..5076ad6bb 100644 --- a/crates/nu-cmd-lang/src/example_support.rs +++ b/crates/nu-cmd-lang/src/example_support.rs @@ -12,7 +12,6 @@ pub fn check_example_input_and_output_types_match_command_signature( engine_state: &mut Box, signature_input_output_types: &Vec<(Type, Type)>, signature_operates_on_cell_paths: bool, - signature_vectorizes_over_list: bool, ) -> HashSet<(Type, Type)> { let mut witnessed_type_transformations = HashSet::<(Type, Type)>::new(); @@ -37,40 +36,6 @@ pub fn check_example_input_and_output_types_match_command_signature( } }); - // The example type checks as vectorization over an input list if both: - // 1. The command is declared to vectorize over list input. - // 2. There exists an entry t -> u in the type map such that the - // example_input_type is a subtype of list and the - // example_output_type is a subtype of list. - let example_matches_signature_via_vectorization_over_list = - signature_vectorizes_over_list - && match &example_input_type { - Type::List(ex_in_type) => { - match signature_input_output_types.iter().find_map( - |(sig_in_type, sig_out_type)| { - if ex_in_type.is_subtype(sig_in_type) { - Some((sig_in_type, sig_out_type)) - } else { - None - } - }, - ) { - Some((sig_in_type, sig_out_type)) => match &example_output_type { - Type::List(ex_out_type) - if ex_out_type.is_subtype(sig_out_type) => - { - witnessed_type_transformations - .insert((sig_in_type.clone(), sig_out_type.clone())); - true - } - _ => false, - }, - None => false, - } - } - _ => false, - }; - // The example type checks as a cell path operation if both: // 1. The command is declared to operate on cell paths. // 2. The example_input_type is list or record or table, and the example @@ -80,22 +45,22 @@ pub fn check_example_input_and_output_types_match_command_signature( // TODO: This is too permissive; it should make use of the signature.input_output_types at least. && example_output_type.to_shape() == example_input_type.to_shape(); - if !(example_matches_signature - || example_matches_signature_via_vectorization_over_list - || example_matches_signature_via_cell_path_operation) - { + if !(example_matches_signature || example_matches_signature_via_cell_path_operation) { panic!( - "The example `{}` demonstrates a transformation of type {:?} -> {:?}. \ + "The example `{}` demonstrates a transformation of type {:?} -> {:?}. \ However, this does not match the declared signature: {:?}.{} \ - For this command, `vectorizes_over_list` is {} and `operates_on_cell_paths()` is {}.", - example.example, - example_input_type, - example_output_type, - signature_input_output_types, - if signature_input_output_types.is_empty() { " (Did you forget to declare the input and output types for the command?)" } else { "" }, - signature_vectorizes_over_list, - signature_operates_on_cell_paths - ); + For this command `operates_on_cell_paths()` is {}.", + example.example, + example_input_type, + example_output_type, + signature_input_output_types, + if signature_input_output_types.is_empty() { + " (Did you forget to declare the input and output types for the command?)" + } else { + "" + }, + signature_operates_on_cell_paths + ); }; }; } diff --git a/crates/nu-cmd-lang/src/example_test.rs b/crates/nu-cmd-lang/src/example_test.rs index 336cf38a1..fa74059f9 100644 --- a/crates/nu-cmd-lang/src/example_test.rs +++ b/crates/nu-cmd-lang/src/example_test.rs @@ -43,7 +43,6 @@ mod test_examples { &mut make_engine_state(cmd.clone_box()), &signature.input_output_types, signature.operates_on_cell_paths(), - signature.vectorizes_over_list, ), ); check_example_evaluates_to_expected_output(&example, cwd.as_path(), &mut engine_state); diff --git a/crates/nu-command/src/conversions/fill.rs b/crates/nu-command/src/conversions/fill.rs index 4572621d4..94205ebb6 100644 --- a/crates/nu-command/src/conversions/fill.rs +++ b/crates/nu-command/src/conversions/fill.rs @@ -54,7 +54,6 @@ impl Command for Fill { // General case for heterogeneous lists (Type::List(Box::new(Type::Any)), Type::List(Box::new(Type::String))), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .named( "width", diff --git a/crates/nu-command/src/conversions/into/filesize.rs b/crates/nu-command/src/conversions/into/filesize.rs index 3f97e8625..92b911057 100644 --- a/crates/nu-command/src/conversions/into/filesize.rs +++ b/crates/nu-command/src/conversions/into/filesize.rs @@ -46,7 +46,6 @@ impl Command for SubCommand { ), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .rest( "rest", SyntaxShape::CellPath, diff --git a/crates/nu-command/src/conversions/into/int.rs b/crates/nu-command/src/conversions/into/int.rs index bf4d9c112..f03c8e36c 100644 --- a/crates/nu-command/src/conversions/into/int.rs +++ b/crates/nu-command/src/conversions/into/int.rs @@ -70,7 +70,6 @@ impl Command for SubCommand { Type::List(Box::new(Type::Int)), ), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .named("radix", SyntaxShape::Number, "radix of integer", Some('r')) .switch("little-endian", "use little-endian byte decoding", None) diff --git a/crates/nu-command/src/example_test.rs b/crates/nu-command/src/example_test.rs index 121ee7679..5026d1a13 100644 --- a/crates/nu-command/src/example_test.rs +++ b/crates/nu-command/src/example_test.rs @@ -46,7 +46,6 @@ mod test_examples { &mut make_engine_state(cmd.clone_box()), &signature.input_output_types, signature.operates_on_cell_paths(), - signature.vectorizes_over_list, ), ); check_example_evaluates_to_expected_output(&example, cwd.as_path(), &mut engine_state); diff --git a/crates/nu-command/src/math/abs.rs b/crates/nu-command/src/math/abs.rs index 2eeecb30b..574a6b3bf 100644 --- a/crates/nu-command/src/math/abs.rs +++ b/crates/nu-command/src/math/abs.rs @@ -19,7 +19,6 @@ impl Command for SubCommand { Type::List(Box::new(Type::Number)), ), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .category(Category::Math) } diff --git a/crates/nu-command/src/math/ceil.rs b/crates/nu-command/src/math/ceil.rs index ae7f18173..2dd26f769 100644 --- a/crates/nu-command/src/math/ceil.rs +++ b/crates/nu-command/src/math/ceil.rs @@ -19,7 +19,6 @@ impl Command for SubCommand { Type::List(Box::new(Type::Number)), ), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .category(Category::Math) } diff --git a/crates/nu-command/src/math/floor.rs b/crates/nu-command/src/math/floor.rs index 5625417bf..beab1159e 100644 --- a/crates/nu-command/src/math/floor.rs +++ b/crates/nu-command/src/math/floor.rs @@ -19,7 +19,6 @@ impl Command for SubCommand { Type::List(Box::new(Type::Number)), ), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .category(Category::Math) } diff --git a/crates/nu-command/src/math/log.rs b/crates/nu-command/src/math/log.rs index 1276b8d17..dcc91e694 100644 --- a/crates/nu-command/src/math/log.rs +++ b/crates/nu-command/src/math/log.rs @@ -29,7 +29,6 @@ impl Command for SubCommand { ), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .category(Category::Math) } diff --git a/crates/nu-command/src/math/round.rs b/crates/nu-command/src/math/round.rs index aee5f54c2..ebe60b23d 100644 --- a/crates/nu-command/src/math/round.rs +++ b/crates/nu-command/src/math/round.rs @@ -22,7 +22,6 @@ impl Command for SubCommand { Type::List(Box::new(Type::Number)), ), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .named( "precision", diff --git a/crates/nu-command/src/math/sqrt.rs b/crates/nu-command/src/math/sqrt.rs index f67f42b06..85b3134ff 100644 --- a/crates/nu-command/src/math/sqrt.rs +++ b/crates/nu-command/src/math/sqrt.rs @@ -19,7 +19,6 @@ impl Command for SubCommand { Type::List(Box::new(Type::Number)), ), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .category(Category::Math) } diff --git a/crates/nu-command/src/network/url/encode.rs b/crates/nu-command/src/network/url/encode.rs index 5fb8627d8..df1596923 100644 --- a/crates/nu-command/src/network/url/encode.rs +++ b/crates/nu-command/src/network/url/encode.rs @@ -24,7 +24,6 @@ impl Command for SubCommand { (Type::Record(vec![]), Type::Record(vec![])), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .switch( "all", "encode all non-alphanumeric chars including `/`, `.`, `:`", diff --git a/crates/nu-command/src/strings/encode_decode/decode_base64.rs b/crates/nu-command/src/strings/encode_decode/decode_base64.rs index 27dcd72ad..7ef209f3a 100644 --- a/crates/nu-command/src/strings/encode_decode/decode_base64.rs +++ b/crates/nu-command/src/strings/encode_decode/decode_base64.rs @@ -29,7 +29,6 @@ impl Command for DecodeBase64 { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .named( "character-set", diff --git a/crates/nu-command/src/strings/encode_decode/encode_base64.rs b/crates/nu-command/src/strings/encode_decode/encode_base64.rs index 91adaf9a1..b38476c65 100644 --- a/crates/nu-command/src/strings/encode_decode/encode_base64.rs +++ b/crates/nu-command/src/strings/encode_decode/encode_base64.rs @@ -35,7 +35,6 @@ impl Command for EncodeBase64 { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .named( "character-set", diff --git a/crates/nu-command/src/strings/split/row.rs b/crates/nu-command/src/strings/split/row.rs index 2ee5c83fb..71cc0bc7c 100644 --- a/crates/nu-command/src/strings/split/row.rs +++ b/crates/nu-command/src/strings/split/row.rs @@ -20,7 +20,6 @@ impl Command for SubCommand { (Type::String, Type::List(Box::new(Type::String))), (Type::List(Box::new(Type::String)), Type::Table(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .required( "separator", diff --git a/crates/nu-command/src/strings/str_/case/camel_case.rs b/crates/nu-command/src/strings/str_/case/camel_case.rs index 982bdc08d..725ee2ce8 100644 --- a/crates/nu-command/src/strings/str_/case/camel_case.rs +++ b/crates/nu-command/src/strings/str_/case/camel_case.rs @@ -26,7 +26,6 @@ impl Command for SubCommand { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .rest( "rest", diff --git a/crates/nu-command/src/strings/str_/case/capitalize.rs b/crates/nu-command/src/strings/str_/case/capitalize.rs index 21411041b..2f105a85e 100644 --- a/crates/nu-command/src/strings/str_/case/capitalize.rs +++ b/crates/nu-command/src/strings/str_/case/capitalize.rs @@ -24,7 +24,6 @@ impl Command for SubCommand { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .rest( "rest", diff --git a/crates/nu-command/src/strings/str_/case/downcase.rs b/crates/nu-command/src/strings/str_/case/downcase.rs index 3405b4e53..4bfbe6968 100644 --- a/crates/nu-command/src/strings/str_/case/downcase.rs +++ b/crates/nu-command/src/strings/str_/case/downcase.rs @@ -24,7 +24,6 @@ impl Command for SubCommand { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .rest( "rest", diff --git a/crates/nu-command/src/strings/str_/case/kebab_case.rs b/crates/nu-command/src/strings/str_/case/kebab_case.rs index 613d1207d..b33fe2414 100644 --- a/crates/nu-command/src/strings/str_/case/kebab_case.rs +++ b/crates/nu-command/src/strings/str_/case/kebab_case.rs @@ -26,7 +26,6 @@ impl Command for SubCommand { Type::List(Box::new(Type::String)), ), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .rest( "rest", diff --git a/crates/nu-command/src/strings/str_/case/pascal_case.rs b/crates/nu-command/src/strings/str_/case/pascal_case.rs index cdcf6b5e5..29bfa974b 100644 --- a/crates/nu-command/src/strings/str_/case/pascal_case.rs +++ b/crates/nu-command/src/strings/str_/case/pascal_case.rs @@ -26,7 +26,6 @@ impl Command for SubCommand { Type::List(Box::new(Type::String)), ), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .rest( "rest", diff --git a/crates/nu-command/src/strings/str_/case/screaming_snake_case.rs b/crates/nu-command/src/strings/str_/case/screaming_snake_case.rs index 9423fe446..97dea2277 100644 --- a/crates/nu-command/src/strings/str_/case/screaming_snake_case.rs +++ b/crates/nu-command/src/strings/str_/case/screaming_snake_case.rs @@ -25,7 +25,6 @@ impl Command for SubCommand { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .rest( "rest", diff --git a/crates/nu-command/src/strings/str_/case/snake_case.rs b/crates/nu-command/src/strings/str_/case/snake_case.rs index 00a5fd403..16b3bd977 100644 --- a/crates/nu-command/src/strings/str_/case/snake_case.rs +++ b/crates/nu-command/src/strings/str_/case/snake_case.rs @@ -25,7 +25,6 @@ impl Command for SubCommand { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .rest( "rest", diff --git a/crates/nu-command/src/strings/str_/case/title_case.rs b/crates/nu-command/src/strings/str_/case/title_case.rs index 4ed50f5b1..67968ae01 100644 --- a/crates/nu-command/src/strings/str_/case/title_case.rs +++ b/crates/nu-command/src/strings/str_/case/title_case.rs @@ -26,7 +26,6 @@ impl Command for SubCommand { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .rest( "rest", diff --git a/crates/nu-command/src/strings/str_/case/upcase.rs b/crates/nu-command/src/strings/str_/case/upcase.rs index 9154b0c28..a4d580502 100644 --- a/crates/nu-command/src/strings/str_/case/upcase.rs +++ b/crates/nu-command/src/strings/str_/case/upcase.rs @@ -23,7 +23,6 @@ impl Command for SubCommand { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .rest( "rest", diff --git a/crates/nu-command/src/strings/str_/contains.rs b/crates/nu-command/src/strings/str_/contains.rs index eebb9cf95..e9ddf3eb8 100644 --- a/crates/nu-command/src/strings/str_/contains.rs +++ b/crates/nu-command/src/strings/str_/contains.rs @@ -36,7 +36,6 @@ impl Command for SubCommand { (Type::Record(vec![]), Type::Record(vec![])), (Type::List(Box::new(Type::String)), Type::List(Box::new(Type::Bool))) ]) - .vectorizes_over_list(true) .required("string", SyntaxShape::String, "the substring to find") .rest( "rest", diff --git a/crates/nu-command/src/strings/str_/ends_with.rs b/crates/nu-command/src/strings/str_/ends_with.rs index a93027a7e..e3d8311bc 100644 --- a/crates/nu-command/src/strings/str_/ends_with.rs +++ b/crates/nu-command/src/strings/str_/ends_with.rs @@ -35,7 +35,6 @@ impl Command for SubCommand { (Type::Record(vec![]), Type::Record(vec![])), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .required("string", SyntaxShape::String, "the string to match") .rest( "rest", diff --git a/crates/nu-command/src/strings/str_/expand.rs b/crates/nu-command/src/strings/str_/expand.rs index 15a6d2c73..de11f10c4 100644 --- a/crates/nu-command/src/strings/str_/expand.rs +++ b/crates/nu-command/src/strings/str_/expand.rs @@ -29,7 +29,6 @@ impl Command for SubCommand { Type::List(Box::new(Type::List(Box::new(Type::String)))), ), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .category(Category::Strings) } diff --git a/crates/nu-command/src/strings/str_/index_of.rs b/crates/nu-command/src/strings/str_/index_of.rs index 51179217a..3b9f877b4 100644 --- a/crates/nu-command/src/strings/str_/index_of.rs +++ b/crates/nu-command/src/strings/str_/index_of.rs @@ -43,7 +43,6 @@ impl Command for SubCommand { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) // TODO: no test coverage .allow_variants_without_examples(true) .required("string", SyntaxShape::String, "the string to find in the input") .switch( diff --git a/crates/nu-command/src/strings/str_/length.rs b/crates/nu-command/src/strings/str_/length.rs index 98a49aea0..5f08a7dd7 100644 --- a/crates/nu-command/src/strings/str_/length.rs +++ b/crates/nu-command/src/strings/str_/length.rs @@ -36,7 +36,6 @@ impl Command for SubCommand { (Type::Record(vec![]), Type::Record(vec![])), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .switch( "grapheme-clusters", "count length using grapheme clusters (all visible chars have length 1)", diff --git a/crates/nu-command/src/strings/str_/replace.rs b/crates/nu-command/src/strings/str_/replace.rs index 22fa3b467..80d4060ea 100644 --- a/crates/nu-command/src/strings/str_/replace.rs +++ b/crates/nu-command/src/strings/str_/replace.rs @@ -44,7 +44,6 @@ impl Command for SubCommand { Type::List(Box::new(Type::String)), ), ]) - .vectorizes_over_list(true) .required("find", SyntaxShape::String, "the pattern to find") .required("replace", SyntaxShape::String, "the replacement string") .rest( diff --git a/crates/nu-command/src/strings/str_/reverse.rs b/crates/nu-command/src/strings/str_/reverse.rs index 18c9d59c0..f3fa11cb9 100644 --- a/crates/nu-command/src/strings/str_/reverse.rs +++ b/crates/nu-command/src/strings/str_/reverse.rs @@ -26,7 +26,6 @@ impl Command for SubCommand { (Type::Record(vec![]), Type::Record(vec![])), ]) .allow_variants_without_examples(true) - .vectorizes_over_list(true) .rest( "rest", SyntaxShape::CellPath, diff --git a/crates/nu-command/src/strings/str_/starts_with.rs b/crates/nu-command/src/strings/str_/starts_with.rs index 72541dc9f..9a44551b9 100644 --- a/crates/nu-command/src/strings/str_/starts_with.rs +++ b/crates/nu-command/src/strings/str_/starts_with.rs @@ -36,7 +36,6 @@ impl Command for SubCommand { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .required("string", SyntaxShape::String, "the string to match") .rest( diff --git a/crates/nu-command/src/strings/str_/substring.rs b/crates/nu-command/src/strings/str_/substring.rs index 0058ff946..44843e831 100644 --- a/crates/nu-command/src/strings/str_/substring.rs +++ b/crates/nu-command/src/strings/str_/substring.rs @@ -48,7 +48,6 @@ impl Command for SubCommand { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .switch( "grapheme-clusters", diff --git a/crates/nu-command/src/strings/str_/trim/trim_.rs b/crates/nu-command/src/strings/str_/trim/trim_.rs index 3b06d2c9f..9fb994a0e 100644 --- a/crates/nu-command/src/strings/str_/trim/trim_.rs +++ b/crates/nu-command/src/strings/str_/trim/trim_.rs @@ -44,7 +44,6 @@ impl Command for SubCommand { (Type::Table(vec![]), Type::Table(vec![])), (Type::Record(vec![]), Type::Record(vec![])), ]) - .vectorizes_over_list(true) .allow_variants_without_examples(true) .rest( "rest", diff --git a/crates/nu-protocol/src/plugin_signature.rs b/crates/nu-protocol/src/plugin_signature.rs index 5c9dd0699..b4ac8deb4 100644 --- a/crates/nu-protocol/src/plugin_signature.rs +++ b/crates/nu-protocol/src/plugin_signature.rs @@ -143,11 +143,6 @@ impl PluginSignature { self } - pub fn vectorizes_over_list(mut self, vectorizes_over_list: bool) -> PluginSignature { - self.sig = self.sig.vectorizes_over_list(vectorizes_over_list); - self - } - /// Set the input-output type signature variants of the command pub fn input_output_types(mut self, input_output_types: Vec<(Type, Type)>) -> PluginSignature { self.sig = self.sig.input_output_types(input_output_types); diff --git a/crates/nu-protocol/src/signature.rs b/crates/nu-protocol/src/signature.rs index 99026397d..ad2b65f7f 100644 --- a/crates/nu-protocol/src/signature.rs +++ b/crates/nu-protocol/src/signature.rs @@ -112,7 +112,6 @@ pub struct Signature { pub required_positional: Vec, pub optional_positional: Vec, pub rest_positional: Option, - pub vectorizes_over_list: bool, pub named: Vec, pub input_output_types: Vec<(Type, Type)>, pub allow_variants_without_examples: bool, @@ -212,7 +211,6 @@ impl Signature { required_positional: vec![], optional_positional: vec![], rest_positional: None, - vectorizes_over_list: false, input_output_types: vec![], allow_variants_without_examples: false, named: vec![], @@ -464,11 +462,6 @@ impl Signature { self } - pub fn vectorizes_over_list(mut self, vectorizes_over_list: bool) -> Signature { - self.vectorizes_over_list = vectorizes_over_list; - self - } - /// Set the input-output type signature variants of the command pub fn input_output_types(mut self, input_output_types: Vec<(Type, Type)>) -> Signature { self.input_output_types = input_output_types;