From cf5b2aeb888dcc263a54b30e6baa0974fafb0bb0 Mon Sep 17 00:00:00 2001 From: Douglas <32344964+NotTheDr01ds@users.noreply.github.com> Date: Wed, 2 Oct 2024 02:11:07 -0400 Subject: [PATCH] Update wrap example (#13986) # Description As with #13985, credit to @AlifianK for suggesting this in https://github.com/nushell/nushell.github.io/pull/1572 Updates the example in `wrap` to not use 1-based, sequential numbers. # User-Facing Changes Help/doc only # Tests + Formatting - :green_circle: `toolkit fmt` - :green_circle: `toolkit clippy` - :green_circle: `toolkit test` - :green_circle: `toolkit test stdlib` # After Submitting N/A --- crates/nu-command/src/filters/wrap.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/crates/nu-command/src/filters/wrap.rs b/crates/nu-command/src/filters/wrap.rs index 6988c09f9a..f30b110803 100644 --- a/crates/nu-command/src/filters/wrap.rs +++ b/crates/nu-command/src/filters/wrap.rs @@ -57,31 +57,34 @@ impl Command for Wrap { vec![ Example { description: "Wrap a list into a table with a given column name", - example: "[1 2 3] | wrap num", + example: "[ Pachisi Mahjong Catan Carcassonne ] | wrap game", result: Some(Value::test_list(vec![ Value::test_record(record! { - "num" => Value::test_int(1), + "game" => Value::test_string("Pachisi"), }), Value::test_record(record! { - "num" => Value::test_int(2), + "game" => Value::test_string("Mahjong"), }), Value::test_record(record! { - "num" => Value::test_int(3), + "game" => Value::test_string("Catan"), + }), + Value::test_record(record! { + "game" => Value::test_string("Carcassonne"), }), ])), }, Example { description: "Wrap a range into a table with a given column name", - example: "1..3 | wrap num", + example: "4..6 | wrap num", result: Some(Value::test_list(vec![ Value::test_record(record! { - "num" => Value::test_int(1), + "num" => Value::test_int(4), }), Value::test_record(record! { - "num" => Value::test_int(2), + "num" => Value::test_int(5), }), Value::test_record(record! { - "num" => Value::test_int(3), + "num" => Value::test_int(6), }), ])), },