From c2ac8f730e38fec9981e55c62667464ad455bf9e Mon Sep 17 00:00:00 2001 From: Jack Wright <56345+ayax79@users.noreply.github.com> Date: Tue, 13 May 2025 07:49:30 -0700 Subject: [PATCH] Rust 1.85, edition=2024 (#15741) --- Cargo.lock | 16 +- Cargo.toml | 4 +- benches/benchmarks.rs | 56 +-- crates/nu-cli/Cargo.toml | 2 +- .../nu-cli/src/commands/history/history_.rs | 2 +- .../src/commands/history/history_import.rs | 11 +- .../nu-cli/src/commands/keybindings_listen.rs | 4 +- .../src/completions/attribute_completions.rs | 6 +- crates/nu-cli/src/completions/base.rs | 2 +- .../src/completions/cell_path_completions.rs | 2 +- .../src/completions/command_completions.rs | 6 +- crates/nu-cli/src/completions/completer.rs | 4 +- .../src/completions/completion_common.rs | 8 +- .../src/completions/completion_options.rs | 2 +- .../src/completions/custom_completions.rs | 10 +- .../src/completions/directory_completions.rs | 6 +- .../src/completions/dotnu_completions.rs | 9 +- .../src/completions/exportable_completions.rs | 6 +- .../src/completions/file_completions.rs | 6 +- .../src/completions/flag_completions.rs | 4 +- crates/nu-cli/src/completions/mod.rs | 2 +- .../src/completions/operator_completions.rs | 4 +- .../src/completions/variable_completions.rs | 2 +- crates/nu-cli/src/config_files.rs | 11 +- crates/nu-cli/src/eval_cmds.rs | 3 +- crates/nu-cli/src/eval_file.rs | 2 +- crates/nu-cli/src/lib.rs | 2 +- crates/nu-cli/src/menus/help_completions.rs | 4 +- crates/nu-cli/src/menus/menu_completions.rs | 4 +- crates/nu-cli/src/prompt_update.rs | 3 +- crates/nu-cli/src/reedline_config.rs | 11 +- crates/nu-cli/src/repl.rs | 14 +- crates/nu-cli/src/syntax_highlight.rs | 4 +- crates/nu-cli/src/util.rs | 6 +- crates/nu-cli/src/validation.rs | 2 +- .../nu-cli/tests/commands/history_import.rs | 2 +- crates/nu-cli/tests/completions/mod.rs | 6 +- .../support/completions_helpers.rs | 18 +- crates/nu-cmd-base/Cargo.toml | 4 +- .../nu-cmd-base/src/formats/to/delimited.rs | 2 +- crates/nu-cmd-base/src/hook.rs | 2 +- crates/nu-cmd-base/src/input_handler.rs | 2 +- crates/nu-cmd-base/src/util.rs | 2 +- crates/nu-cmd-extra/Cargo.toml | 2 +- crates/nu-cmd-extra/src/example_test.rs | 2 +- crates/nu-cmd-extra/src/extra/bits/and.rs | 5 +- crates/nu-cmd-extra/src/extra/bits/not.rs | 10 +- crates/nu-cmd-extra/src/extra/bits/or.rs | 5 +- .../src/extra/bits/rotate_left.rs | 7 +- .../src/extra/bits/rotate_right.rs | 4 +- .../nu-cmd-extra/src/extra/bits/shift_left.rs | 7 +- .../src/extra/bits/shift_right.rs | 4 +- crates/nu-cmd-extra/src/extra/bits/xor.rs | 5 +- .../src/extra/filters/each_while.rs | 2 +- .../src/extra/filters/roll/roll_down.rs | 2 +- .../src/extra/filters/roll/roll_left.rs | 2 +- .../src/extra/filters/roll/roll_right.rs | 2 +- .../src/extra/filters/roll/roll_up.rs | 2 +- .../nu-cmd-extra/src/extra/filters/rotate.rs | 145 ++++---- .../src/extra/filters/update_cells.rs | 4 +- .../nu-cmd-extra/src/extra/formats/to/html.rs | 2 +- .../src/extra/platform/ansi/gradient.rs | 50 ++- .../src/extra/strings/format/bits.rs | 27 +- .../src/extra/strings/format/command.rs | 4 +- .../src/extra/strings/format/number.rs | 2 +- .../src/extra/strings/str_/case/mod.rs | 2 +- crates/nu-cmd-lang/Cargo.toml | 2 +- .../nu-cmd-lang/src/core_commands/break_.rs | 4 +- .../nu-cmd-lang/src/core_commands/collect.rs | 2 +- .../nu-cmd-lang/src/core_commands/const_.rs | 4 +- .../src/core_commands/continue_.rs | 4 +- .../nu-cmd-lang/src/core_commands/describe.rs | 41 +-- crates/nu-cmd-lang/src/core_commands/do_.rs | 2 +- crates/nu-cmd-lang/src/core_commands/echo.rs | 3 +- .../src/core_commands/error_make.rs | 21 +- crates/nu-cmd-lang/src/core_commands/for_.rs | 4 +- crates/nu-cmd-lang/src/core_commands/if_.rs | 4 +- .../nu-cmd-lang/src/core_commands/ignore.rs | 2 +- crates/nu-cmd-lang/src/core_commands/let_.rs | 4 +- crates/nu-cmd-lang/src/core_commands/loop_.rs | 4 +- .../nu-cmd-lang/src/core_commands/match_.rs | 7 +- crates/nu-cmd-lang/src/core_commands/mut_.rs | 4 +- .../src/core_commands/overlay/hide.rs | 2 +- .../src/core_commands/overlay/use_.rs | 2 +- .../nu-cmd-lang/src/core_commands/return_.rs | 4 +- crates/nu-cmd-lang/src/core_commands/try_.rs | 4 +- .../nu-cmd-lang/src/core_commands/while_.rs | 4 +- crates/nu-cmd-lang/src/example_support.rs | 10 +- crates/nu-cmd-lang/src/example_test.rs | 2 +- crates/nu-cmd-lang/src/parse_const_test.rs | 2 +- crates/nu-cmd-plugin/Cargo.toml | 4 +- .../nu-cmd-plugin/src/commands/plugin/add.rs | 2 +- .../nu-cmd-plugin/src/commands/plugin/use_.rs | 3 +- crates/nu-cmd-plugin/src/util.rs | 4 +- crates/nu-color-config/Cargo.toml | 4 +- crates/nu-color-config/src/color_config.rs | 11 +- crates/nu-color-config/src/nu_style.rs | 6 +- crates/nu-color-config/src/style_computer.rs | 13 +- crates/nu-command/Cargo.toml | 2 +- crates/nu-command/src/bytes/add.rs | 14 +- crates/nu-command/src/bytes/at.rs | 8 +- crates/nu-command/src/bytes/build_.rs | 2 +- crates/nu-command/src/bytes/ends_with.rs | 2 +- crates/nu-command/src/bytes/index_of.rs | 2 +- crates/nu-command/src/bytes/length.rs | 2 +- crates/nu-command/src/bytes/remove.rs | 28 +- crates/nu-command/src/bytes/replace.rs | 22 +- crates/nu-command/src/bytes/reverse.rs | 2 +- crates/nu-command/src/bytes/starts_with.rs | 2 +- .../nu-command/src/charting/hashable_value.rs | 2 +- crates/nu-command/src/charting/histogram.rs | 40 +- crates/nu-command/src/conversions/fill.rs | 14 +- .../nu-command/src/conversions/into/binary.rs | 2 +- .../nu-command/src/conversions/into/bool.rs | 2 +- .../src/conversions/into/cell_path.rs | 2 +- .../src/conversions/into/datetime.rs | 30 +- .../src/conversions/into/duration.rs | 14 +- .../src/conversions/into/filesize.rs | 2 +- .../nu-command/src/conversions/into/float.rs | 2 +- .../nu-command/src/conversions/into/glob.rs | 2 +- crates/nu-command/src/conversions/into/int.rs | 12 +- .../nu-command/src/conversions/into/record.rs | 2 +- .../nu-command/src/conversions/into/string.rs | 2 +- .../nu-command/src/conversions/into/value.rs | 144 +++++--- .../src/conversions/split_cell_path.rs | 4 +- .../src/database/commands/query_db.rs | 2 +- crates/nu-command/src/database/mod.rs | 4 +- crates/nu-command/src/database/values/mod.rs | 4 +- .../nu-command/src/database/values/sqlite.rs | 10 +- crates/nu-command/src/date/from_human.rs | 4 +- crates/nu-command/src/date/now.rs | 6 +- crates/nu-command/src/date/utils.rs | 8 +- crates/nu-command/src/debug/ast.rs | 11 +- crates/nu-command/src/debug/debug_.rs | 3 +- crates/nu-command/src/debug/explain.rs | 3 +- crates/nu-command/src/debug/inspect_table.rs | 18 +- crates/nu-command/src/debug/metadata.rs | 2 +- .../nu-command/src/debug/metadata_access.rs | 2 +- crates/nu-command/src/debug/metadata_set.rs | 2 +- crates/nu-command/src/debug/profile.rs | 2 +- crates/nu-command/src/debug/timeit.rs | 2 +- crates/nu-command/src/debug/view_ir.rs | 2 +- crates/nu-command/src/debug/view_source.rs | 4 +- crates/nu-command/src/env/config/config_nu.rs | 3 +- crates/nu-command/src/env/load_env.rs | 2 +- crates/nu-command/src/env/source_env.rs | 2 +- crates/nu-command/src/example_test.rs | 2 +- .../nu-command/src/experimental/is_admin.rs | 14 +- .../nu-command/src/experimental/job_recv.rs | 2 +- .../nu-command/src/experimental/job_send.rs | 2 +- .../nu-command/src/experimental/job_spawn.rs | 8 +- .../src/experimental/job_unfreeze.rs | 9 +- crates/nu-command/src/filesystem/cd.rs | 2 +- crates/nu-command/src/filesystem/du.rs | 2 +- crates/nu-command/src/filesystem/glob.rs | 10 +- crates/nu-command/src/filesystem/ls.rs | 19 +- crates/nu-command/src/filesystem/open.rs | 5 +- crates/nu-command/src/filesystem/rm.rs | 6 +- crates/nu-command/src/filesystem/save.rs | 7 +- crates/nu-command/src/filesystem/ucp.rs | 4 +- crates/nu-command/src/filesystem/umv.rs | 2 +- crates/nu-command/src/filesystem/utouch.rs | 4 +- crates/nu-command/src/filesystem/watch.rs | 12 +- crates/nu-command/src/filters/chunk_by.rs | 4 +- crates/nu-command/src/filters/chunks.rs | 2 +- crates/nu-command/src/filters/columns.rs | 2 +- crates/nu-command/src/filters/default.rs | 3 +- crates/nu-command/src/filters/drop/nth.rs | 2 +- crates/nu-command/src/filters/each.rs | 5 +- crates/nu-command/src/filters/filter.rs | 2 +- crates/nu-command/src/filters/find.rs | 56 +-- crates/nu-command/src/filters/first.rs | 2 +- crates/nu-command/src/filters/flatten.rs | 25 +- crates/nu-command/src/filters/get.rs | 7 +- crates/nu-command/src/filters/group_by.rs | 8 +- crates/nu-command/src/filters/insert.rs | 2 +- crates/nu-command/src/filters/interleave.rs | 2 +- crates/nu-command/src/filters/items.rs | 5 +- crates/nu-command/src/filters/merge/deep.rs | 2 +- crates/nu-command/src/filters/merge/merge_.rs | 2 +- crates/nu-command/src/filters/move_.rs | 80 ++-- crates/nu-command/src/filters/par_each.rs | 10 +- crates/nu-command/src/filters/reduce.rs | 15 +- crates/nu-command/src/filters/reject.rs | 18 +- crates/nu-command/src/filters/rename.rs | 101 ++--- crates/nu-command/src/filters/select.rs | 14 +- crates/nu-command/src/filters/skip/skip_.rs | 2 +- .../nu-command/src/filters/skip/skip_until.rs | 2 +- .../nu-command/src/filters/skip/skip_while.rs | 2 +- crates/nu-command/src/filters/sort.rs | 4 +- crates/nu-command/src/filters/sort_by.rs | 28 +- .../nu-command/src/filters/take/take_until.rs | 2 +- .../nu-command/src/filters/take/take_while.rs | 2 +- crates/nu-command/src/filters/tee.rs | 11 +- crates/nu-command/src/filters/transpose.rs | 7 +- crates/nu-command/src/filters/uniq.rs | 41 +-- crates/nu-command/src/filters/update.rs | 38 +- crates/nu-command/src/filters/upsert.rs | 2 +- crates/nu-command/src/filters/utils.rs | 2 +- crates/nu-command/src/filters/values.rs | 2 +- crates/nu-command/src/filters/where_.rs | 18 +- crates/nu-command/src/filters/zip.rs | 2 +- crates/nu-command/src/formats/from/csv.rs | 42 +-- crates/nu-command/src/formats/from/json.rs | 2 +- .../nu-command/src/formats/from/msgpackz.rs | 2 +- crates/nu-command/src/formats/from/ods.rs | 2 +- crates/nu-command/src/formats/from/ssv.rs | 55 ++- crates/nu-command/src/formats/from/tsv.rs | 32 +- crates/nu-command/src/formats/from/xlsx.rs | 2 +- crates/nu-command/src/formats/from/xml.rs | 118 +++--- crates/nu-command/src/formats/to/delimited.rs | 8 +- crates/nu-command/src/formats/to/json.rs | 15 +- crates/nu-command/src/formats/to/md.rs | 2 +- crates/nu-command/src/formats/to/msgpack.rs | 2 +- crates/nu-command/src/formats/to/nuon.rs | 14 +- crates/nu-command/src/formats/to/text.rs | 2 +- crates/nu-command/src/formats/to/toml.rs | 2 +- crates/nu-command/src/formats/to/xml.rs | 28 +- crates/nu-command/src/generators/cal.rs | 2 +- crates/nu-command/src/generators/generate.rs | 14 +- crates/nu-command/src/generators/seq_date.rs | 25 +- crates/nu-command/src/hash/generic_digest.rs | 2 +- crates/nu-command/src/help/help_.rs | 2 +- crates/nu-command/src/math/avg.rs | 2 +- crates/nu-command/src/math/max.rs | 2 +- crates/nu-command/src/math/min.rs | 2 +- crates/nu-command/src/math/product.rs | 2 +- crates/nu-command/src/math/reducers.rs | 14 +- crates/nu-command/src/math/sum.rs | 2 +- crates/nu-command/src/math/utils.rs | 2 +- crates/nu-command/src/math/variance.rs | 7 +- crates/nu-command/src/misc/source.rs | 4 +- crates/nu-command/src/network/http/client.rs | 18 +- crates/nu-command/src/network/http/delete.rs | 9 +- crates/nu-command/src/network/http/get.rs | 6 +- crates/nu-command/src/network/http/head.rs | 6 +- crates/nu-command/src/network/http/options.rs | 4 +- crates/nu-command/src/network/http/patch.rs | 15 +- crates/nu-command/src/network/http/post.rs | 6 +- crates/nu-command/src/network/http/put.rs | 6 +- crates/nu-command/src/network/url/decode.rs | 2 +- crates/nu-command/src/network/url/encode.rs | 12 +- crates/nu-command/src/network/url/join.rs | 2 +- crates/nu-command/src/network/url/query.rs | 2 +- .../nu-command/src/network/url/split_query.rs | 16 +- .../nu-command/src/network/version_check.rs | 3 +- crates/nu-command/src/path/dirname.rs | 6 +- crates/nu-command/src/path/join.rs | 15 +- crates/nu-command/src/path/mod.rs | 2 +- crates/nu-command/src/platform/ansi/ansi_.rs | 14 +- crates/nu-command/src/platform/ansi/strip.rs | 6 +- crates/nu-command/src/platform/clear.rs | 2 +- crates/nu-command/src/platform/dir_info.rs | 2 +- crates/nu-command/src/platform/input/list.rs | 4 +- crates/nu-command/src/platform/ulimit.rs | 8 +- crates/nu-command/src/platform/whoami.rs | 2 +- crates/nu-command/src/progress_bar.rs | 104 +++--- crates/nu-command/src/random/binary.rs | 2 +- crates/nu-command/src/random/byte_stream.rs | 3 +- crates/nu-command/src/random/chars.rs | 2 +- crates/nu-command/src/sort_utils.rs | 2 +- crates/nu-command/src/stor/create.rs | 22 +- crates/nu-command/src/stor/delete.rs | 5 +- crates/nu-command/src/stor/export.rs | 4 +- crates/nu-command/src/stor/import.rs | 4 +- crates/nu-command/src/stor/insert.rs | 9 +- crates/nu-command/src/stor/open.rs | 2 +- crates/nu-command/src/stor/reset.rs | 2 +- crates/nu-command/src/stor/update.rs | 32 +- crates/nu-command/src/strings/char_.rs | 2 +- .../nu-command/src/strings/detect_columns.rs | 9 +- crates/nu-command/src/strings/format/date.rs | 5 +- .../nu-command/src/strings/format/duration.rs | 2 +- .../nu-command/src/strings/format/filesize.rs | 4 +- crates/nu-command/src/strings/guess_width.rs | 12 +- crates/nu-command/src/strings/mod.rs | 2 +- crates/nu-command/src/strings/parse.rs | 71 ++-- crates/nu-command/src/strings/split/column.rs | 2 +- crates/nu-command/src/strings/split/list.rs | 2 +- crates/nu-command/src/strings/split/row.rs | 2 +- crates/nu-command/src/strings/split/words.rs | 6 +- .../nu-command/src/strings/str_/case/mod.rs | 2 +- .../src/strings/str_/case/upcase.rs | 2 +- .../nu-command/src/strings/str_/contains.rs | 2 +- .../nu-command/src/strings/str_/distance.rs | 49 ++- .../nu-command/src/strings/str_/ends_with.rs | 2 +- crates/nu-command/src/strings/str_/expand.rs | 55 +-- .../nu-command/src/strings/str_/index_of.rs | 12 +- crates/nu-command/src/strings/str_/join.rs | 2 +- crates/nu-command/src/strings/str_/length.rs | 2 +- crates/nu-command/src/strings/str_/replace.rs | 35 +- crates/nu-command/src/strings/str_/reverse.rs | 2 +- .../src/strings/str_/starts_with.rs | 2 +- .../nu-command/src/strings/str_/substring.rs | 9 +- .../nu-command/src/strings/str_/trim/trim_.rs | 2 +- crates/nu-command/src/system/complete.rs | 3 +- crates/nu-command/src/system/mod.rs | 2 +- crates/nu-command/src/system/nu_check.rs | 2 +- .../nu-command/src/system/registry_query.rs | 6 +- crates/nu-command/src/system/run_external.rs | 15 +- crates/nu-command/src/system/sys/cpu.rs | 2 +- crates/nu-command/src/system/uname.rs | 2 +- crates/nu-command/src/viewers/table.rs | 13 +- .../tests/commands/assignment/concat.rs | 16 +- crates/nu-command/tests/commands/cd.rs | 11 +- crates/nu-command/tests/commands/chunks.rs | 4 +- crates/nu-command/tests/commands/complete.rs | 4 +- .../tests/commands/database/into_sqlite.rs | 6 +- .../nu-command/tests/commands/debug/timeit.rs | 4 +- crates/nu-command/tests/commands/def.rs | 8 +- crates/nu-command/tests/commands/du.rs | 16 +- .../nu-command/tests/commands/error_make.rs | 16 +- .../nu-command/tests/commands/export_def.rs | 8 +- crates/nu-command/tests/commands/find.rs | 31 +- crates/nu-command/tests/commands/headers.rs | 48 ++- crates/nu-command/tests/commands/insert.rs | 24 +- .../tests/commands/into_datetime.rs | 8 +- .../tests/commands/into_duration.rs | 8 +- crates/nu-command/tests/commands/join.rs | 5 +- crates/nu-command/tests/commands/let_.rs | 8 +- crates/nu-command/tests/commands/ls.rs | 8 +- crates/nu-command/tests/commands/move_/umv.rs | 24 +- crates/nu-command/tests/commands/mut_.rs | 24 +- .../tests/commands/network/http/patch.rs | 8 +- .../tests/commands/network/http/post.rs | 8 +- .../tests/commands/network/http/put.rs | 8 +- crates/nu-command/tests/commands/open.rs | 12 +- crates/nu-command/tests/commands/parse.rs | 16 +- .../nu-command/tests/commands/redirection.rs | 8 +- crates/nu-command/tests/commands/reduce.rs | 8 +- crates/nu-command/tests/commands/reject.rs | 12 +- crates/nu-command/tests/commands/rm.rs | 2 +- crates/nu-command/tests/commands/rotate.rs | 8 +- crates/nu-command/tests/commands/save.rs | 42 ++- crates/nu-command/tests/commands/seq_char.rs | 32 +- crates/nu-command/tests/commands/seq_date.rs | 8 +- .../nu-command/tests/commands/source_env.rs | 16 +- crates/nu-command/tests/commands/table.rs | 226 ++++++++---- crates/nu-command/tests/commands/try_.rs | 7 +- crates/nu-command/tests/commands/ucp.rs | 30 +- crates/nu-command/tests/commands/ulimit.rs | 16 +- crates/nu-command/tests/commands/uniq.rs | 4 +- crates/nu-command/tests/commands/upsert.rs | 20 +- crates/nu-command/tests/commands/url/join.rs | 64 ++-- crates/nu-command/tests/commands/use_.rs | 8 +- crates/nu-command/tests/commands/utouch.rs | 2 +- crates/nu-command/tests/commands/window.rs | 4 +- .../tests/format_conversions/csv.rs | 24 +- .../tests/format_conversions/json.rs | 8 +- .../tests/format_conversions/msgpack.rs | 22 +- crates/nu-command/tests/sort_utils.rs | 23 +- crates/nu-derive-value/Cargo.toml | 4 +- crates/nu-derive-value/src/attributes.rs | 4 +- crates/nu-derive-value/src/error.rs | 2 +- crates/nu-derive-value/src/from.rs | 6 +- crates/nu-derive-value/src/into.rs | 6 +- crates/nu-derive-value/src/lib.rs | 2 +- crates/nu-derive-value/src/names.rs | 2 +- crates/nu-engine/Cargo.toml | 4 +- crates/nu-engine/src/call_ext.rs | 4 +- crates/nu-engine/src/closure_eval.rs | 4 +- crates/nu-engine/src/command_prelude.rs | 6 +- crates/nu-engine/src/compile/builder.rs | 2 +- crates/nu-engine/src/compile/call.rs | 4 +- crates/nu-engine/src/compile/expression.rs | 6 +- crates/nu-engine/src/compile/keyword.rs | 4 +- crates/nu-engine/src/compile/mod.rs | 2 +- crates/nu-engine/src/compile/operator.rs | 15 +- crates/nu-engine/src/compile/redirect.rs | 4 +- crates/nu-engine/src/documentation.rs | 5 +- crates/nu-engine/src/env.rs | 14 +- crates/nu-engine/src/eval.rs | 6 +- crates/nu-engine/src/eval_helpers.rs | 2 +- crates/nu-engine/src/eval_ir.rs | 14 +- crates/nu-engine/src/glob_from.rs | 2 +- crates/nu-engine/src/scope.rs | 3 +- crates/nu-explore/Cargo.toml | 4 +- crates/nu-explore/src/commands/expand.rs | 2 +- crates/nu-explore/src/commands/help.rs | 2 +- crates/nu-explore/src/commands/mod.rs | 4 +- crates/nu-explore/src/commands/nu.rs | 2 +- crates/nu-explore/src/commands/quit.rs | 2 +- crates/nu-explore/src/commands/table.rs | 2 +- crates/nu-explore/src/commands/try.rs | 2 +- crates/nu-explore/src/explore.rs | 8 +- crates/nu-explore/src/lib.rs | 2 +- crates/nu-explore/src/nu_common/command.rs | 2 +- crates/nu-explore/src/nu_common/table.rs | 2 +- crates/nu-explore/src/nu_common/value.rs | 2 +- crates/nu-explore/src/pager/events.rs | 2 +- crates/nu-explore/src/pager/mod.rs | 8 +- crates/nu-explore/src/pager/status_bar.rs | 2 +- crates/nu-explore/src/views/binary/mod.rs | 6 +- .../src/views/colored_text_widget.rs | 2 +- crates/nu-explore/src/views/cursor/mod.rs | 2 +- .../src/views/cursor/window_cursor.rs | 2 +- crates/nu-explore/src/views/mod.rs | 4 +- crates/nu-explore/src/views/preview.rs | 8 +- crates/nu-explore/src/views/record/mod.rs | 10 +- .../src/views/record/table_widget.rs | 4 +- crates/nu-explore/src/views/try.rs | 6 +- crates/nu-explore/src/views/util.rs | 4 +- crates/nu-glob/Cargo.toml | 2 +- crates/nu-glob/src/lib.rs | 102 ++++-- crates/nu-json/Cargo.toml | 4 +- crates/nu-json/src/lib.rs | 8 +- crates/nu-json/src/value.rs | 4 +- crates/nu-lsp/Cargo.toml | 2 +- crates/nu-lsp/src/ast.rs | 2 +- crates/nu-lsp/src/completion.rs | 6 +- crates/nu-lsp/src/diagnostics.rs | 6 +- crates/nu-lsp/src/goto.rs | 6 +- crates/nu-lsp/src/hints.rs | 6 +- crates/nu-lsp/src/hover.rs | 18 +- crates/nu-lsp/src/lib.rs | 30 +- crates/nu-lsp/src/notification.rs | 6 +- crates/nu-lsp/src/semantic_tokens.rs | 12 +- crates/nu-lsp/src/signature.rs | 12 +- crates/nu-lsp/src/symbols.rs | 6 +- crates/nu-lsp/src/workspace.rs | 13 +- crates/nu-parser/Cargo.toml | 4 +- crates/nu-parser/fuzz/Cargo.toml | 2 +- crates/nu-parser/src/flatten.rs | 2 +- crates/nu-parser/src/known_external.rs | 2 +- crates/nu-parser/src/lib.rs | 10 +- crates/nu-parser/src/lite_parser.rs | 2 +- crates/nu-parser/src/parse_keywords.rs | 26 +- crates/nu-parser/src/parse_patterns.rs | 2 +- crates/nu-parser/src/parse_shape_specs.rs | 4 +- crates/nu-parser/src/parser.rs | 26 +- crates/nu-parser/src/type_check.rs | 6 +- crates/nu-parser/tests/test_lex.rs | 2 +- crates/nu-parser/tests/test_parser.rs | 4 +- crates/nu-path/Cargo.toml | 2 +- crates/nu-path/fuzz/Cargo.toml | 4 +- crates/nu-path/src/path.rs | 2 +- crates/nu-plugin-core/Cargo.toml | 4 +- .../src/communication_mode/mod.rs | 2 +- crates/nu-plugin-core/src/interface/mod.rs | 4 +- .../src/interface/stream/mod.rs | 4 +- .../src/interface/stream/tests.rs | 3 +- crates/nu-plugin-core/src/interface/tests.rs | 6 +- crates/nu-plugin-core/src/lib.rs | 4 +- crates/nu-plugin-core/src/serializers/json.rs | 2 +- .../nu-plugin-core/src/serializers/msgpack.rs | 2 +- crates/nu-plugin-core/src/util/waitable.rs | 2 +- crates/nu-plugin-engine/Cargo.toml | 4 +- crates/nu-plugin-engine/src/context.rs | 9 +- crates/nu-plugin-engine/src/declaration.rs | 2 +- crates/nu-plugin-engine/src/gc.rs | 2 +- crates/nu-plugin-engine/src/init.rs | 4 +- crates/nu-plugin-engine/src/interface/mod.rs | 14 +- .../nu-plugin-engine/src/interface/tests.rs | 63 ++-- crates/nu-plugin-engine/src/persistent.rs | 16 +- .../plugin_custom_value_with_source/mod.rs | 2 +- .../plugin_custom_value_with_source/tests.rs | 6 +- crates/nu-plugin-engine/src/process.rs | 2 +- crates/nu-plugin-engine/src/test_util.rs | 2 +- crates/nu-plugin-protocol/Cargo.toml | 4 +- .../nu-plugin-protocol/src/evaluated_call.rs | 3 +- crates/nu-plugin-protocol/src/lib.rs | 6 +- .../src/plugin_custom_value/mod.rs | 8 +- .../src/plugin_custom_value/tests.rs | 4 +- crates/nu-plugin-test-support/Cargo.toml | 4 +- .../src/fake_persistent_plugin.rs | 2 +- .../src/fake_register.rs | 4 +- .../nu-plugin-test-support/src/plugin_test.rs | 5 +- .../src/spawn_fake_plugin.rs | 4 +- crates/nu-plugin/Cargo.toml | 2 +- crates/nu-plugin/src/lib.rs | 2 +- crates/nu-plugin/src/plugin/interface/mod.rs | 12 +- .../nu-plugin/src/plugin/interface/tests.rs | 15 +- crates/nu-plugin/src/plugin/mod.rs | 8 +- crates/nu-pretty-hex/Cargo.toml | 4 +- crates/nu-protocol/Cargo.toml | 2 +- crates/nu-protocol/src/alias.rs | 2 +- crates/nu-protocol/src/ast/block.rs | 2 +- crates/nu-protocol/src/ast/call.rs | 4 +- crates/nu-protocol/src/ast/cell_path.rs | 8 +- crates/nu-protocol/src/ast/expr.rs | 2 +- crates/nu-protocol/src/ast/expression.rs | 2 +- crates/nu-protocol/src/ast/pipeline.rs | 2 +- .../nu-protocol/src/config/ansi_coloring.rs | 142 +++++--- crates/nu-protocol/src/config/plugin_gc.rs | 2 +- crates/nu-protocol/src/config/prelude.rs | 4 +- crates/nu-protocol/src/config/reedline.rs | 20 +- crates/nu-protocol/src/config/table.rs | 4 +- .../src/debugger/debugger_trait.rs | 2 +- crates/nu-protocol/src/debugger/profiler.rs | 3 +- crates/nu-protocol/src/did_you_mean.rs | 52 ++- crates/nu-protocol/src/engine/argument.rs | 2 +- crates/nu-protocol/src/engine/call.rs | 3 +- crates/nu-protocol/src/engine/call_info.rs | 2 +- crates/nu-protocol/src/engine/closure.rs | 2 +- crates/nu-protocol/src/engine/command.rs | 2 +- crates/nu-protocol/src/engine/engine_state.rs | 30 +- crates/nu-protocol/src/engine/jobs.rs | 4 +- .../nu-protocol/src/engine/pattern_match.rs | 2 +- crates/nu-protocol/src/engine/stack.rs | 8 +- .../nu-protocol/src/engine/stack_out_dest.rs | 2 +- crates/nu-protocol/src/engine/state_delta.rs | 6 +- .../src/engine/state_working_set.rs | 10 +- crates/nu-protocol/src/errors/cli_error.rs | 2 +- .../nu-protocol/src/errors/compile_error.rs | 24 +- .../nu-protocol/src/errors/labeled_error.rs | 2 +- crates/nu-protocol/src/errors/parse_error.rs | 36 +- .../nu-protocol/src/errors/parse_warning.rs | 4 +- .../nu-protocol/src/errors/shell_error/io.rs | 2 +- .../nu-protocol/src/errors/shell_error/mod.rs | 58 ++- crates/nu-protocol/src/eval_base.rs | 6 +- crates/nu-protocol/src/eval_const.rs | 4 +- crates/nu-protocol/src/ir/call.rs | 4 +- crates/nu-protocol/src/ir/display.rs | 2 +- crates/nu-protocol/src/ir/mod.rs | 2 +- crates/nu-protocol/src/lev_distance.rs | 6 +- crates/nu-protocol/src/module.rs | 9 +- crates/nu-protocol/src/parser_path.rs | 2 +- .../nu-protocol/src/pipeline/byte_stream.rs | 2 +- crates/nu-protocol/src/pipeline/handlers.rs | 2 +- .../nu-protocol/src/pipeline/pipeline_data.rs | 8 +- crates/nu-protocol/src/pipeline/signals.rs | 2 +- crates/nu-protocol/src/process/child.rs | 2 +- crates/nu-protocol/src/signature.rs | 2 +- crates/nu-protocol/src/value/custom_value.rs | 2 +- crates/nu-protocol/src/value/from_value.rs | 4 +- crates/nu-protocol/src/value/into_value.rs | 2 +- crates/nu-protocol/src/value/mod.rs | 43 ++- crates/nu-protocol/src/value/range.rs | 20 +- crates/nu-protocol/src/value/record.rs | 2 +- crates/nu-protocol/src/value/test_derive.rs | 2 +- crates/nu-protocol/tests/into_config.rs | 8 +- .../nu-protocol/tests/pipeline/byte_stream.rs | 2 +- crates/nu-protocol/tests/test_value.rs | 2 +- crates/nu-std/Cargo.toml | 2 +- crates/nu-std/src/lib.rs | 3 +- crates/nu-system/Cargo.toml | 4 +- crates/nu-system/src/foreground.rs | 10 +- crates/nu-system/src/freebsd.rs | 4 +- crates/nu-system/src/linux.rs | 4 +- crates/nu-system/src/macos.rs | 16 +- crates/nu-system/src/netbsd.rs | 2 +- crates/nu-system/src/windows.rs | 344 +++++++++--------- crates/nu-table/Cargo.toml | 4 +- crates/nu-table/src/common.rs | 2 +- crates/nu-table/src/table.rs | 6 +- crates/nu-table/src/types/collapse.rs | 4 +- crates/nu-table/src/types/expanded.rs | 8 +- crates/nu-table/src/types/general.rs | 8 +- crates/nu-table/src/types/mod.rs | 2 +- crates/nu-table/src/unstructured_table.rs | 2 +- crates/nu-table/src/util.rs | 2 +- crates/nu-table/tests/common.rs | 2 +- crates/nu-table/tests/constrains.rs | 165 +++++++-- crates/nu-table/tests/expand.rs | 2 +- crates/nu-table/tests/style.rs | 2 +- crates/nu-term-grid/Cargo.toml | 4 +- crates/nu-term-grid/src/grid.rs | 2 +- crates/nu-test-support/Cargo.toml | 4 +- crates/nu-test-support/src/commands.rs | 2 +- crates/nu-test-support/src/locale_override.rs | 17 +- crates/nu-test-support/src/macros.rs | 2 +- .../src/playground/director.rs | 2 +- crates/nu-test-support/src/playground/play.rs | 4 +- crates/nu-utils/Cargo.toml | 4 +- crates/nu-utils/src/filesystem.rs | 2 +- crates/nu-utils/src/flatten_json.rs | 2 +- crates/nu_plugin_custom_values/Cargo.toml | 4 +- .../src/cool_custom_value.rs | 2 +- .../nu_plugin_custom_values/src/drop_check.rs | 2 +- .../nu_plugin_custom_values/src/generate.rs | 2 +- .../nu_plugin_custom_values/src/generate2.rs | 2 +- .../nu_plugin_custom_values/src/handle_get.rs | 2 +- .../src/handle_make.rs | 2 +- .../src/handle_update.rs | 4 +- crates/nu_plugin_custom_values/src/main.rs | 4 +- crates/nu_plugin_custom_values/src/update.rs | 2 +- .../nu_plugin_custom_values/src/update_arg.rs | 2 +- crates/nu_plugin_example/Cargo.toml | 4 +- crates/nu_plugin_example/src/commands/sum.rs | 6 +- crates/nu_plugin_example/src/main.rs | 2 +- crates/nu_plugin_formats/Cargo.toml | 4 +- crates/nu_plugin_formats/src/from/eml.rs | 4 +- crates/nu_plugin_formats/src/from/ics.rs | 2 +- crates/nu_plugin_formats/src/from/ini.rs | 2 +- crates/nu_plugin_formats/src/from/plist.rs | 2 +- crates/nu_plugin_formats/src/from/vcf.rs | 2 +- crates/nu_plugin_formats/src/main.rs | 2 +- crates/nu_plugin_gstat/Cargo.toml | 4 +- crates/nu_plugin_gstat/src/gstat.rs | 2 +- crates/nu_plugin_gstat/src/main.rs | 2 +- crates/nu_plugin_inc/Cargo.toml | 4 +- crates/nu_plugin_inc/src/inc.rs | 4 +- crates/nu_plugin_inc/src/main.rs | 2 +- crates/nu_plugin_inc/src/nu/mod.rs | 4 +- crates/nu_plugin_polars/Cargo.toml | 2 +- crates/nu_plugin_polars/src/cache/get.rs | 2 +- crates/nu_plugin_polars/src/cache/list.rs | 4 +- crates/nu_plugin_polars/src/cache/mod.rs | 2 +- crates/nu_plugin_polars/src/cloud/aws.rs | 2 +- .../command/aggregation/agg_groups.rs | 4 +- .../command/aggregation/aggregate.rs | 2 +- .../dataframe/command/aggregation/count.rs | 4 +- .../command/aggregation/cumulative.rs | 4 +- .../dataframe/command/aggregation/groupby.rs | 2 +- .../command/aggregation/horizontal.rs | 2 +- .../dataframe/command/aggregation/implode.rs | 17 +- .../src/dataframe/command/aggregation/max.rs | 6 +- .../src/dataframe/command/aggregation/mean.rs | 6 +- .../dataframe/command/aggregation/median.rs | 7 +- .../src/dataframe/command/aggregation/min.rs | 6 +- .../dataframe/command/aggregation/n_null.rs | 2 +- .../dataframe/command/aggregation/n_unique.rs | 2 +- .../src/dataframe/command/aggregation/over.rs | 4 +- .../dataframe/command/aggregation/quantile.rs | 6 +- .../dataframe/command/aggregation/rolling.rs | 2 +- .../src/dataframe/command/aggregation/std.rs | 9 +- .../src/dataframe/command/aggregation/sum.rs | 9 +- .../command/aggregation/value_counts.rs | 2 +- .../src/dataframe/command/aggregation/var.rs | 12 +- .../dataframe/command/boolean/all_false.rs | 2 +- .../src/dataframe/command/boolean/all_true.rs | 2 +- .../src/dataframe/command/boolean/arg_true.rs | 4 +- .../src/dataframe/command/boolean/expr_not.rs | 4 +- .../command/boolean/is_duplicated.rs | 5 +- .../src/dataframe/command/boolean/is_in.rs | 6 +- .../dataframe/command/boolean/is_not_null.rs | 2 +- .../src/dataframe/command/boolean/is_null.rs | 6 +- .../dataframe/command/boolean/is_unique.rs | 5 +- .../src/dataframe/command/boolean/not.rs | 2 +- .../dataframe/command/boolean/otherwise.rs | 5 +- .../src/dataframe/command/boolean/set.rs | 2 +- .../src/dataframe/command/boolean/when.rs | 2 +- .../src/dataframe/command/core/cache.rs | 2 +- .../src/dataframe/command/core/columns.rs | 2 +- .../src/dataframe/command/core/fetch.rs | 2 +- .../src/dataframe/command/core/open.rs | 8 +- .../src/dataframe/command/core/profile.rs | 10 +- .../src/dataframe/command/core/resource.rs | 2 +- .../src/dataframe/command/core/save/avro.rs | 2 +- .../src/dataframe/command/core/save/mod.rs | 11 +- .../src/dataframe/command/core/schema.rs | 4 +- .../src/dataframe/command/core/shape.rs | 2 +- .../src/dataframe/command/core/summary.rs | 2 +- .../src/dataframe/command/core/to_df.rs | 89 +++-- .../src/dataframe/command/core/to_dtype.rs | 2 +- .../src/dataframe/command/core/to_lazy.rs | 22 +- .../src/dataframe/command/core/to_nu.rs | 9 +- .../src/dataframe/command/core/to_repr.rs | 8 +- .../src/dataframe/command/core/to_schema.rs | 4 +- .../src/dataframe/command/data/alias.rs | 4 +- .../src/dataframe/command/data/append.rs | 2 +- .../src/dataframe/command/data/arg_where.rs | 2 +- .../src/dataframe/command/data/cast.rs | 11 +- .../src/dataframe/command/data/col.rs | 53 ++- .../src/dataframe/command/data/collect.rs | 4 +- .../src/dataframe/command/data/concat.rs | 2 +- .../src/dataframe/command/data/cut.rs | 2 +- .../src/dataframe/command/data/drop.rs | 2 +- .../dataframe/command/data/drop_duplicates.rs | 4 +- .../src/dataframe/command/data/drop_nulls.rs | 2 +- .../src/dataframe/command/data/dummies.rs | 2 +- .../src/dataframe/command/data/explode.rs | 79 ++-- .../src/dataframe/command/data/fill_nan.rs | 4 +- .../src/dataframe/command/data/fill_null.rs | 4 +- .../src/dataframe/command/data/filter.rs | 78 ++-- .../src/dataframe/command/data/filter_with.rs | 4 +- .../src/dataframe/command/data/first.rs | 2 +- .../src/dataframe/command/data/flatten.rs | 78 ++-- .../src/dataframe/command/data/get.rs | 2 +- .../src/dataframe/command/data/join.rs | 2 +- .../src/dataframe/command/data/join_where.rs | 2 +- .../src/dataframe/command/data/last.rs | 4 +- .../src/dataframe/command/data/len.rs | 6 +- .../src/dataframe/command/data/lit.rs | 4 +- .../src/dataframe/command/data/pivot.rs | 54 ++- .../src/dataframe/command/data/qcut.rs | 2 +- .../src/dataframe/command/data/query_df.rs | 2 +- .../src/dataframe/command/data/rename.rs | 5 +- .../src/dataframe/command/data/reverse.rs | 2 +- .../src/dataframe/command/data/sample.rs | 11 +- .../src/dataframe/command/data/select.rs | 23 +- .../src/dataframe/command/data/shift.rs | 7 +- .../src/dataframe/command/data/slice.rs | 2 +- .../dataframe/command/data/sort_by_expr.rs | 71 ++-- .../src/dataframe/command/data/sql_context.rs | 8 +- .../src/dataframe/command/data/sql_expr.rs | 60 ++- .../command/data/struct_json_encode.rs | 2 +- .../src/dataframe/command/data/take.rs | 2 +- .../src/dataframe/command/data/unique.rs | 20 +- .../src/dataframe/command/data/unnest.rs | 2 +- .../src/dataframe/command/data/unpivot.rs | 202 +++++----- .../src/dataframe/command/data/with_column.rs | 2 +- .../src/dataframe/command/datetime/as_date.rs | 14 +- .../dataframe/command/datetime/as_datetime.rs | 46 +-- .../command/datetime/convert_time_zone.rs | 4 +- .../dataframe/command/datetime/datepart.rs | 2 +- .../src/dataframe/command/datetime/get_day.rs | 10 +- .../dataframe/command/datetime/get_hour.rs | 10 +- .../dataframe/command/datetime/get_minute.rs | 10 +- .../dataframe/command/datetime/get_month.rs | 10 +- .../command/datetime/get_nanosecond.rs | 10 +- .../dataframe/command/datetime/get_ordinal.rs | 10 +- .../dataframe/command/datetime/get_second.rs | 10 +- .../dataframe/command/datetime/get_week.rs | 10 +- .../dataframe/command/datetime/get_weekday.rs | 10 +- .../dataframe/command/datetime/get_year.rs | 10 +- .../command/datetime/replace_time_zone.rs | 4 +- .../dataframe/command/datetime/strftime.rs | 6 +- .../dataframe/command/datetime/truncate.rs | 8 +- .../src/dataframe/command/index/arg_max.rs | 2 +- .../src/dataframe/command/index/arg_min.rs | 2 +- .../src/dataframe/command/index/arg_sort.rs | 2 +- .../src/dataframe/command/index/arg_unique.rs | 2 +- .../dataframe/command/index/set_with_idx.rs | 2 +- .../dataframe/command/integer/to_decimal.rs | 15 +- .../dataframe/command/integer/to_integer.rs | 15 +- .../src/dataframe/command/list/contains.rs | 8 +- .../dataframe/command/string/concat_str.rs | 2 +- .../src/dataframe/command/string/contains.rs | 8 +- .../src/dataframe/command/string/replace.rs | 18 +- .../dataframe/command/string/replace_all.rs | 13 +- .../src/dataframe/command/string/str_join.rs | 6 +- .../dataframe/command/string/str_lengths.rs | 6 +- .../src/dataframe/command/string/str_slice.rs | 8 +- .../src/dataframe/command/string/str_split.rs | 2 +- .../command/string/str_strip_chars.rs | 9 +- .../dataframe/command/string/to_lowercase.rs | 10 +- .../dataframe/command/string/to_uppercase.rs | 10 +- .../src/dataframe/values/mod.rs | 2 +- .../values/nu_dataframe/between_values.rs | 4 +- .../values/nu_dataframe/conversion.rs | 8 +- .../values/nu_dataframe/custom_value.rs | 2 +- .../src/dataframe/values/nu_dataframe/mod.rs | 8 +- .../values/nu_dataframe/operations.rs | 4 +- .../src/dataframe/values/nu_dtype/mod.rs | 24 +- .../values/nu_expression/custom_value.rs | 4 +- .../src/dataframe/values/nu_expression/mod.rs | 4 +- .../values/nu_lazyframe/custom_value.rs | 2 +- .../src/dataframe/values/nu_lazyframe/mod.rs | 6 +- .../dataframe/values/nu_lazygroupby/mod.rs | 2 +- .../src/dataframe/values/nu_schema/mod.rs | 4 +- crates/nu_plugin_polars/src/lib.rs | 6 +- crates/nu_plugin_polars/src/main.rs | 2 +- crates/nu_plugin_query/Cargo.toml | 4 +- crates/nu_plugin_query/src/lib.rs | 6 +- crates/nu_plugin_query/src/main.rs | 2 +- crates/nu_plugin_query/src/query_json.rs | 2 +- crates/nu_plugin_query/src/query_web.rs | 20 +- crates/nu_plugin_query/src/query_xml.rs | 6 +- crates/nu_plugin_query/src/web_tables.rs | 2 +- crates/nu_plugin_stress_internals/Cargo.toml | 4 +- crates/nu_plugin_stress_internals/src/main.rs | 4 +- crates/nuon/Cargo.toml | 4 +- crates/nuon/src/from.rs | 8 +- crates/nuon/src/lib.rs | 91 ++--- crates/nuon/src/to.rs | 2 +- rust-toolchain.toml | 2 +- src/config_files.rs | 5 +- src/ide.rs | 12 +- src/logger.rs | 4 +- src/main.rs | 8 +- src/run.rs | 5 +- src/signals.rs | 4 +- src/terminal.rs | 2 +- src/test_bins.rs | 3 +- tests/plugins/custom_values.rs | 40 +- tests/repl/test_bits.rs | 2 +- tests/repl/test_cell_path.rs | 2 +- tests/repl/test_commandline.rs | 2 +- tests/repl/test_conditionals.rs | 2 +- tests/repl/test_config.rs | 2 +- tests/repl/test_converters.rs | 2 +- tests/repl/test_custom_commands.rs | 2 +- tests/repl/test_engine.rs | 2 +- tests/repl/test_env.rs | 2 +- tests/repl/test_help.rs | 2 +- tests/repl/test_hiding.rs | 2 +- tests/repl/test_ide.rs | 2 +- tests/repl/test_iteration.rs | 2 +- tests/repl/test_known_external.rs | 2 +- tests/repl/test_math.rs | 2 +- tests/repl/test_modules.rs | 2 +- tests/repl/test_parser.rs | 2 +- tests/repl/test_ranges.rs | 2 +- tests/repl/test_regex.rs | 2 +- tests/repl/test_signatures.rs | 2 +- tests/repl/test_spread.rs | 10 +- tests/repl/test_stdlib.rs | 2 +- tests/repl/test_strings.rs | 2 +- tests/repl/test_table_operations.rs | 6 +- tests/repl/test_type_check.rs | 4 +- tests/shell/pipeline/commands/external.rs | 16 +- tests/shell/pipeline/commands/internal.rs | 16 +- 793 files changed, 4276 insertions(+), 3687 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1f0f00bc50..c5ea0f12b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -730,9 +730,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.5" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ee0c1824c4dea5b5f81736aff91bae041d2c07ee1192bec91054e10e3e601e" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" dependencies = [ "arrayref", "arrayvec 0.7.6", @@ -811,9 +811,9 @@ checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" [[package]] name = "bytemuck" -version = "1.21.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" +checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c" dependencies = [ "bytemuck_derive", ] @@ -1649,9 +1649,9 @@ checksum = "b2972feb8dffe7bc8c5463b1dacda1b0dfbed3710e50f977d965429692d74cd8" [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" dependencies = [ "serde", ] @@ -1894,9 +1894,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "foreign-types" diff --git a/Cargo.toml b/Cargo.toml index 21d786064d..c306c69a4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,13 +4,13 @@ build = "scripts/build.rs" default-run = "nu" description = "A new type of shell" documentation = "https://www.nushell.sh/book/" -edition = "2021" +edition = "2024" exclude = ["images"] homepage = "https://www.nushell.sh" license = "MIT" name = "nu" repository = "https://github.com/nushell/nushell" -rust-version = "1.84.1" +rust-version = "1.85.1" version = "0.104.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/benches/benchmarks.rs b/benches/benchmarks.rs index eb8d448660..a6fd2cf7f4 100644 --- a/benches/benchmarks.rs +++ b/benches/benchmarks.rs @@ -2,8 +2,8 @@ use nu_cli::{eval_source, evaluate_commands}; use nu_plugin_core::{Encoder, EncodingType}; use nu_plugin_protocol::{PluginCallResponse, PluginOutput}; use nu_protocol::{ - engine::{EngineState, Stack}, PipelineData, Signals, Span, Spanned, Value, + engine::{EngineState, Stack}, }; use nu_std::load_standard_library; use nu_utils::{get_default_config, get_default_env}; @@ -11,9 +11,9 @@ use std::{ fmt::Write, hint::black_box, rc::Rc, - sync::{atomic::AtomicBool, Arc}, + sync::{Arc, atomic::AtomicBool}, }; -use tango_bench::{benchmark_fn, tango_benchmarks, tango_main, IntoBenchmarks}; +use tango_bench::{IntoBenchmarks, benchmark_fn, tango_benchmarks, tango_main}; fn load_bench_commands() -> EngineState { nu_command::add_shell_command_context(nu_cmd_lang::create_default_context()) @@ -68,14 +68,14 @@ fn encoding_test_data(row_cnt: usize, col_cnt: usize) -> Value { } fn bench_command( - name: &str, - command: &str, + name: impl Into, + command: impl Into + Clone, stack: Stack, engine: EngineState, ) -> impl IntoBenchmarks { let commands = Spanned { span: Span::unknown(), - item: command.to_string(), + item: command.into(), }; [benchmark_fn(name, move |b| { let commands = commands.clone(); @@ -175,8 +175,8 @@ fn create_example_table_nrows(n: usize) -> String { fn bench_record_create(n: usize) -> impl IntoBenchmarks { bench_command( - &format!("record_create_{n}"), - &create_flat_record_string(n), + format!("record_create_{n}"), + create_flat_record_string(n), Stack::new(), setup_engine(), ) @@ -186,7 +186,7 @@ fn bench_record_flat_access(n: usize) -> impl IntoBenchmarks { let setup_command = create_flat_record_string(n); let (stack, engine) = setup_stack_and_engine_from_command(&setup_command); bench_command( - &format!("record_flat_access_{n}"), + format!("record_flat_access_{n}"), "$record.col_0 | ignore", stack, engine, @@ -198,8 +198,8 @@ fn bench_record_nested_access(n: usize) -> impl IntoBenchmarks { let (stack, engine) = setup_stack_and_engine_from_command(&setup_command); let nested_access = ".col".repeat(n); bench_command( - &format!("record_nested_access_{n}"), - &format!("$record{} | ignore", nested_access), + format!("record_nested_access_{n}"), + format!("$record{} | ignore", nested_access), stack, engine, ) @@ -213,13 +213,13 @@ fn bench_record_insert(n: usize, m: usize) -> impl IntoBenchmarks { write!(insert, " | insert col_{i} {i}").unwrap(); } insert.push_str(" | ignore"); - bench_command(&format!("record_insert_{n}_{m}"), &insert, stack, engine) + bench_command(format!("record_insert_{n}_{m}"), insert, stack, engine) } fn bench_table_create(n: usize) -> impl IntoBenchmarks { bench_command( - &format!("table_create_{n}"), - &create_example_table_nrows(n), + format!("table_create_{n}"), + create_example_table_nrows(n), Stack::new(), setup_engine(), ) @@ -229,7 +229,7 @@ fn bench_table_get(n: usize) -> impl IntoBenchmarks { let setup_command = create_example_table_nrows(n); let (stack, engine) = setup_stack_and_engine_from_command(&setup_command); bench_command( - &format!("table_get_{n}"), + format!("table_get_{n}"), "$table | get bar | math sum | ignore", stack, engine, @@ -240,7 +240,7 @@ fn bench_table_select(n: usize) -> impl IntoBenchmarks { let setup_command = create_example_table_nrows(n); let (stack, engine) = setup_stack_and_engine_from_command(&setup_command); bench_command( - &format!("table_select_{n}"), + format!("table_select_{n}"), "$table | select foo baz | ignore", stack, engine, @@ -255,7 +255,7 @@ fn bench_table_insert_row(n: usize, m: usize) -> impl IntoBenchmarks { write!(insert, " | insert {i} {{ foo: 0, bar: 1, baz: {i} }}").unwrap(); } insert.push_str(" | ignore"); - bench_command(&format!("table_insert_row_{n}_{m}"), &insert, stack, engine) + bench_command(format!("table_insert_row_{n}_{m}"), insert, stack, engine) } fn bench_table_insert_col(n: usize, m: usize) -> impl IntoBenchmarks { @@ -266,15 +266,15 @@ fn bench_table_insert_col(n: usize, m: usize) -> impl IntoBenchmarks { write!(insert, " | insert col_{i} {i}").unwrap(); } insert.push_str(" | ignore"); - bench_command(&format!("table_insert_col_{n}_{m}"), &insert, stack, engine) + bench_command(format!("table_insert_col_{n}_{m}"), insert, stack, engine) } fn bench_eval_interleave(n: usize) -> impl IntoBenchmarks { let engine = setup_engine(); let stack = Stack::new(); bench_command( - &format!("eval_interleave_{n}"), - &format!("seq 1 {n} | wrap a | interleave {{ seq 1 {n} | wrap b }} | ignore"), + format!("eval_interleave_{n}"), + format!("seq 1 {n} | wrap a | interleave {{ seq 1 {n} | wrap b }} | ignore"), stack, engine, ) @@ -285,8 +285,8 @@ fn bench_eval_interleave_with_interrupt(n: usize) -> impl IntoBenchmarks { engine.set_signals(Signals::new(Arc::new(AtomicBool::new(false)))); let stack = Stack::new(); bench_command( - &format!("eval_interleave_with_interrupt_{n}"), - &format!("seq 1 {n} | wrap a | interleave {{ seq 1 {n} | wrap b }} | ignore"), + format!("eval_interleave_with_interrupt_{n}"), + format!("seq 1 {n} | wrap a | interleave {{ seq 1 {n} | wrap b }} | ignore"), stack, engine, ) @@ -296,8 +296,8 @@ fn bench_eval_for(n: usize) -> impl IntoBenchmarks { let engine = setup_engine(); let stack = Stack::new(); bench_command( - &format!("eval_for_{n}"), - &format!("(for $x in (1..{n}) {{ 1 }}) | ignore"), + format!("eval_for_{n}"), + format!("(for $x in (1..{n}) {{ 1 }}) | ignore"), stack, engine, ) @@ -307,8 +307,8 @@ fn bench_eval_each(n: usize) -> impl IntoBenchmarks { let engine = setup_engine(); let stack = Stack::new(); bench_command( - &format!("eval_each_{n}"), - &format!("(1..{n}) | each {{|_| 1 }} | ignore"), + format!("eval_each_{n}"), + format!("(1..{n}) | each {{|_| 1 }} | ignore"), stack, engine, ) @@ -318,8 +318,8 @@ fn bench_eval_par_each(n: usize) -> impl IntoBenchmarks { let engine = setup_engine(); let stack = Stack::new(); bench_command( - &format!("eval_par_each_{n}"), - &format!("(1..{}) | par-each -t 2 {{|_| 1 }} | ignore", n), + format!("eval_par_each_{n}"), + format!("(1..{}) | par-each -t 2 {{|_| 1 }} | ignore", n), stack, engine, ) diff --git a/crates/nu-cli/Cargo.toml b/crates/nu-cli/Cargo.toml index 607bc5af94..ee63e1493a 100644 --- a/crates/nu-cli/Cargo.toml +++ b/crates/nu-cli/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "CLI-related functionality for Nushell" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cli" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-cli" version = "0.104.1" diff --git a/crates/nu-cli/src/commands/history/history_.rs b/crates/nu-cli/src/commands/history/history_.rs index cdb60c5417..ff6746527d 100644 --- a/crates/nu-cli/src/commands/history/history_.rs +++ b/crates/nu-cli/src/commands/history/history_.rs @@ -1,5 +1,5 @@ use nu_engine::command_prelude::*; -use nu_protocol::{shell_error::io::IoError, HistoryFileFormat}; +use nu_protocol::{HistoryFileFormat, shell_error::io::IoError}; use reedline::{ FileBackedHistory, History as ReedlineHistory, HistoryItem, SearchDirection, SearchQuery, SqliteBackedHistory, diff --git a/crates/nu-cli/src/commands/history/history_import.rs b/crates/nu-cli/src/commands/history/history_import.rs index bf394620c2..422de40422 100644 --- a/crates/nu-cli/src/commands/history/history_import.rs +++ b/crates/nu-cli/src/commands/history/history_import.rs @@ -2,8 +2,8 @@ use std::path::{Path, PathBuf}; use nu_engine::command_prelude::*; use nu_protocol::{ - shell_error::{self, io::IoError}, HistoryFileFormat, + shell_error::{self, io::IoError}, }; use reedline::{ @@ -48,8 +48,7 @@ Note that history item IDs are ignored when importing from file."# vec![ Example { example: "history import", - description: - "Append all items from history in the other format to the current history", + description: "Append all items from history in the other format to the current history", result: None, }, Example { @@ -198,7 +197,7 @@ fn item_from_record(mut rec: Record, span: Span) -> Result Result, ShellError> { PathBuf::from(path), "history path exists but is not a file", ) - .into()) + .into()); } Err(e) if e.kind() == std::io::ErrorKind::NotFound => return Ok(None), Err(e) => { @@ -292,7 +291,7 @@ fn backup(path: &Path, span: Span) -> Result, ShellError> { "Could not get metadata", nu_protocol::location!(), ) - .into()) + .into()); } } let bak_path = find_backup_path(path, span)?; diff --git a/crates/nu-cli/src/commands/keybindings_listen.rs b/crates/nu-cli/src/commands/keybindings_listen.rs index ec7b33f296..366d19b1dd 100644 --- a/crates/nu-cli/src/commands/keybindings_listen.rs +++ b/crates/nu-cli/src/commands/keybindings_listen.rs @@ -1,9 +1,9 @@ use crossterm::{ - event::Event, event::KeyCode, event::KeyEvent, execute, terminal, QueueableCommand, + QueueableCommand, event::Event, event::KeyCode, event::KeyEvent, execute, terminal, }; use nu_engine::command_prelude::*; use nu_protocol::shell_error::io::IoError; -use std::io::{stdout, Write}; +use std::io::{Write, stdout}; #[derive(Clone)] pub struct KeybindingsListen; diff --git a/crates/nu-cli/src/completions/attribute_completions.rs b/crates/nu-cli/src/completions/attribute_completions.rs index 20e12b9324..9558032fab 100644 --- a/crates/nu-cli/src/completions/attribute_completions.rs +++ b/crates/nu-cli/src/completions/attribute_completions.rs @@ -1,11 +1,11 @@ -use super::{completion_options::NuMatcher, SemanticSuggestion}; +use super::{SemanticSuggestion, completion_options::NuMatcher}; use crate::{ - completions::{Completer, CompletionOptions}, SuggestionKind, + completions::{Completer, CompletionOptions}, }; use nu_protocol::{ - engine::{Stack, StateWorkingSet}, Span, + engine::{Stack, StateWorkingSet}, }; use reedline::Suggestion; diff --git a/crates/nu-cli/src/completions/base.rs b/crates/nu-cli/src/completions/base.rs index dc620b62ce..4e70d63a76 100644 --- a/crates/nu-cli/src/completions/base.rs +++ b/crates/nu-cli/src/completions/base.rs @@ -1,7 +1,7 @@ use crate::completions::CompletionOptions; use nu_protocol::{ - engine::{Stack, StateWorkingSet}, DeclId, Span, + engine::{Stack, StateWorkingSet}, }; use reedline::Suggestion; diff --git a/crates/nu-cli/src/completions/cell_path_completions.rs b/crates/nu-cli/src/completions/cell_path_completions.rs index 34376b8ddb..8c09929bce 100644 --- a/crates/nu-cli/src/completions/cell_path_completions.rs +++ b/crates/nu-cli/src/completions/cell_path_completions.rs @@ -3,10 +3,10 @@ use std::borrow::Cow; use crate::completions::{Completer, CompletionOptions, SemanticSuggestion, SuggestionKind}; use nu_engine::{column::get_columns, eval_variable}; use nu_protocol::{ + ShellError, Span, Value, ast::{Expr, Expression, FullCellPath, PathMember}, engine::{Stack, StateWorkingSet}, eval_const::eval_constant, - ShellError, Span, Value, }; use reedline::Suggestion; diff --git a/crates/nu-cli/src/completions/command_completions.rs b/crates/nu-cli/src/completions/command_completions.rs index 72d8b3cebe..ce745362de 100644 --- a/crates/nu-cli/src/completions/command_completions.rs +++ b/crates/nu-cli/src/completions/command_completions.rs @@ -1,16 +1,16 @@ use std::collections::HashMap; use crate::{ - completions::{Completer, CompletionOptions}, SuggestionKind, + completions::{Completer, CompletionOptions}, }; use nu_protocol::{ - engine::{CommandType, Stack, StateWorkingSet}, Span, + engine::{CommandType, Stack, StateWorkingSet}, }; use reedline::Suggestion; -use super::{completion_options::NuMatcher, SemanticSuggestion}; +use super::{SemanticSuggestion, completion_options::NuMatcher}; pub struct CommandCompletion { /// Whether to include internal commands diff --git a/crates/nu-cli/src/completions/completer.rs b/crates/nu-cli/src/completions/completer.rs index 2da8c35f20..b2ee95d702 100644 --- a/crates/nu-cli/src/completions/completer.rs +++ b/crates/nu-cli/src/completions/completer.rs @@ -1,17 +1,17 @@ use crate::completions::{ - base::{SemanticSuggestion, SuggestionKind}, AttributableCompletion, AttributeCompletion, CellPathCompletion, CommandCompletion, Completer, CompletionOptions, CustomCompletion, DirectoryCompletion, DotNuCompletion, ExportableCompletion, FileCompletion, FlagCompletion, OperatorCompletion, VariableCompletion, + base::{SemanticSuggestion, SuggestionKind}, }; use nu_color_config::{color_record_to_nustyle, lookup_ansi_color_style}; use nu_engine::eval_block; use nu_parser::{flatten_expression, parse, parse_module_file_or_dir}; use nu_protocol::{ + PipelineData, Span, Type, Value, ast::{Argument, Block, Expr, Expression, FindMapResult, ListItem, Traverse}, debugger::WithoutDebug, engine::{Closure, EngineState, Stack, StateWorkingSet}, - PipelineData, Span, Type, Value, }; use reedline::{Completer as ReedlineCompleter, Suggestion}; use std::sync::Arc; diff --git a/crates/nu-cli/src/completions/completion_common.rs b/crates/nu-cli/src/completions/completion_common.rs index 9e8e8fe119..d258c84a0f 100644 --- a/crates/nu-cli/src/completions/completion_common.rs +++ b/crates/nu-cli/src/completions/completion_common.rs @@ -1,16 +1,16 @@ -use super::{completion_options::NuMatcher, MatchAlgorithm}; +use super::{MatchAlgorithm, completion_options::NuMatcher}; use crate::completions::CompletionOptions; use nu_ansi_term::Style; use nu_engine::env_to_string; use nu_path::dots::expand_ndots; use nu_path::{expand_to_real_path, home_dir}; use nu_protocol::{ - engine::{EngineState, Stack, StateWorkingSet}, Span, + engine::{EngineState, Stack, StateWorkingSet}, }; -use nu_utils::get_ls_colors; use nu_utils::IgnoreCaseExt; -use std::path::{is_separator, Component, Path, PathBuf, MAIN_SEPARATOR as SEP}; +use nu_utils::get_ls_colors; +use std::path::{Component, MAIN_SEPARATOR as SEP, Path, PathBuf, is_separator}; #[derive(Clone, Default)] pub struct PathBuiltFromString { diff --git a/crates/nu-cli/src/completions/completion_options.rs b/crates/nu-cli/src/completions/completion_options.rs index 136129e56c..7022d7988d 100644 --- a/crates/nu-cli/src/completions/completion_options.rs +++ b/crates/nu-cli/src/completions/completion_options.rs @@ -2,8 +2,8 @@ use nu_parser::trim_quotes_str; use nu_protocol::{CompletionAlgorithm, CompletionSort}; use nu_utils::IgnoreCaseExt; use nucleo_matcher::{ - pattern::{Atom, AtomKind, CaseMatching, Normalization}, Config, Matcher, Utf32Str, + pattern::{Atom, AtomKind, CaseMatching, Normalization}, }; use std::{borrow::Cow, fmt::Display}; diff --git a/crates/nu-cli/src/completions/custom_completions.rs b/crates/nu-cli/src/completions/custom_completions.rs index a03a7150b1..6e6d391c54 100644 --- a/crates/nu-cli/src/completions/custom_completions.rs +++ b/crates/nu-cli/src/completions/custom_completions.rs @@ -1,13 +1,13 @@ use crate::completions::{ - completer::map_value_completions, Completer, CompletionOptions, MatchAlgorithm, - SemanticSuggestion, + Completer, CompletionOptions, MatchAlgorithm, SemanticSuggestion, + completer::map_value_completions, }; use nu_engine::eval_call; use nu_protocol::{ + DeclId, PipelineData, Span, Type, Value, ast::{Argument, Call, Expr, Expression}, debugger::WithoutDebug, engine::{EngineState, Stack, StateWorkingSet}, - DeclId, PipelineData, Span, Type, Value, }; use std::collections::HashMap; @@ -106,7 +106,9 @@ impl Completer for CustomCompletion { let positional = options.get("positional").and_then(|val| val.as_bool().ok()); if positional.is_some() { - log::warn!("Use of the positional option is deprecated. Use the substring match algorithm instead."); + log::warn!( + "Use of the positional option is deprecated. Use the substring match algorithm instead." + ); } if let Some(algorithm) = options .get("completion_algorithm") diff --git a/crates/nu-cli/src/completions/directory_completions.rs b/crates/nu-cli/src/completions/directory_completions.rs index 8e9ae13281..466f30c5e7 100644 --- a/crates/nu-cli/src/completions/directory_completions.rs +++ b/crates/nu-cli/src/completions/directory_completions.rs @@ -1,15 +1,15 @@ use crate::completions::{ - completion_common::{adjust_if_intermediate, complete_item, AdjustView}, Completer, CompletionOptions, + completion_common::{AdjustView, adjust_if_intermediate, complete_item}, }; use nu_protocol::{ - engine::{EngineState, Stack, StateWorkingSet}, Span, + engine::{EngineState, Stack, StateWorkingSet}, }; use reedline::Suggestion; use std::path::Path; -use super::{completion_common::FileSuggestion, SemanticSuggestion, SuggestionKind}; +use super::{SemanticSuggestion, SuggestionKind, completion_common::FileSuggestion}; pub struct DirectoryCompletion; diff --git a/crates/nu-cli/src/completions/dotnu_completions.rs b/crates/nu-cli/src/completions/dotnu_completions.rs index 06cf4237fb..299fb995be 100644 --- a/crates/nu-cli/src/completions/dotnu_completions.rs +++ b/crates/nu-cli/src/completions/dotnu_completions.rs @@ -1,17 +1,18 @@ use crate::completions::{ - completion_common::{surround_remove, FileSuggestion}, + Completer, CompletionOptions, SemanticSuggestion, SuggestionKind, + completion_common::{FileSuggestion, surround_remove}, completion_options::NuMatcher, - file_path_completion, Completer, CompletionOptions, SemanticSuggestion, SuggestionKind, + file_path_completion, }; use nu_path::expand_tilde; use nu_protocol::{ - engine::{Stack, StateWorkingSet, VirtualPath}, Span, + engine::{Stack, StateWorkingSet, VirtualPath}, }; use reedline::Suggestion; use std::{ collections::HashSet, - path::{is_separator, PathBuf, MAIN_SEPARATOR_STR}, + path::{MAIN_SEPARATOR_STR, PathBuf, is_separator}, }; pub struct DotNuCompletion { diff --git a/crates/nu-cli/src/completions/exportable_completions.rs b/crates/nu-cli/src/completions/exportable_completions.rs index db8bb6b143..a431dd777a 100644 --- a/crates/nu-cli/src/completions/exportable_completions.rs +++ b/crates/nu-cli/src/completions/exportable_completions.rs @@ -1,10 +1,10 @@ use crate::completions::{ - completion_common::surround_remove, completion_options::NuMatcher, Completer, - CompletionOptions, SemanticSuggestion, SuggestionKind, + Completer, CompletionOptions, SemanticSuggestion, SuggestionKind, + completion_common::surround_remove, completion_options::NuMatcher, }; use nu_protocol::{ - engine::{Stack, StateWorkingSet}, ModuleId, Span, + engine::{Stack, StateWorkingSet}, }; use reedline::Suggestion; diff --git a/crates/nu-cli/src/completions/file_completions.rs b/crates/nu-cli/src/completions/file_completions.rs index cb7882cbea..e48e8f2d72 100644 --- a/crates/nu-cli/src/completions/file_completions.rs +++ b/crates/nu-cli/src/completions/file_completions.rs @@ -1,15 +1,15 @@ use crate::completions::{ - completion_common::{adjust_if_intermediate, complete_item, AdjustView}, Completer, CompletionOptions, + completion_common::{AdjustView, adjust_if_intermediate, complete_item}, }; use nu_protocol::{ - engine::{EngineState, Stack, StateWorkingSet}, Span, + engine::{EngineState, Stack, StateWorkingSet}, }; use reedline::Suggestion; use std::path::Path; -use super::{completion_common::FileSuggestion, SemanticSuggestion, SuggestionKind}; +use super::{SemanticSuggestion, SuggestionKind, completion_common::FileSuggestion}; pub struct FileCompletion; diff --git a/crates/nu-cli/src/completions/flag_completions.rs b/crates/nu-cli/src/completions/flag_completions.rs index 387df1b2d9..3b616ae415 100644 --- a/crates/nu-cli/src/completions/flag_completions.rs +++ b/crates/nu-cli/src/completions/flag_completions.rs @@ -1,9 +1,9 @@ use crate::completions::{ - completion_options::NuMatcher, Completer, CompletionOptions, SemanticSuggestion, SuggestionKind, + Completer, CompletionOptions, SemanticSuggestion, SuggestionKind, completion_options::NuMatcher, }; use nu_protocol::{ - engine::{Stack, StateWorkingSet}, DeclId, Span, + engine::{Stack, StateWorkingSet}, }; use reedline::Suggestion; diff --git a/crates/nu-cli/src/completions/mod.rs b/crates/nu-cli/src/completions/mod.rs index b67d7db354..9c8a03f52a 100644 --- a/crates/nu-cli/src/completions/mod.rs +++ b/crates/nu-cli/src/completions/mod.rs @@ -24,7 +24,7 @@ pub use custom_completions::CustomCompletion; pub use directory_completions::DirectoryCompletion; pub use dotnu_completions::DotNuCompletion; pub use exportable_completions::ExportableCompletion; -pub use file_completions::{file_path_completion, FileCompletion}; +pub use file_completions::{FileCompletion, file_path_completion}; pub use flag_completions::FlagCompletion; pub use operator_completions::OperatorCompletion; pub use variable_completions::VariableCompletion; diff --git a/crates/nu-cli/src/completions/operator_completions.rs b/crates/nu-cli/src/completions/operator_completions.rs index 3d1db30673..4a66a41596 100644 --- a/crates/nu-cli/src/completions/operator_completions.rs +++ b/crates/nu-cli/src/completions/operator_completions.rs @@ -1,10 +1,10 @@ use crate::completions::{ - completion_options::NuMatcher, Completer, CompletionOptions, SemanticSuggestion, SuggestionKind, + Completer, CompletionOptions, SemanticSuggestion, SuggestionKind, completion_options::NuMatcher, }; use nu_protocol::{ + ENV_VARIABLE_ID, Span, Type, Value, ast::{self, Comparison, Expr, Expression}, engine::{Stack, StateWorkingSet}, - Span, Type, Value, ENV_VARIABLE_ID, }; use reedline::Suggestion; use strum::{EnumMessage, IntoEnumIterator}; diff --git a/crates/nu-cli/src/completions/variable_completions.rs b/crates/nu-cli/src/completions/variable_completions.rs index c72d882119..16a1c84a90 100644 --- a/crates/nu-cli/src/completions/variable_completions.rs +++ b/crates/nu-cli/src/completions/variable_completions.rs @@ -1,7 +1,7 @@ use crate::completions::{Completer, CompletionOptions, SemanticSuggestion, SuggestionKind}; use nu_protocol::{ - engine::{Stack, StateWorkingSet}, Span, VarId, + engine::{Stack, StateWorkingSet}, }; use reedline::Suggestion; diff --git a/crates/nu-cli/src/config_files.rs b/crates/nu-cli/src/config_files.rs index bb54a860d6..9bd46afd10 100644 --- a/crates/nu-cli/src/config_files.rs +++ b/crates/nu-cli/src/config_files.rs @@ -2,10 +2,11 @@ use crate::util::eval_source; #[cfg(feature = "plugin")] use nu_path::canonicalize_with; #[cfg(feature = "plugin")] -use nu_protocol::{engine::StateWorkingSet, ParseError, PluginRegistryFile, Spanned}; +use nu_protocol::{ParseError, PluginRegistryFile, Spanned, engine::StateWorkingSet}; use nu_protocol::{ + PipelineData, engine::{EngineState, Stack}, - report_shell_error, PipelineData, + report_shell_error, }; #[cfg(feature = "plugin")] use nu_utils::perf; @@ -18,7 +19,7 @@ const OLD_PLUGIN_FILE: &str = "plugin.nu"; #[cfg(feature = "plugin")] pub fn read_plugin_file(engine_state: &mut EngineState, plugin_file: Option>) { - use nu_protocol::{shell_error::io::IoError, ShellError}; + use nu_protocol::{ShellError, shell_error::io::IoError}; use std::path::Path; let span = plugin_file.as_ref().map(|s| s.span); @@ -230,8 +231,8 @@ pub fn eval_config_contents( #[cfg(feature = "plugin")] pub fn migrate_old_plugin_file(engine_state: &EngineState) -> bool { use nu_protocol::{ - shell_error::io::IoError, PluginExample, PluginIdentity, PluginRegistryItem, - PluginRegistryItemData, PluginSignature, ShellError, + PluginExample, PluginIdentity, PluginRegistryItem, PluginRegistryItemData, PluginSignature, + ShellError, shell_error::io::IoError, }; use std::collections::BTreeMap; diff --git a/crates/nu-cli/src/eval_cmds.rs b/crates/nu-cli/src/eval_cmds.rs index c126d3c6fc..dce1417507 100644 --- a/crates/nu-cli/src/eval_cmds.rs +++ b/crates/nu-cli/src/eval_cmds.rs @@ -2,10 +2,11 @@ use log::info; use nu_engine::eval_block; use nu_parser::parse; use nu_protocol::{ + PipelineData, ShellError, Spanned, Value, cli_error::report_compile_error, debugger::WithoutDebug, engine::{EngineState, Stack, StateWorkingSet}, - report_parse_error, report_parse_warning, PipelineData, ShellError, Spanned, Value, + report_parse_error, report_parse_warning, }; use std::sync::Arc; diff --git a/crates/nu-cli/src/eval_file.rs b/crates/nu-cli/src/eval_file.rs index f302111b93..70444a2623 100644 --- a/crates/nu-cli/src/eval_file.rs +++ b/crates/nu-cli/src/eval_file.rs @@ -4,12 +4,12 @@ use nu_engine::eval_block; use nu_parser::parse; use nu_path::canonicalize_with; use nu_protocol::{ + PipelineData, ShellError, Span, Value, cli_error::report_compile_error, debugger::WithoutDebug, engine::{EngineState, Stack, StateWorkingSet}, report_parse_error, report_parse_warning, shell_error::io::*, - PipelineData, ShellError, Span, Value, }; use std::{path::PathBuf, sync::Arc}; diff --git a/crates/nu-cli/src/lib.rs b/crates/nu-cli/src/lib.rs index 3fe293a030..21174b3f9e 100644 --- a/crates/nu-cli/src/lib.rs +++ b/crates/nu-cli/src/lib.rs @@ -18,7 +18,7 @@ mod validation; pub use commands::add_cli_context; pub use completions::{FileCompletion, NuCompleter, SemanticSuggestion, SuggestionKind}; pub use config_files::eval_config_contents; -pub use eval_cmds::{evaluate_commands, EvaluateCommandsOpts}; +pub use eval_cmds::{EvaluateCommandsOpts, evaluate_commands}; pub use eval_file::evaluate_file; pub use menus::NuHelpCompleter; pub use nu_highlight::NuHighlight; diff --git a/crates/nu-cli/src/menus/help_completions.rs b/crates/nu-cli/src/menus/help_completions.rs index ed60579f81..a002dd85ee 100644 --- a/crates/nu-cli/src/menus/help_completions.rs +++ b/crates/nu-cli/src/menus/help_completions.rs @@ -1,5 +1,5 @@ -use nu_engine::documentation::{get_flags_section, HelpStyle}; -use nu_protocol::{engine::EngineState, levenshtein_distance, Config}; +use nu_engine::documentation::{HelpStyle, get_flags_section}; +use nu_protocol::{Config, engine::EngineState, levenshtein_distance}; use nu_utils::IgnoreCaseExt; use reedline::{Completer, Suggestion}; use std::{fmt::Write, sync::Arc}; diff --git a/crates/nu-cli/src/menus/menu_completions.rs b/crates/nu-cli/src/menus/menu_completions.rs index 38a48afba6..6369ad8d79 100644 --- a/crates/nu-cli/src/menus/menu_completions.rs +++ b/crates/nu-cli/src/menus/menu_completions.rs @@ -1,10 +1,10 @@ use nu_engine::eval_block; use nu_protocol::{ + BlockId, IntoPipelineData, Span, Value, debugger::WithoutDebug, engine::{EngineState, Stack}, - BlockId, IntoPipelineData, Span, Value, }; -use reedline::{menu_functions::parse_selection_char, Completer, Suggestion}; +use reedline::{Completer, Suggestion, menu_functions::parse_selection_char}; use std::sync::Arc; const SELECTION_CHAR: char = '!'; diff --git a/crates/nu-cli/src/prompt_update.rs b/crates/nu-cli/src/prompt_update.rs index 661b8c65f7..692d87d5aa 100644 --- a/crates/nu-cli/src/prompt_update.rs +++ b/crates/nu-cli/src/prompt_update.rs @@ -2,8 +2,9 @@ use crate::NushellPrompt; use log::{trace, warn}; use nu_engine::ClosureEvalOnce; use nu_protocol::{ + Config, PipelineData, Value, engine::{EngineState, Stack}, - report_shell_error, Config, PipelineData, Value, + report_shell_error, }; use reedline::Prompt; diff --git a/crates/nu-cli/src/reedline_config.rs b/crates/nu-cli/src/reedline_config.rs index eb85d76de2..a1b70bd2fb 100644 --- a/crates/nu-cli/src/reedline_config.rs +++ b/crates/nu-cli/src/reedline_config.rs @@ -1,19 +1,20 @@ -use crate::{menus::NuMenuCompleter, NuHelpCompleter}; +use crate::{NuHelpCompleter, menus::NuMenuCompleter}; use crossterm::event::{KeyCode, KeyModifiers}; use nu_ansi_term::Style; use nu_color_config::{color_record_to_nustyle, lookup_ansi_color_style}; use nu_engine::eval_block; use nu_parser::parse; use nu_protocol::{ + Config, EditBindings, FromValue, ParsedKeybinding, ParsedMenu, PipelineData, Record, + ShellError, Span, Type, Value, debugger::WithoutDebug, engine::{EngineState, Stack, StateWorkingSet}, - extract_value, Config, EditBindings, FromValue, ParsedKeybinding, ParsedMenu, PipelineData, - Record, ShellError, Span, Type, Value, + extract_value, }; use reedline::{ - default_emacs_keybindings, default_vi_insert_keybindings, default_vi_normal_keybindings, ColumnarMenu, DescriptionMenu, DescriptionMode, EditCommand, IdeMenu, Keybindings, ListMenu, - MenuBuilder, Reedline, ReedlineEvent, ReedlineMenu, + MenuBuilder, Reedline, ReedlineEvent, ReedlineMenu, default_emacs_keybindings, + default_vi_insert_keybindings, default_vi_normal_keybindings, }; use std::sync::Arc; diff --git a/crates/nu-cli/src/repl.rs b/crates/nu-cli/src/repl.rs index ae384efd78..7cfb3adcab 100644 --- a/crates/nu-cli/src/repl.rs +++ b/crates/nu-cli/src/repl.rs @@ -6,12 +6,12 @@ use crate::prompt_update::{ VSCODE_PRE_EXECUTION_MARKER, }; use crate::{ + NuHighlighter, NuValidator, NushellPrompt, completions::NuCompleter, nu_highlight::NoOpHighlighter, prompt_update, - reedline_config::{add_menus, create_keybindings, KeybindingsMode}, + reedline_config::{KeybindingsMode, add_menus, create_keybindings}, util::eval_source, - NuHighlighter, NuValidator, NushellPrompt, }; use crossterm::cursor::SetCursorStyle; use log::{error, trace, warn}; @@ -24,13 +24,13 @@ use nu_engine::exit::cleanup_exit; use nu_parser::{lex, parse, trim_quotes_str}; use nu_protocol::shell_error::io::IoError; use nu_protocol::{ + HistoryConfig, HistoryFileFormat, PipelineData, ShellError, Span, Spanned, Value, config::NuCursorShape, engine::{EngineState, Stack, StateWorkingSet}, - report_shell_error, HistoryConfig, HistoryFileFormat, PipelineData, ShellError, Span, Spanned, - Value, + report_shell_error, }; use nu_utils::{ - filesystem::{have_permission, PermissionResult}, + filesystem::{PermissionResult, have_permission}, perf, }; use reedline::{ @@ -42,7 +42,7 @@ use std::{ collections::HashMap, env::temp_dir, io::{self, IsTerminal, Write}, - panic::{catch_unwind, AssertUnwindSafe}, + panic::{AssertUnwindSafe, catch_unwind}, path::{Path, PathBuf}, sync::Arc, time::{Duration, Instant}, @@ -1451,7 +1451,7 @@ fn are_session_ids_in_sync() { #[cfg(test)] mod test_auto_cd { - use super::{do_auto_cd, escape_special_vscode_bytes, parse_operation, ReplOperation}; + use super::{ReplOperation, do_auto_cd, escape_special_vscode_bytes, parse_operation}; use nu_path::AbsolutePath; use nu_protocol::engine::{EngineState, Stack}; use tempfile::tempdir; diff --git a/crates/nu-cli/src/syntax_highlight.rs b/crates/nu-cli/src/syntax_highlight.rs index 283a06f97e..ca674f72ce 100644 --- a/crates/nu-cli/src/syntax_highlight.rs +++ b/crates/nu-cli/src/syntax_highlight.rs @@ -2,11 +2,11 @@ use log::trace; use nu_ansi_term::Style; use nu_color_config::{get_matching_brackets_style, get_shape_color}; use nu_engine::env; -use nu_parser::{flatten_block, parse, FlatShape}; +use nu_parser::{FlatShape, flatten_block, parse}; use nu_protocol::{ + Span, ast::{Block, Expr, Expression, PipelineRedirection, RecordItem}, engine::{EngineState, Stack, StateWorkingSet}, - Span, }; use reedline::{Highlighter, StyledText}; use std::sync::Arc; diff --git a/crates/nu-cli/src/util.rs b/crates/nu-cli/src/util.rs index 727a8290ed..261d7b2ba9 100644 --- a/crates/nu-cli/src/util.rs +++ b/crates/nu-cli/src/util.rs @@ -2,13 +2,13 @@ use nu_cmd_base::hook::eval_hook; use nu_engine::{eval_block, eval_block_with_early_return}; -use nu_parser::{lex, parse, unescape_unquote_string, Token, TokenContents}; +use nu_parser::{Token, TokenContents, lex, parse, unescape_unquote_string}; use nu_protocol::{ + PipelineData, ShellError, Span, Value, cli_error::report_compile_error, debugger::WithoutDebug, engine::{EngineState, Stack, StateWorkingSet}, - report_parse_error, report_parse_warning, report_shell_error, PipelineData, ShellError, Span, - Value, + report_parse_error, report_parse_warning, report_shell_error, }; #[cfg(windows)] use nu_utils::enable_vt_processing; diff --git a/crates/nu-cli/src/validation.rs b/crates/nu-cli/src/validation.rs index 99d1867197..1f51743ee8 100644 --- a/crates/nu-cli/src/validation.rs +++ b/crates/nu-cli/src/validation.rs @@ -1,7 +1,7 @@ use nu_parser::parse; use nu_protocol::{ - engine::{EngineState, StateWorkingSet}, ParseError, + engine::{EngineState, StateWorkingSet}, }; use reedline::{ValidationResult, Validator}; use std::sync::Arc; diff --git a/crates/nu-cli/tests/commands/history_import.rs b/crates/nu-cli/tests/commands/history_import.rs index 79ebdc1cfc..f07df1cd9d 100644 --- a/crates/nu-cli/tests/commands/history_import.rs +++ b/crates/nu-cli/tests/commands/history_import.rs @@ -1,5 +1,5 @@ use nu_protocol::HistoryFileFormat; -use nu_test_support::{nu, Outcome}; +use nu_test_support::{Outcome, nu}; use reedline::{ FileBackedHistory, History, HistoryItem, HistoryItemId, ReedlineError, SearchQuery, SqliteBackedHistory, diff --git a/crates/nu-cli/tests/completions/mod.rs b/crates/nu-cli/tests/completions/mod.rs index c8a02790dd..d1dde334a7 100644 --- a/crates/nu-cli/tests/completions/mod.rs +++ b/crates/nu-cli/tests/completions/mod.rs @@ -1,8 +1,8 @@ pub mod support; use std::{ - fs::{read_dir, FileType, ReadDir}, - path::{PathBuf, MAIN_SEPARATOR}, + fs::{FileType, ReadDir, read_dir}, + path::{MAIN_SEPARATOR, PathBuf}, sync::Arc, }; @@ -10,7 +10,7 @@ use nu_cli::NuCompleter; use nu_engine::eval_block; use nu_parser::parse; use nu_path::expand_tilde; -use nu_protocol::{debugger::WithoutDebug, engine::StateWorkingSet, Config, PipelineData}; +use nu_protocol::{Config, PipelineData, debugger::WithoutDebug, engine::StateWorkingSet}; use nu_std::load_standard_library; use reedline::{Completer, Suggestion}; use rstest::{fixture, rstest}; diff --git a/crates/nu-cli/tests/completions/support/completions_helpers.rs b/crates/nu-cli/tests/completions/support/completions_helpers.rs index e36816bb14..38b8c00db1 100644 --- a/crates/nu-cli/tests/completions/support/completions_helpers.rs +++ b/crates/nu-cli/tests/completions/support/completions_helpers.rs @@ -2,9 +2,9 @@ use nu_engine::eval_block; use nu_parser::parse; use nu_path::{AbsolutePathBuf, PathBuf}; use nu_protocol::{ + PipelineData, ShellError, Span, Value, debugger::WithoutDebug, engine::{EngineState, Stack, StateWorkingSet}, - PipelineData, ShellError, Span, Value, }; use nu_test_support::fs; use reedline::Suggestion; @@ -273,13 +273,15 @@ pub fn merge_input( engine_state.merge_delta(delta)?; - assert!(eval_block::( - engine_state, - stack, - &block, - PipelineData::Value(Value::nothing(Span::unknown()), None), - ) - .is_ok()); + assert!( + eval_block::( + engine_state, + stack, + &block, + PipelineData::Value(Value::nothing(Span::unknown()), None), + ) + .is_ok() + ); // Merge environment into the permanent state engine_state.merge_env(stack) diff --git a/crates/nu-cmd-base/Cargo.toml b/crates/nu-cmd-base/Cargo.toml index 7049b261bb..f694c93410 100644 --- a/crates/nu-cmd-base/Cargo.toml +++ b/crates/nu-cmd-base/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["The Nushell Project Developers"] description = "The foundation tools to build Nushell commands." -edition = "2021" +edition = "2024" license = "MIT" name = "nu-cmd-base" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-base" @@ -21,4 +21,4 @@ nu-protocol = { path = "../nu-protocol", version = "0.104.1", default-features = indexmap = { workspace = true } miette = { workspace = true } -[dev-dependencies] \ No newline at end of file +[dev-dependencies] diff --git a/crates/nu-cmd-base/src/formats/to/delimited.rs b/crates/nu-cmd-base/src/formats/to/delimited.rs index d7084bcbc1..d003fb9ffa 100644 --- a/crates/nu-cmd-base/src/formats/to/delimited.rs +++ b/crates/nu-cmd-base/src/formats/to/delimited.rs @@ -1,4 +1,4 @@ -use indexmap::{indexset, IndexSet}; +use indexmap::{IndexSet, indexset}; use nu_protocol::Value; pub fn merge_descriptors(values: &[Value]) -> Vec { diff --git a/crates/nu-cmd-base/src/hook.rs b/crates/nu-cmd-base/src/hook.rs index bddf63f334..c6fd81409f 100644 --- a/crates/nu-cmd-base/src/hook.rs +++ b/crates/nu-cmd-base/src/hook.rs @@ -2,10 +2,10 @@ use miette::Result; use nu_engine::{eval_block, eval_block_with_early_return}; use nu_parser::parse; use nu_protocol::{ + PipelineData, PositionalArg, ShellError, Span, Type, Value, VarId, cli_error::{report_parse_error, report_shell_error}, debugger::WithoutDebug, engine::{Closure, EngineState, Stack, StateWorkingSet}, - PipelineData, PositionalArg, ShellError, Span, Type, Value, VarId, }; use std::{collections::HashMap, sync::Arc}; diff --git a/crates/nu-cmd-base/src/input_handler.rs b/crates/nu-cmd-base/src/input_handler.rs index 7d61f90cb0..b58666b142 100644 --- a/crates/nu-cmd-base/src/input_handler.rs +++ b/crates/nu-cmd-base/src/input_handler.rs @@ -1,4 +1,4 @@ -use nu_protocol::{ast::CellPath, PipelineData, ShellError, Signals, Span, Value}; +use nu_protocol::{PipelineData, ShellError, Signals, Span, Value, ast::CellPath}; use std::sync::Arc; pub trait CmdArgument { diff --git a/crates/nu-cmd-base/src/util.rs b/crates/nu-cmd-base/src/util.rs index 49c3f28f8b..4b86166b96 100644 --- a/crates/nu-cmd-base/src/util.rs +++ b/crates/nu-cmd-base/src/util.rs @@ -1,6 +1,6 @@ use nu_protocol::{ - engine::{EngineState, Stack}, Range, ShellError, Span, Value, + engine::{EngineState, Stack}, }; use std::ops::Bound; diff --git a/crates/nu-cmd-extra/Cargo.toml b/crates/nu-cmd-extra/Cargo.toml index b27925c25a..3d7fa23a00 100644 --- a/crates/nu-cmd-extra/Cargo.toml +++ b/crates/nu-cmd-extra/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["The Nushell Project Developers"] description = "Nushell's extra commands that are not part of the 1.0 api standard." -edition = "2021" +edition = "2024" license = "MIT" name = "nu-cmd-extra" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-extra" diff --git a/crates/nu-cmd-extra/src/example_test.rs b/crates/nu-cmd-extra/src/example_test.rs index 9ce94bf05b..ac3ca92653 100644 --- a/crates/nu-cmd-extra/src/example_test.rs +++ b/crates/nu-cmd-extra/src/example_test.rs @@ -16,8 +16,8 @@ mod test_examples { }; use nu_protocol::{ - engine::{Command, EngineState, StateWorkingSet}, Type, + engine::{Command, EngineState, StateWorkingSet}, }; use std::collections::HashSet; diff --git a/crates/nu-cmd-extra/src/extra/bits/and.rs b/crates/nu-cmd-extra/src/extra/bits/and.rs index dfac65af72..f9e1bbd794 100644 --- a/crates/nu-cmd-extra/src/extra/bits/and.rs +++ b/crates/nu-cmd-extra/src/extra/bits/and.rs @@ -65,7 +65,7 @@ impl Command for BitsAnd { return Err(ShellError::TypeMismatch { err_message: "Endian must be one of native, little, big".to_string(), span: endian.span, - }) + }); } } } else { @@ -113,8 +113,7 @@ impl Command for BitsAnd { ])), }, Example { - description: - "Apply bitwise and to binary data of varying lengths with specified endianness", + description: "Apply bitwise and to binary data of varying lengths with specified endianness", example: "0x[c0 ff ee] | bits and 0x[ff] --endian big", result: Some(Value::test_binary(vec![0x00, 0x00, 0xee])), }, diff --git a/crates/nu-cmd-extra/src/extra/bits/not.rs b/crates/nu-cmd-extra/src/extra/bits/not.rs index d014d21abe..860065fc90 100644 --- a/crates/nu-cmd-extra/src/extra/bits/not.rs +++ b/crates/nu-cmd-extra/src/extra/bits/not.rs @@ -1,5 +1,5 @@ -use super::{get_number_bytes, NumberBytes}; -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use super::{NumberBytes, get_number_bytes}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; #[derive(Clone)] @@ -100,8 +100,7 @@ impl Command for BitsNot { )), }, Example { - description: - "Apply logical negation to a list of numbers, treat input as 2 bytes number", + description: "Apply logical negation to a list of numbers, treat input as 2 bytes number", example: "[4 3 2] | bits not --number-bytes 2", result: Some(Value::list( vec![ @@ -113,8 +112,7 @@ impl Command for BitsNot { )), }, Example { - description: - "Apply logical negation to a list of numbers, treat input as signed number", + description: "Apply logical negation to a list of numbers, treat input as signed number", example: "[4 3 2] | bits not --signed", result: Some(Value::list( vec![ diff --git a/crates/nu-cmd-extra/src/extra/bits/or.rs b/crates/nu-cmd-extra/src/extra/bits/or.rs index d3859bb90e..57e77fdcd9 100644 --- a/crates/nu-cmd-extra/src/extra/bits/or.rs +++ b/crates/nu-cmd-extra/src/extra/bits/or.rs @@ -66,7 +66,7 @@ impl Command for BitsOr { return Err(ShellError::TypeMismatch { err_message: "Endian must be one of native, little, big".to_string(), span: endian.span, - }) + }); } } } else { @@ -106,8 +106,7 @@ impl Command for BitsOr { result: Some(Value::test_binary(vec![0xca, 0xfe])), }, Example { - description: - "Apply bitwise or to binary data of varying lengths with specified endianness", + description: "Apply bitwise or to binary data of varying lengths with specified endianness", example: "0x[c0 ff ee] | bits or 0x[ff] --endian big", result: Some(Value::test_binary(vec![0xc0, 0xff, 0xff])), }, 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 dffd09d4b0..0abddf27d2 100644 --- a/crates/nu-cmd-extra/src/extra/bits/rotate_left.rs +++ b/crates/nu-cmd-extra/src/extra/bits/rotate_left.rs @@ -1,5 +1,5 @@ -use super::{get_input_num_type, get_number_bytes, InputNumType, NumberBytes}; -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use super::{InputNumType, NumberBytes, get_input_num_type, get_number_bytes}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; struct Arguments { @@ -222,7 +222,8 @@ fn rotate_bytes_and_bits_left(data: &[u8], byte_shift: usize, bit_shift: usize) debug_assert!(byte_shift < data.len()); debug_assert!( (1..8).contains(&bit_shift), - "Bit shifts of 0 can't be handled by this impl and everything else should be part of the byteshift"); + "Bit shifts of 0 can't be handled by this impl and everything else should be part of the byteshift" + ); let mut bytes = Vec::with_capacity(data.len()); let mut next_index = byte_shift; for _ in 0..data.len() { 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 df2bc84547..e0499a618e 100644 --- a/crates/nu-cmd-extra/src/extra/bits/rotate_right.rs +++ b/crates/nu-cmd-extra/src/extra/bits/rotate_right.rs @@ -1,5 +1,5 @@ -use super::{get_input_num_type, get_number_bytes, InputNumType, NumberBytes}; -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use super::{InputNumType, NumberBytes, get_input_num_type, get_number_bytes}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; struct Arguments { 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 5b8e6a5ae6..96539f906b 100644 --- a/crates/nu-cmd-extra/src/extra/bits/shift_left.rs +++ b/crates/nu-cmd-extra/src/extra/bits/shift_left.rs @@ -1,6 +1,6 @@ -use super::{get_input_num_type, get_number_bytes, InputNumType, NumberBytes}; +use super::{InputNumType, NumberBytes, get_input_num_type, get_number_bytes}; use itertools::Itertools; -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; use std::iter; @@ -237,7 +237,8 @@ fn shift_bytes_left(data: &[u8], byte_shift: usize) -> Vec { fn shift_bytes_and_bits_left(data: &[u8], byte_shift: usize, bit_shift: usize) -> Vec { use itertools::Position::*; - debug_assert!((1..8).contains(&bit_shift), + debug_assert!( + (1..8).contains(&bit_shift), "Bit shifts of 0 can't be handled by this impl and everything else should be part of the byteshift" ); data.iter() 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 b99a9618f3..7fde9f94e7 100644 --- a/crates/nu-cmd-extra/src/extra/bits/shift_right.rs +++ b/crates/nu-cmd-extra/src/extra/bits/shift_right.rs @@ -1,5 +1,5 @@ -use super::{get_input_num_type, get_number_bytes, InputNumType, NumberBytes}; -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use super::{InputNumType, NumberBytes, get_input_num_type, get_number_bytes}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; struct Arguments { diff --git a/crates/nu-cmd-extra/src/extra/bits/xor.rs b/crates/nu-cmd-extra/src/extra/bits/xor.rs index d4e1d96abf..d5428e5a86 100644 --- a/crates/nu-cmd-extra/src/extra/bits/xor.rs +++ b/crates/nu-cmd-extra/src/extra/bits/xor.rs @@ -66,7 +66,7 @@ impl Command for BitsXor { return Err(ShellError::TypeMismatch { err_message: "Endian must be one of native, little, big".to_string(), span: endian.span, - }) + }); } } } else { @@ -106,8 +106,7 @@ impl Command for BitsXor { result: Some(Value::test_binary(vec![0x70, 0x40])), }, Example { - description: - "Apply bitwise xor to binary data of varying lengths with specified endianness", + description: "Apply bitwise xor to binary data of varying lengths with specified endianness", example: "0x[ca fe] | bits xor 0x[aa] --endian big", result: Some(Value::test_binary(vec![0xca, 0x54])), }, diff --git a/crates/nu-cmd-extra/src/extra/filters/each_while.rs b/crates/nu-cmd-extra/src/extra/filters/each_while.rs index 58d1eae9e8..95b8df230a 100644 --- a/crates/nu-cmd-extra/src/extra/filters/each_while.rs +++ b/crates/nu-cmd-extra/src/extra/filters/each_while.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEval, ClosureEvalOnce}; +use nu_engine::{ClosureEval, ClosureEvalOnce, command_prelude::*}; use nu_protocol::engine::Closure; #[derive(Clone)] diff --git a/crates/nu-cmd-extra/src/extra/filters/roll/roll_down.rs b/crates/nu-cmd-extra/src/extra/filters/roll/roll_down.rs index a7a1cc6be5..4b0a627648 100644 --- a/crates/nu-cmd-extra/src/extra/filters/roll/roll_down.rs +++ b/crates/nu-cmd-extra/src/extra/filters/roll/roll_down.rs @@ -1,4 +1,4 @@ -use super::{vertical_rotate_value, VerticalDirection}; +use super::{VerticalDirection, vertical_rotate_value}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-cmd-extra/src/extra/filters/roll/roll_left.rs b/crates/nu-cmd-extra/src/extra/filters/roll/roll_left.rs index 8d6616156b..befbd8a9f4 100644 --- a/crates/nu-cmd-extra/src/extra/filters/roll/roll_left.rs +++ b/crates/nu-cmd-extra/src/extra/filters/roll/roll_left.rs @@ -1,4 +1,4 @@ -use super::{horizontal_rotate_value, HorizontalDirection}; +use super::{HorizontalDirection, horizontal_rotate_value}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-cmd-extra/src/extra/filters/roll/roll_right.rs b/crates/nu-cmd-extra/src/extra/filters/roll/roll_right.rs index 7657e73dc7..bc90a45900 100644 --- a/crates/nu-cmd-extra/src/extra/filters/roll/roll_right.rs +++ b/crates/nu-cmd-extra/src/extra/filters/roll/roll_right.rs @@ -1,4 +1,4 @@ -use super::{horizontal_rotate_value, HorizontalDirection}; +use super::{HorizontalDirection, horizontal_rotate_value}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-cmd-extra/src/extra/filters/roll/roll_up.rs b/crates/nu-cmd-extra/src/extra/filters/roll/roll_up.rs index ffdabca8eb..a98f85ede4 100644 --- a/crates/nu-cmd-extra/src/extra/filters/roll/roll_up.rs +++ b/crates/nu-cmd-extra/src/extra/filters/roll/roll_up.rs @@ -1,4 +1,4 @@ -use super::{vertical_rotate_value, VerticalDirection}; +use super::{VerticalDirection, vertical_rotate_value}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-cmd-extra/src/extra/filters/rotate.rs b/crates/nu-cmd-extra/src/extra/filters/rotate.rs index 43c83d42b5..3799e5b7ce 100644 --- a/crates/nu-cmd-extra/src/extra/filters/rotate.rs +++ b/crates/nu-cmd-extra/src/extra/filters/rotate.rs @@ -36,104 +36,93 @@ impl Command for Rotate { description: "Rotate a record clockwise, producing a table (like `transpose` but with column order reversed)", example: "{a:1, b:2} | rotate", result: Some(Value::test_list(vec![ - Value::test_record(record! { - "column0" => Value::test_int(1), - "column1" => Value::test_string("a"), - }), - Value::test_record(record! { - "column0" => Value::test_int(2), - "column1" => Value::test_string("b"), - }), - ], - )), + Value::test_record(record! { + "column0" => Value::test_int(1), + "column1" => Value::test_string("a"), + }), + Value::test_record(record! { + "column0" => Value::test_int(2), + "column1" => Value::test_string("b"), + }), + ])), }, Example { description: "Rotate 2x3 table clockwise", example: "[[a b]; [1 2] [3 4] [5 6]] | rotate", - result: Some(Value::test_list( - vec![ - Value::test_record(record! { - "column0" => Value::test_int(5), - "column1" => Value::test_int(3), - "column2" => Value::test_int(1), - "column3" => Value::test_string("a"), - }), - Value::test_record(record! { - "column0" => Value::test_int(6), - "column1" => Value::test_int(4), - "column2" => Value::test_int(2), - "column3" => Value::test_string("b"), - }), - ], - )), + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "column0" => Value::test_int(5), + "column1" => Value::test_int(3), + "column2" => Value::test_int(1), + "column3" => Value::test_string("a"), + }), + Value::test_record(record! { + "column0" => Value::test_int(6), + "column1" => Value::test_int(4), + "column2" => Value::test_int(2), + "column3" => Value::test_string("b"), + }), + ])), }, Example { description: "Rotate table clockwise and change columns names", example: "[[a b]; [1 2]] | rotate col_a col_b", - result: Some(Value::test_list( - vec![ - Value::test_record(record! { - "col_a" => Value::test_int(1), - "col_b" => Value::test_string("a"), - }), - Value::test_record(record! { - "col_a" => Value::test_int(2), - "col_b" => Value::test_string("b"), - }), - ], - )), + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "col_a" => Value::test_int(1), + "col_b" => Value::test_string("a"), + }), + Value::test_record(record! { + "col_a" => Value::test_int(2), + "col_b" => Value::test_string("b"), + }), + ])), }, Example { description: "Rotate table counter clockwise", example: "[[a b]; [1 2]] | rotate --ccw", - result: Some(Value::test_list( - vec![ - Value::test_record(record! { - "column0" => Value::test_string("b"), - "column1" => Value::test_int(2), - }), - Value::test_record(record! { - "column0" => Value::test_string("a"), - "column1" => Value::test_int(1), - }), - ], - )), + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "column0" => Value::test_string("b"), + "column1" => Value::test_int(2), + }), + Value::test_record(record! { + "column0" => Value::test_string("a"), + "column1" => Value::test_int(1), + }), + ])), }, Example { description: "Rotate table counter-clockwise", example: "[[a b]; [1 2] [3 4] [5 6]] | rotate --ccw", - result: Some(Value::test_list( - vec![ - Value::test_record(record! { - "column0" => Value::test_string("b"), - "column1" => Value::test_int(2), - "column2" => Value::test_int(4), - "column3" => Value::test_int(6), - }), - Value::test_record(record! { - "column0" => Value::test_string("a"), - "column1" => Value::test_int(1), - "column2" => Value::test_int(3), - "column3" => Value::test_int(5), - }), - ], - )), + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "column0" => Value::test_string("b"), + "column1" => Value::test_int(2), + "column2" => Value::test_int(4), + "column3" => Value::test_int(6), + }), + Value::test_record(record! { + "column0" => Value::test_string("a"), + "column1" => Value::test_int(1), + "column2" => Value::test_int(3), + "column3" => Value::test_int(5), + }), + ])), }, Example { description: "Rotate table counter-clockwise and change columns names", example: "[[a b]; [1 2]] | rotate --ccw col_a col_b", - result: Some(Value::test_list( - vec![ - Value::test_record(record! { - "col_a" => Value::test_string("b"), - "col_b" => Value::test_int(2), - }), - Value::test_record(record! { - "col_a" => Value::test_string("a"), - "col_b" => Value::test_int(1), - }), - ], - )), + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "col_a" => Value::test_string("b"), + "col_b" => Value::test_int(2), + }), + Value::test_record(record! { + "col_a" => Value::test_string("a"), + "col_b" => Value::test_int(1), + }), + ])), }, ] } diff --git a/crates/nu-cmd-extra/src/extra/filters/update_cells.rs b/crates/nu-cmd-extra/src/extra/filters/update_cells.rs index a3edf7754a..0b62ac4d6d 100644 --- a/crates/nu-cmd-extra/src/extra/filters/update_cells.rs +++ b/crates/nu-cmd-extra/src/extra/filters/update_cells.rs @@ -1,5 +1,5 @@ -use nu_engine::{command_prelude::*, ClosureEval}; -use nu_protocol::{engine::Closure, PipelineIterator}; +use nu_engine::{ClosureEval, command_prelude::*}; +use nu_protocol::{PipelineIterator, engine::Closure}; use std::collections::HashSet; #[derive(Clone)] diff --git a/crates/nu-cmd-extra/src/extra/formats/to/html.rs b/crates/nu-cmd-extra/src/extra/formats/to/html.rs index 81a5309ae5..ccc9b8fc24 100644 --- a/crates/nu-cmd-extra/src/extra/formats/to/html.rs +++ b/crates/nu-cmd-extra/src/extra/formats/to/html.rs @@ -267,7 +267,7 @@ fn to_html( span: Some(theme_span), help: None, inner: vec![], - }) + }); } }; 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 b3aecef034..2db772a045 100644 --- a/crates/nu-cmd-extra/src/extra/platform/ansi/gradient.rs +++ b/crates/nu-cmd-extra/src/extra/platform/ansi/gradient.rs @@ -1,4 +1,4 @@ -use nu_ansi_term::{build_all_gradient_text, gradient::TargetGround, Gradient, Rgb}; +use nu_ansi_term::{Gradient, Rgb, build_all_gradient_text, gradient::TargetGround}; use nu_engine::command_prelude::*; #[derive(Clone)] @@ -70,29 +70,25 @@ impl Command for SubCommand { fn examples(&self) -> Vec { vec![ Example { - description: "draw text in a gradient with foreground start and end colors", - example: - "'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff' --fgend '0xe81cff'", - result: None, - }, - Example { - description: "draw text in a gradient with foreground start and end colors and background start and end colors", - example: - "'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff' --fgend '0xe81cff' --bgstart '0xe81cff' --bgend '0x40c9ff'", - result: None, - }, - Example { - description: "draw text in a gradient by specifying foreground start color - end color is assumed to be black", - example: - "'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff'", - result: None, - }, - Example { - description: "draw text in a gradient by specifying foreground end color - start color is assumed to be black", - example: - "'Hello, Nushell! This is a gradient.' | ansi gradient --fgend '0xe81cff'", - result: None, - }, + description: "draw text in a gradient with foreground start and end colors", + example: "'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff' --fgend '0xe81cff'", + result: None, + }, + Example { + description: "draw text in a gradient with foreground start and end colors and background start and end colors", + example: "'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff' --fgend '0xe81cff' --bgstart '0xe81cff' --bgend '0x40c9ff'", + result: None, + }, + Example { + description: "draw text in a gradient by specifying foreground start color - end color is assumed to be black", + example: "'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff'", + result: None, + }, + Example { + description: "draw text in a gradient by specifying foreground end color - start color is assumed to be black", + example: "'Hello, Nushell! This is a gradient.' | ansi gradient --fgend '0xe81cff'", + result: None, + }, ] } } @@ -300,7 +296,7 @@ fn action( #[cfg(test)] mod tests { - use super::{action, SubCommand}; + use super::{SubCommand, action}; use nu_ansi_term::Rgb; use nu_protocol::{Span, Value}; @@ -314,7 +310,9 @@ mod tests { #[test] fn test_fg_gradient() { let input_string = Value::test_string("Hello, World!"); - let expected = Value::test_string("\u{1b}[38;2;64;201;255mH\u{1b}[38;2;76;187;254me\u{1b}[38;2;89;174;254ml\u{1b}[38;2;102;160;254ml\u{1b}[38;2;115;147;254mo\u{1b}[38;2;128;133;254m,\u{1b}[38;2;141;120;254m \u{1b}[38;2;153;107;254mW\u{1b}[38;2;166;94;254mo\u{1b}[38;2;179;80;254mr\u{1b}[38;2;192;67;254ml\u{1b}[38;2;205;53;254md\u{1b}[38;2;218;40;254m!\u{1b}[0m"); + let expected = Value::test_string( + "\u{1b}[38;2;64;201;255mH\u{1b}[38;2;76;187;254me\u{1b}[38;2;89;174;254ml\u{1b}[38;2;102;160;254ml\u{1b}[38;2;115;147;254mo\u{1b}[38;2;128;133;254m,\u{1b}[38;2;141;120;254m \u{1b}[38;2;153;107;254mW\u{1b}[38;2;166;94;254mo\u{1b}[38;2;179;80;254mr\u{1b}[38;2;192;67;254ml\u{1b}[38;2;205;53;254md\u{1b}[38;2;218;40;254m!\u{1b}[0m", + ); let fg_start = Rgb::from_hex_string("0x40c9ff".to_string()); let fg_end = Rgb::from_hex_string("0xe81cff".to_string()); let actual = action( diff --git a/crates/nu-cmd-extra/src/extra/strings/format/bits.rs b/crates/nu-cmd-extra/src/extra/strings/format/bits.rs index 04390197cb..d4ec473879 100644 --- a/crates/nu-cmd-extra/src/extra/strings/format/bits.rs +++ b/crates/nu-cmd-extra/src/extra/strings/format/bits.rs @@ -1,9 +1,9 @@ use std::io::{self, Read, Write}; -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; -use nu_protocol::{shell_error::io::IoError, Signals}; +use nu_protocol::{Signals, shell_error::io::IoError}; use num_traits::ToPrimitive; struct Arguments { @@ -68,42 +68,33 @@ impl Command for FormatBits { Example { description: "convert a binary value into a string, padded to 8 places with 0s", example: "0x[1] | format bits", - result: Some(Value::string("00000001", - Span::test_data(), - )), + result: Some(Value::string("00000001", Span::test_data())), }, Example { description: "convert an int into a string, padded to 8 places with 0s", example: "1 | format bits", - result: Some(Value::string("00000001", - Span::test_data(), - )), + result: Some(Value::string("00000001", Span::test_data())), }, Example { description: "convert a filesize value into a string, padded to 8 places with 0s", example: "1b | format bits", - result: Some(Value::string("00000001", - Span::test_data(), - )), + result: Some(Value::string("00000001", Span::test_data())), }, Example { description: "convert a duration value into a string, padded to 8 places with 0s", example: "1ns | format bits", - result: Some(Value::string("00000001", - Span::test_data(), - )), + result: Some(Value::string("00000001", Span::test_data())), }, Example { description: "convert a boolean value into a string, padded to 8 places with 0s", example: "true | format bits", - result: Some(Value::string("00000001", - Span::test_data(), - )), + result: Some(Value::string("00000001", Span::test_data())), }, Example { description: "convert a string into a raw binary string, padded with 0s to 8 places", example: "'nushell.sh' | format bits", - result: Some(Value::string("01101110 01110101 01110011 01101000 01100101 01101100 01101100 00101110 01110011 01101000", + result: Some(Value::string( + "01101110 01110101 01110011 01101000 01100101 01101100 01101100 00101110 01110011 01101000", Span::test_data(), )), }, diff --git a/crates/nu-cmd-extra/src/extra/strings/format/command.rs b/crates/nu-cmd-extra/src/extra/strings/format/command.rs index e648c66298..9eb2324630 100644 --- a/crates/nu-cmd-extra/src/extra/strings/format/command.rs +++ b/crates/nu-cmd-extra/src/extra/strings/format/command.rs @@ -1,5 +1,5 @@ use nu_engine::command_prelude::*; -use nu_protocol::{ast::PathMember, engine::StateWorkingSet, Config, ListStream}; +use nu_protocol::{Config, ListStream, ast::PathMember, engine::StateWorkingSet}; #[derive(Clone)] pub struct FormatPattern; @@ -214,7 +214,7 @@ fn format( wrong_type: val.get_type().to_string(), dst_span: head_span, src_span: val.span(), - }) + }); } } } diff --git a/crates/nu-cmd-extra/src/extra/strings/format/number.rs b/crates/nu-cmd-extra/src/extra/strings/format/number.rs index 9c77a6006f..ad8a6b08fb 100644 --- a/crates/nu-cmd-extra/src/extra/strings/format/number.rs +++ b/crates/nu-cmd-extra/src/extra/strings/format/number.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CellPathOnlyArgs}; +use nu_cmd_base::input_handler::{CellPathOnlyArgs, operate}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-cmd-extra/src/extra/strings/str_/case/mod.rs b/crates/nu-cmd-extra/src/extra/strings/str_/case/mod.rs index 93a681e95f..d782856e4d 100644 --- a/crates/nu-cmd-extra/src/extra/strings/str_/case/mod.rs +++ b/crates/nu-cmd-extra/src/extra/strings/str_/case/mod.rs @@ -14,7 +14,7 @@ pub use snake_case::StrSnakeCase; pub use str_::Str; pub use title_case::StrTitleCase; -use nu_cmd_base::input_handler::{operate as general_operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate as general_operate}; use nu_engine::command_prelude::*; struct Arguments String + Send + Sync + 'static> { diff --git a/crates/nu-cmd-lang/Cargo.toml b/crates/nu-cmd-lang/Cargo.toml index ac9ce2a93a..46ad683b69 100644 --- a/crates/nu-cmd-lang/Cargo.toml +++ b/crates/nu-cmd-lang/Cargo.toml @@ -3,7 +3,7 @@ authors = ["The Nushell Project Developers"] build = "build.rs" description = "Nushell's core language commands" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-lang" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-cmd-lang" version = "0.104.1" diff --git a/crates/nu-cmd-lang/src/core_commands/break_.rs b/crates/nu-cmd-lang/src/core_commands/break_.rs index e3aa31c829..7fdf5a7bc9 100644 --- a/crates/nu-cmd-lang/src/core_commands/break_.rs +++ b/crates/nu-cmd-lang/src/core_commands/break_.rs @@ -39,7 +39,9 @@ impl Command for Break { ) -> Result { // This is compiled specially by the IR compiler. The code here is never used when // running in IR mode. - eprintln!("Tried to execute 'run' for the 'break' command: this code path should never be reached in IR mode"); + eprintln!( + "Tried to execute 'run' for the 'break' command: this code path should never be reached in IR mode" + ); unreachable!() } diff --git a/crates/nu-cmd-lang/src/core_commands/collect.rs b/crates/nu-cmd-lang/src/core_commands/collect.rs index 709904de84..654f165c35 100644 --- a/crates/nu-cmd-lang/src/core_commands/collect.rs +++ b/crates/nu-cmd-lang/src/core_commands/collect.rs @@ -1,5 +1,5 @@ use nu_engine::{command_prelude::*, get_eval_block, redirect_env}; -use nu_protocol::{engine::Closure, DataSource, PipelineMetadata}; +use nu_protocol::{DataSource, PipelineMetadata, engine::Closure}; #[derive(Clone)] pub struct Collect; diff --git a/crates/nu-cmd-lang/src/core_commands/const_.rs b/crates/nu-cmd-lang/src/core_commands/const_.rs index 9517a53dd2..cfb5b66e50 100644 --- a/crates/nu-cmd-lang/src/core_commands/const_.rs +++ b/crates/nu-cmd-lang/src/core_commands/const_.rs @@ -48,7 +48,9 @@ impl Command for Const { ) -> Result { // This is compiled specially by the IR compiler. The code here is never used when // running in IR mode. - eprintln!("Tried to execute 'run' for the 'const' command: this code path should never be reached in IR mode"); + eprintln!( + "Tried to execute 'run' for the 'const' command: this code path should never be reached in IR mode" + ); unreachable!() } diff --git a/crates/nu-cmd-lang/src/core_commands/continue_.rs b/crates/nu-cmd-lang/src/core_commands/continue_.rs index e52095cb2b..bb9c3e4c08 100644 --- a/crates/nu-cmd-lang/src/core_commands/continue_.rs +++ b/crates/nu-cmd-lang/src/core_commands/continue_.rs @@ -38,7 +38,9 @@ impl Command for Continue { ) -> Result { // This is compiled specially by the IR compiler. The code here is never used when // running in IR mode. - eprintln!("Tried to execute 'run' for the 'continue' command: this code path should never be reached in IR mode"); + eprintln!( + "Tried to execute 'run' for the 'continue' command: this code path should never be reached in IR mode" + ); unreachable!() } diff --git a/crates/nu-cmd-lang/src/core_commands/describe.rs b/crates/nu-cmd-lang/src/core_commands/describe.rs index 6fa11d8061..d473b2b8df 100644 --- a/crates/nu-cmd-lang/src/core_commands/describe.rs +++ b/crates/nu-cmd-lang/src/core_commands/describe.rs @@ -1,7 +1,7 @@ use nu_engine::command_prelude::*; use nu_protocol::{ - engine::{Closure, StateWorkingSet}, BlockId, ByteStreamSource, Category, PipelineMetadata, Signature, + engine::{Closure, StateWorkingSet}, }; use std::any::type_name; #[derive(Clone)] @@ -72,8 +72,7 @@ impl Command for Describe { }, Example { description: "Describe the type of a record in a detailed way", - example: - "{shell:'true', uwu:true, features: {bugs:false, multiplatform:true, speed: 10}, fib: [1 1 2 3 5 8], on_save: {|x| $'Saving ($x)'}, first_commit: 2019-05-10, my_duration: (4min + 20sec)} | describe -d", + example: "{shell:'true', uwu:true, features: {bugs:false, multiplatform:true, speed: 10}, fib: [1 1 2 3 5 8], on_save: {|x| $'Saving ($x)'}, first_commit: 2019-05-10, my_duration: (4min + 20sec)} | describe -d", result: Some(Value::test_record(record!( "type" => Value::test_string("record"), "detailed_type" => Value::test_string("record, fib: list, on_save: closure, first_commit: datetime, my_duration: duration>"), @@ -191,32 +190,32 @@ impl Command for Describe { Example { description: "Describe the type of a stream with detailed information", example: "[1 2 3] | each {|i| echo $i} | describe -d", - result: None // Give "Running external commands not supported" error - // result: Some(Value::test_record(record!( - // "type" => Value::test_string("stream"), - // "origin" => Value::test_string("nushell"), - // "subtype" => Value::test_record(record!( - // "type" => Value::test_string("list"), - // "length" => Value::test_int(3), - // "values" => Value::test_list(vec![ - // Value::test_string("int"), - // Value::test_string("int"), - // Value::test_string("int"), - // ]) - // )) - // ))), + result: None, // Give "Running external commands not supported" error + // result: Some(Value::test_record(record!( + // "type" => Value::test_string("stream"), + // "origin" => Value::test_string("nushell"), + // "subtype" => Value::test_record(record!( + // "type" => Value::test_string("list"), + // "length" => Value::test_int(3), + // "values" => Value::test_list(vec![ + // Value::test_string("int"), + // Value::test_string("int"), + // Value::test_string("int"), + // ]) + // )) + // ))), }, Example { description: "Describe a stream of data, collecting it first", example: "[1 2 3] | each {|i| echo $i} | describe", - result: None // Give "Running external commands not supported" error - // result: Some(Value::test_string("list (stream)")), + result: None, // Give "Running external commands not supported" error + // result: Some(Value::test_string("list (stream)")), }, Example { description: "Describe the input but do not collect streams", example: "[1 2 3] | each {|i| echo $i} | describe --no-collect", - result: None // Give "Running external commands not supported" error - // result: Some(Value::test_string("stream")), + result: None, // Give "Running external commands not supported" error + // result: Some(Value::test_string("stream")), }, ] } diff --git a/crates/nu-cmd-lang/src/core_commands/do_.rs b/crates/nu-cmd-lang/src/core_commands/do_.rs index db0617db3b..6b43f0a3fb 100644 --- a/crates/nu-cmd-lang/src/core_commands/do_.rs +++ b/crates/nu-cmd-lang/src/core_commands/do_.rs @@ -2,7 +2,7 @@ use nu_engine::{command_prelude::*, get_eval_block_with_early_return, redirect_e #[cfg(feature = "os")] use nu_protocol::process::{ChildPipe, ChildProcess}; use nu_protocol::{ - engine::Closure, shell_error::io::IoError, ByteStream, ByteStreamSource, OutDest, + ByteStream, ByteStreamSource, OutDest, engine::Closure, shell_error::io::IoError, }; use std::{ diff --git a/crates/nu-cmd-lang/src/core_commands/echo.rs b/crates/nu-cmd-lang/src/core_commands/echo.rs index 6ee46153e5..e260c6450c 100644 --- a/crates/nu-cmd-lang/src/core_commands/echo.rs +++ b/crates/nu-cmd-lang/src/core_commands/echo.rs @@ -63,8 +63,7 @@ little reason to use this over just writing the values as-is."# )), }, Example { - description: - "Returns the piped-in value, by using the special $in variable to obtain it.", + description: "Returns the piped-in value, by using the special $in variable to obtain it.", example: "echo $in", result: None, }, diff --git a/crates/nu-cmd-lang/src/core_commands/error_make.rs b/crates/nu-cmd-lang/src/core_commands/error_make.rs index 97bead75ff..a43d36feab 100644 --- a/crates/nu-cmd-lang/src/core_commands/error_make.rs +++ b/crates/nu-cmd-lang/src/core_commands/error_make.rs @@ -76,8 +76,7 @@ impl Command for ErrorMake { result: None, }, Example { - description: - "Create a custom error for a custom command that shows the span of the argument", + description: "Create a custom error for a custom command that shows the span of the argument", example: r#"def foo [x] { error make { msg: "this is fishy" @@ -106,7 +105,7 @@ fn make_other_error(value: &Value, throw_span: Option) -> ShellError { span: throw_span, help: None, inner: vec![], - } + }; } }; @@ -119,7 +118,7 @@ fn make_other_error(value: &Value, throw_span: Option) -> ShellError { span: Some(span), help: None, inner: vec![], - } + }; } None => { return ShellError::GenericError { @@ -128,7 +127,7 @@ fn make_other_error(value: &Value, throw_span: Option) -> ShellError { span: Some(span), help: None, inner: vec![], - } + }; } }; @@ -146,7 +145,7 @@ fn make_other_error(value: &Value, throw_span: Option) -> ShellError { span: Some(span), help: None, inner: vec![], - } + }; } // correct return: no label None => { @@ -156,7 +155,7 @@ fn make_other_error(value: &Value, throw_span: Option) -> ShellError { span: throw_span, help, inner: vec![], - } + }; } }; @@ -180,7 +179,7 @@ fn make_other_error(value: &Value, throw_span: Option) -> ShellError { span: Some(label_span), help: None, inner: vec![], - } + }; } None => { return ShellError::GenericError { @@ -189,7 +188,7 @@ fn make_other_error(value: &Value, throw_span: Option) -> ShellError { span: Some(label_span), help: None, inner: vec![], - } + }; } }; @@ -202,7 +201,7 @@ fn make_other_error(value: &Value, throw_span: Option) -> ShellError { span: Some(value.span()), help: None, inner: vec![], - } + }; } // correct return: label, no span None => { @@ -212,7 +211,7 @@ fn make_other_error(value: &Value, throw_span: Option) -> ShellError { span: throw_span, help, inner: vec![], - } + }; } }; diff --git a/crates/nu-cmd-lang/src/core_commands/for_.rs b/crates/nu-cmd-lang/src/core_commands/for_.rs index c0f45f0185..1798650922 100644 --- a/crates/nu-cmd-lang/src/core_commands/for_.rs +++ b/crates/nu-cmd-lang/src/core_commands/for_.rs @@ -50,7 +50,9 @@ impl Command for For { ) -> Result { // This is compiled specially by the IR compiler. The code here is never used when // running in IR mode. - eprintln!("Tried to execute 'run' for the 'for' command: this code path should never be reached in IR mode"); + eprintln!( + "Tried to execute 'run' for the 'for' command: this code path should never be reached in IR mode" + ); unreachable!() } diff --git a/crates/nu-cmd-lang/src/core_commands/if_.rs b/crates/nu-cmd-lang/src/core_commands/if_.rs index 0b7463d4f1..7c54ca432f 100644 --- a/crates/nu-cmd-lang/src/core_commands/if_.rs +++ b/crates/nu-cmd-lang/src/core_commands/if_.rs @@ -100,7 +100,9 @@ impl Command for If { ) -> Result { // This is compiled specially by the IR compiler. The code here is never used when // running in IR mode. - eprintln!("Tried to execute 'run' for the 'if' command: this code path should never be reached in IR mode"); + eprintln!( + "Tried to execute 'run' for the 'if' command: this code path should never be reached in IR mode" + ); unreachable!() } diff --git a/crates/nu-cmd-lang/src/core_commands/ignore.rs b/crates/nu-cmd-lang/src/core_commands/ignore.rs index b28a9582a3..e4810e0c13 100644 --- a/crates/nu-cmd-lang/src/core_commands/ignore.rs +++ b/crates/nu-cmd-lang/src/core_commands/ignore.rs @@ -1,5 +1,5 @@ use nu_engine::command_prelude::*; -use nu_protocol::{engine::StateWorkingSet, ByteStreamSource, OutDest}; +use nu_protocol::{ByteStreamSource, OutDest, engine::StateWorkingSet}; #[derive(Clone)] pub struct Ignore; diff --git a/crates/nu-cmd-lang/src/core_commands/let_.rs b/crates/nu-cmd-lang/src/core_commands/let_.rs index 47448dfdef..d34badfbf3 100644 --- a/crates/nu-cmd-lang/src/core_commands/let_.rs +++ b/crates/nu-cmd-lang/src/core_commands/let_.rs @@ -48,7 +48,9 @@ impl Command for Let { ) -> Result { // This is compiled specially by the IR compiler. The code here is never used when // running in IR mode. - eprintln!("Tried to execute 'run' for the 'let' command: this code path should never be reached in IR mode"); + eprintln!( + "Tried to execute 'run' for the 'let' command: this code path should never be reached in IR mode" + ); unreachable!() } diff --git a/crates/nu-cmd-lang/src/core_commands/loop_.rs b/crates/nu-cmd-lang/src/core_commands/loop_.rs index a07b316476..502fbdb466 100644 --- a/crates/nu-cmd-lang/src/core_commands/loop_.rs +++ b/crates/nu-cmd-lang/src/core_commands/loop_.rs @@ -39,7 +39,9 @@ impl Command for Loop { ) -> Result { // This is compiled specially by the IR compiler. The code here is never used when // running in IR mode. - eprintln!("Tried to execute 'run' for the 'loop' command: this code path should never be reached in IR mode"); + eprintln!( + "Tried to execute 'run' for the 'loop' command: this code path should never be reached in IR mode" + ); unreachable!() } diff --git a/crates/nu-cmd-lang/src/core_commands/match_.rs b/crates/nu-cmd-lang/src/core_commands/match_.rs index bda42ac575..677dcb07d9 100644 --- a/crates/nu-cmd-lang/src/core_commands/match_.rs +++ b/crates/nu-cmd-lang/src/core_commands/match_.rs @@ -43,7 +43,9 @@ impl Command for Match { ) -> Result { // This is compiled specially by the IR compiler. The code here is never used when // running in IR mode. - eprintln!("Tried to execute 'run' for the 'match' command: this code path should never be reached in IR mode"); + eprintln!( + "Tried to execute 'run' for the 'match' command: this code path should never be reached in IR mode" + ); unreachable!() } @@ -56,8 +58,7 @@ impl Command for Match { }, Example { description: "Match against alternative values", - example: - "match 'three' { 1 | 'one' => '-', 2 | 'two' => '--', 3 | 'three' => '---' }", + example: "match 'three' { 1 | 'one' => '-', 2 | 'two' => '--', 3 | 'three' => '---' }", result: Some(Value::test_string("---")), }, Example { diff --git a/crates/nu-cmd-lang/src/core_commands/mut_.rs b/crates/nu-cmd-lang/src/core_commands/mut_.rs index 04e554e226..85cff33745 100644 --- a/crates/nu-cmd-lang/src/core_commands/mut_.rs +++ b/crates/nu-cmd-lang/src/core_commands/mut_.rs @@ -48,7 +48,9 @@ impl Command for Mut { ) -> Result { // This is compiled specially by the IR compiler. The code here is never used when // running in IR mode. - eprintln!("Tried to execute 'run' for the 'mut' command: this code path should never be reached in IR mode"); + eprintln!( + "Tried to execute 'run' for the 'mut' command: this code path should never be reached in IR mode" + ); unreachable!() } diff --git a/crates/nu-cmd-lang/src/core_commands/overlay/hide.rs b/crates/nu-cmd-lang/src/core_commands/overlay/hide.rs index 0228eb10db..02c0de0ec7 100644 --- a/crates/nu-cmd-lang/src/core_commands/overlay/hide.rs +++ b/crates/nu-cmd-lang/src/core_commands/overlay/hide.rs @@ -76,7 +76,7 @@ impl Command for OverlayHide { return Err(ShellError::EnvVarNotFoundAtRuntime { envvar_name: name.item, span: name.span, - }) + }); } } } diff --git a/crates/nu-cmd-lang/src/core_commands/overlay/use_.rs b/crates/nu-cmd-lang/src/core_commands/overlay/use_.rs index 2fe77d548e..bf29087a61 100644 --- a/crates/nu-cmd-lang/src/core_commands/overlay/use_.rs +++ b/crates/nu-cmd-lang/src/core_commands/overlay/use_.rs @@ -2,7 +2,7 @@ use nu_engine::{ command_prelude::*, find_in_dirs_env, get_dirs_var_from_call, get_eval_block, redirect_env, }; use nu_parser::trim_quotes_str; -use nu_protocol::{ast::Expr, engine::CommandType, ModuleId}; +use nu_protocol::{ModuleId, ast::Expr, engine::CommandType}; use std::path::Path; diff --git a/crates/nu-cmd-lang/src/core_commands/return_.rs b/crates/nu-cmd-lang/src/core_commands/return_.rs index b3571ee8a8..72a46d19fb 100644 --- a/crates/nu-cmd-lang/src/core_commands/return_.rs +++ b/crates/nu-cmd-lang/src/core_commands/return_.rs @@ -42,7 +42,9 @@ impl Command for Return { ) -> Result { // This is compiled specially by the IR compiler. The code here is never used when // running in IR mode. - eprintln!("Tried to execute 'run' for the 'return' command: this code path should never be reached in IR mode"); + eprintln!( + "Tried to execute 'run' for the 'return' command: this code path should never be reached in IR mode" + ); unreachable!() } diff --git a/crates/nu-cmd-lang/src/core_commands/try_.rs b/crates/nu-cmd-lang/src/core_commands/try_.rs index 4b35a54974..e0570cbf0c 100644 --- a/crates/nu-cmd-lang/src/core_commands/try_.rs +++ b/crates/nu-cmd-lang/src/core_commands/try_.rs @@ -49,7 +49,9 @@ impl Command for Try { ) -> Result { // This is compiled specially by the IR compiler. The code here is never used when // running in IR mode. - eprintln!("Tried to execute 'run' for the 'try' command: this code path should never be reached in IR mode"); + eprintln!( + "Tried to execute 'run' for the 'try' command: this code path should never be reached in IR mode" + ); unreachable!(); } diff --git a/crates/nu-cmd-lang/src/core_commands/while_.rs b/crates/nu-cmd-lang/src/core_commands/while_.rs index ac5d13a881..b64a0ec760 100644 --- a/crates/nu-cmd-lang/src/core_commands/while_.rs +++ b/crates/nu-cmd-lang/src/core_commands/while_.rs @@ -48,7 +48,9 @@ impl Command for While { ) -> Result { // This is compiled specially by the IR compiler. The code here is never used when // running in IR mode. - eprintln!("Tried to execute 'run' for the 'while' command: this code path should never be reached in IR mode"); + eprintln!( + "Tried to execute 'run' for the 'while' command: this code path should never be reached in IR mode" + ); unreachable!() } diff --git a/crates/nu-cmd-lang/src/example_support.rs b/crates/nu-cmd-lang/src/example_support.rs index b3a64dc168..d78e606a46 100644 --- a/crates/nu-cmd-lang/src/example_support.rs +++ b/crates/nu-cmd-lang/src/example_support.rs @@ -1,7 +1,7 @@ use itertools::Itertools; use nu_engine::{command_prelude::*, compile}; use nu_protocol::{ - ast::Block, debugger::WithoutDebug, engine::StateWorkingSet, report_shell_error, Range, + Range, ast::Block, debugger::WithoutDebug, engine::StateWorkingSet, report_shell_error, }; use std::{ sync::Arc, @@ -163,13 +163,9 @@ pub fn check_example_evaluates_to_expected_output( let expected = DebuggableValue(expected); let result = DebuggableValue(&result); assert_eq!( - result, - expected, + result, expected, "Error: The result of example '{}' for the command '{}' differs from the expected value.\n\nExpected: {:?}\nActual: {:?}\n", - example.description, - cmd_name, - expected, - result, + example.description, cmd_name, expected, result, ); } } diff --git a/crates/nu-cmd-lang/src/example_test.rs b/crates/nu-cmd-lang/src/example_test.rs index e66c8bf5f2..d334d6311d 100644 --- a/crates/nu-cmd-lang/src/example_test.rs +++ b/crates/nu-cmd-lang/src/example_test.rs @@ -17,8 +17,8 @@ mod test_examples { Break, Collect, Def, Describe, Echo, ExportCommand, ExportDef, If, Let, Module, Mut, Use, }; use nu_protocol::{ - engine::{Command, EngineState, StateWorkingSet}, Type, Value, + engine::{Command, EngineState, StateWorkingSet}, }; use std::collections::HashSet; diff --git a/crates/nu-cmd-lang/src/parse_const_test.rs b/crates/nu-cmd-lang/src/parse_const_test.rs index 7870b37648..e0b90a99cb 100644 --- a/crates/nu-cmd-lang/src/parse_const_test.rs +++ b/crates/nu-cmd-lang/src/parse_const_test.rs @@ -1,4 +1,4 @@ -use nu_protocol::{engine::StateWorkingSet, Span}; +use nu_protocol::{Span, engine::StateWorkingSet}; use quickcheck_macros::quickcheck; #[quickcheck] diff --git a/crates/nu-cmd-plugin/Cargo.toml b/crates/nu-cmd-plugin/Cargo.toml index d091b0332e..9bd76a4e8b 100644 --- a/crates/nu-cmd-plugin/Cargo.toml +++ b/crates/nu-cmd-plugin/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["The Nushell Project Developers"] description = "Commands for managing Nushell plugins." -edition = "2021" +edition = "2024" license = "MIT" name = "nu-cmd-plugin" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-plugin" @@ -20,4 +20,4 @@ nu-plugin-engine = { path = "../nu-plugin-engine", version = "0.104.1" } itertools = { workspace = true } -[dev-dependencies] \ No newline at end of file +[dev-dependencies] diff --git a/crates/nu-cmd-plugin/src/commands/plugin/add.rs b/crates/nu-cmd-plugin/src/commands/plugin/add.rs index 33e00c8eee..355112f673 100644 --- a/crates/nu-cmd-plugin/src/commands/plugin/add.rs +++ b/crates/nu-cmd-plugin/src/commands/plugin/add.rs @@ -2,7 +2,7 @@ use crate::util::{get_plugin_dirs, modify_plugin_file}; use nu_engine::command_prelude::*; use nu_plugin_engine::{GetPlugin, PersistentPlugin}; use nu_protocol::{ - shell_error::io::IoError, PluginGcConfig, PluginIdentity, PluginRegistryItem, RegisteredPlugin, + PluginGcConfig, PluginIdentity, PluginRegistryItem, RegisteredPlugin, shell_error::io::IoError, }; use std::{path::PathBuf, sync::Arc}; diff --git a/crates/nu-cmd-plugin/src/commands/plugin/use_.rs b/crates/nu-cmd-plugin/src/commands/plugin/use_.rs index 0d66afce9a..64fec14f34 100644 --- a/crates/nu-cmd-plugin/src/commands/plugin/use_.rs +++ b/crates/nu-cmd-plugin/src/commands/plugin/use_.rs @@ -80,8 +80,7 @@ it was already previously registered with `plugin add`. result: None, }, Example { - description: - "Load the commands for the `query` plugin from a custom plugin registry file", + description: "Load the commands for the `query` plugin from a custom plugin registry file", example: r#"plugin use --plugin-config local-plugins.msgpackz query"#, result: None, }, diff --git a/crates/nu-cmd-plugin/src/util.rs b/crates/nu-cmd-plugin/src/util.rs index 053900ef19..e1e39c7a17 100644 --- a/crates/nu-cmd-plugin/src/util.rs +++ b/crates/nu-cmd-plugin/src/util.rs @@ -1,6 +1,6 @@ #[allow(deprecated)] use nu_engine::{command_prelude::*, current_dir}; -use nu_protocol::{engine::StateWorkingSet, shell_error::io::IoError, PluginRegistryFile}; +use nu_protocol::{PluginRegistryFile, engine::StateWorkingSet, shell_error::io::IoError}; use std::{ fs::{self, File}, path::PathBuf, @@ -15,7 +15,7 @@ fn get_plugin_registry_file_path( #[allow(deprecated)] let cwd = current_dir(engine_state, stack)?; - if let Some(ref custom_path) = custom_path { + if let Some(custom_path) = custom_path { Ok(nu_path::expand_path_with(&custom_path.item, cwd, true)) } else { engine_state diff --git a/crates/nu-color-config/Cargo.toml b/crates/nu-color-config/Cargo.toml index e1b6fef488..46f16f48cc 100644 --- a/crates/nu-color-config/Cargo.toml +++ b/crates/nu-color-config/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Color configuration code used by Nushell" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-color-config" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-color-config" version = "0.104.1" @@ -22,4 +22,4 @@ nu-ansi-term = { workspace = true } serde = { workspace = true, features = ["derive"] } [dev-dependencies] -nu-test-support = { path = "../nu-test-support", version = "0.104.1" } \ No newline at end of file +nu-test-support = { path = "../nu-test-support", version = "0.104.1" } diff --git a/crates/nu-color-config/src/color_config.rs b/crates/nu-color-config/src/color_config.rs index ad5040893a..11db4c89fa 100644 --- a/crates/nu-color-config/src/color_config.rs +++ b/crates/nu-color-config/src/color_config.rs @@ -1,6 +1,7 @@ use crate::{ + NuStyle, nu_style::{color_from_hex, lookup_style}, - parse_nustyle, NuStyle, + parse_nustyle, }; use nu_ansi_term::Style; use nu_protocol::{Record, Value}; @@ -67,11 +68,7 @@ fn get_style_from_value(record: &Record) -> Option { } } - if was_set { - Some(style) - } else { - None - } + if was_set { Some(style) } else { None } } fn color_string_to_nustyle(color_string: &str) -> Style { @@ -92,7 +89,7 @@ fn color_string_to_nustyle(color_string: &str) -> Style { mod tests { use super::*; use nu_ansi_term::{Color, Style}; - use nu_protocol::{record, Span, Value}; + use nu_protocol::{Span, Value, record}; #[test] fn test_color_string_to_nustyle_empty_string() { diff --git a/crates/nu-color-config/src/nu_style.rs b/crates/nu-color-config/src/nu_style.rs index 18f1538762..578534a76d 100644 --- a/crates/nu-color-config/src/nu_style.rs +++ b/crates/nu-color-config/src/nu_style.rs @@ -47,11 +47,7 @@ fn style_get_attr(s: Style) -> Option { attrs.push('u'); }; - if attrs.is_empty() { - None - } else { - Some(attrs) - } + if attrs.is_empty() { None } else { Some(attrs) } } fn color_to_string(color: Color) -> Option { diff --git a/crates/nu-color-config/src/style_computer.rs b/crates/nu-color-config/src/style_computer.rs index af467f31db..765ed99b3c 100644 --- a/crates/nu-color-config/src/style_computer.rs +++ b/crates/nu-color-config/src/style_computer.rs @@ -1,9 +1,10 @@ -use crate::{color_record_to_nustyle, lookup_ansi_color_style, text_style::Alignment, TextStyle}; +use crate::{TextStyle, color_record_to_nustyle, lookup_ansi_color_style, text_style::Alignment}; use nu_ansi_term::{Color, Style}; use nu_engine::ClosureEvalOnce; use nu_protocol::{ + Span, Value, engine::{Closure, EngineState, Stack}, - report_shell_error, Span, Value, + report_shell_error, }; use std::{ collections::HashMap, @@ -240,9 +241,11 @@ fn test_computable_style_closure_errors() { ]; let actual_repl = nu!(nu_repl_code(&inp)); // Check that the error was printed - assert!(actual_repl - .err - .contains("nu::shell::operator_incompatible_types")); + assert!( + actual_repl + .err + .contains("nu::shell::operator_incompatible_types") + ); // Check that the value was printed assert!(actual_repl.out.contains("bell")); } diff --git a/crates/nu-command/Cargo.toml b/crates/nu-command/Cargo.toml index 28858e2a85..721dea2560 100644 --- a/crates/nu-command/Cargo.toml +++ b/crates/nu-command/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["The Nushell Project Developers"] description = "Nushell's built-in commands" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-command" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-command" diff --git a/crates/nu-command/src/bytes/add.rs b/crates/nu-command/src/bytes/add.rs index 909a76bcd3..b0b9ed45a2 100644 --- a/crates/nu-command/src/bytes/add.rs +++ b/crates/nu-command/src/bytes/add.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; struct Arguments { @@ -86,28 +86,32 @@ impl Command for BytesAdd { Example { description: "Add bytes `0x[AA]` to `0x[1F FF AA AA]`", example: "0x[1F FF AA AA] | bytes add 0x[AA]", - result: Some(Value::binary(vec![0xAA, 0x1F, 0xFF, 0xAA, 0xAA], + result: Some(Value::binary( + vec![0xAA, 0x1F, 0xFF, 0xAA, 0xAA], Span::test_data(), )), }, Example { description: "Add bytes `0x[AA BB]` to `0x[1F FF AA AA]` at index 1", example: "0x[1F FF AA AA] | bytes add 0x[AA BB] --index 1", - result: Some(Value::binary(vec![0x1F, 0xAA, 0xBB, 0xFF, 0xAA, 0xAA], + result: Some(Value::binary( + vec![0x1F, 0xAA, 0xBB, 0xFF, 0xAA, 0xAA], Span::test_data(), )), }, Example { description: "Add bytes `0x[11]` to `0x[FF AA AA]` at the end", example: "0x[FF AA AA] | bytes add 0x[11] --end", - result: Some(Value::binary(vec![0xFF, 0xAA, 0xAA, 0x11], + result: Some(Value::binary( + vec![0xFF, 0xAA, 0xAA, 0x11], Span::test_data(), )), }, Example { description: "Add bytes `0x[11 22 33]` to `0x[FF AA AA]` at the end, at index 1(the index is start from end)", example: "0x[FF AA BB] | bytes add 0x[11 22 33] --end --index 1", - result: Some(Value::binary(vec![0xFF, 0xAA, 0x11, 0x22, 0x33, 0xBB], + result: Some(Value::binary( + vec![0xFF, 0xAA, 0x11, 0x22, 0x33, 0xBB], Span::test_data(), )), }, diff --git a/crates/nu-command/src/bytes/at.rs b/crates/nu-command/src/bytes/at.rs index b89be18d1e..06d07db0d6 100644 --- a/crates/nu-command/src/bytes/at.rs +++ b/crates/nu-command/src/bytes/at.rs @@ -1,6 +1,6 @@ use std::ops::Bound; -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; use nu_protocol::{IntRange, Range}; @@ -67,7 +67,7 @@ impl Command for BytesAt { input: "value originates from here".into(), msg_span: call.head, input_span: call.head, - }) + }); } }; @@ -148,8 +148,8 @@ fn map_value(input: &Value, args: &Arguments, head: Span) -> Value { return Value::error( ShellError::UnsupportedInput { msg: format!( - "Absolute start position {start} was too large for your system arch." - ), + "Absolute start position {start} was too large for your system arch." + ), input: args.range.to_string(), msg_span: span, input_span: span, diff --git a/crates/nu-command/src/bytes/build_.rs b/crates/nu-command/src/bytes/build_.rs index de68632ac8..e78c3bb125 100644 --- a/crates/nu-command/src/bytes/build_.rs +++ b/crates/nu-command/src/bytes/build_.rs @@ -67,7 +67,7 @@ impl Command for BytesBuild { return Err(ShellError::TypeMismatch { err_message: "only binary data arguments are supported".to_string(), span: other.span(), - }) + }); } } } diff --git a/crates/nu-command/src/bytes/ends_with.rs b/crates/nu-command/src/bytes/ends_with.rs index 23167a7901..af4c4bffc4 100644 --- a/crates/nu-command/src/bytes/ends_with.rs +++ b/crates/nu-command/src/bytes/ends_with.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; use nu_protocol::shell_error::io::IoError; use std::{ diff --git a/crates/nu-command/src/bytes/index_of.rs b/crates/nu-command/src/bytes/index_of.rs index b6e1f4615d..6a357a5975 100644 --- a/crates/nu-command/src/bytes/index_of.rs +++ b/crates/nu-command/src/bytes/index_of.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; struct Arguments { diff --git a/crates/nu-command/src/bytes/length.rs b/crates/nu-command/src/bytes/length.rs index 34a606b784..61560b5d98 100644 --- a/crates/nu-command/src/bytes/length.rs +++ b/crates/nu-command/src/bytes/length.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CellPathOnlyArgs}; +use nu_cmd_base::input_handler::{CellPathOnlyArgs, operate}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-command/src/bytes/remove.rs b/crates/nu-command/src/bytes/remove.rs index df420d044a..f9fa9418ff 100644 --- a/crates/nu-command/src/bytes/remove.rs +++ b/crates/nu-command/src/bytes/remove.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; struct Arguments { @@ -81,9 +81,7 @@ impl Command for BytesRemove { Example { description: "Remove contents", example: "0x[10 AA FF AA FF] | bytes remove 0x[10 AA]", - result: Some(Value::test_binary ( - vec![0xFF, 0xAA, 0xFF], - )), + result: Some(Value::test_binary(vec![0xFF, 0xAA, 0xFF])), }, Example { description: "Remove all occurrences of find binary in record field", @@ -95,27 +93,23 @@ impl Command for BytesRemove { Example { description: "Remove occurrences of find binary from end", example: "0x[10 AA 10 BB CC AA 10] | bytes remove --end 0x[10]", - result: Some(Value::test_binary ( - vec![0x10, 0xAA, 0x10, 0xBB, 0xCC, 0xAA], - )), + result: Some(Value::test_binary(vec![0x10, 0xAA, 0x10, 0xBB, 0xCC, 0xAA])), }, Example { description: "Remove find binary from end not found", example: "0x[10 AA 10 BB CC AA 10] | bytes remove --end 0x[11]", - result: Some(Value::test_binary ( - vec![0x10, 0xAA, 0x10, 0xBB, 0xCC, 0xAA, 0x10], - )), + result: Some(Value::test_binary(vec![ + 0x10, 0xAA, 0x10, 0xBB, 0xCC, 0xAA, 0x10, + ])), }, Example { description: "Remove all occurrences of find binary in table", example: "[[ColA ColB ColC]; [0x[11 12 13] 0x[14 15 16] 0x[17 18 19]]] | bytes remove 0x[11] ColA ColC", - result: Some(Value::test_list ( - vec![Value::test_record(record! { - "ColA" => Value::test_binary ( vec![0x12, 0x13],), - "ColB" => Value::test_binary ( vec![0x14, 0x15, 0x16],), - "ColC" => Value::test_binary ( vec![0x17, 0x18, 0x19],), - })], - )), + result: Some(Value::test_list(vec![Value::test_record(record! { + "ColA" => Value::test_binary ( vec![0x12, 0x13],), + "ColB" => Value::test_binary ( vec![0x14, 0x15, 0x16],), + "ColC" => Value::test_binary ( vec![0x17, 0x18, 0x19],), + })])), }, ] } diff --git a/crates/nu-command/src/bytes/replace.rs b/crates/nu-command/src/bytes/replace.rs index a3ef18bdb7..f5d0025b19 100644 --- a/crates/nu-command/src/bytes/replace.rs +++ b/crates/nu-command/src/bytes/replace.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; struct Arguments { @@ -81,27 +81,21 @@ impl Command for BytesReplace { Example { description: "Find and replace contents", example: "0x[10 AA FF AA FF] | bytes replace 0x[10 AA] 0x[FF]", - result: Some(Value::test_binary ( - vec![0xFF, 0xFF, 0xAA, 0xFF], - )), + result: Some(Value::test_binary(vec![0xFF, 0xFF, 0xAA, 0xFF])), }, Example { description: "Find and replace all occurrences of find binary", example: "0x[10 AA 10 BB 10] | bytes replace --all 0x[10] 0x[A0]", - result: Some(Value::test_binary ( - vec![0xA0, 0xAA, 0xA0, 0xBB, 0xA0], - )), + result: Some(Value::test_binary(vec![0xA0, 0xAA, 0xA0, 0xBB, 0xA0])), }, Example { description: "Find and replace all occurrences of find binary in table", example: "[[ColA ColB ColC]; [0x[11 12 13] 0x[14 15 16] 0x[17 18 19]]] | bytes replace --all 0x[11] 0x[13] ColA ColC", - result: Some(Value::test_list ( - vec![Value::test_record(record! { - "ColA" => Value::test_binary(vec![0x13, 0x12, 0x13]), - "ColB" => Value::test_binary(vec![0x14, 0x15, 0x16]), - "ColC" => Value::test_binary(vec![0x17, 0x18, 0x19]), - })], - )), + result: Some(Value::test_list(vec![Value::test_record(record! { + "ColA" => Value::test_binary(vec![0x13, 0x12, 0x13]), + "ColB" => Value::test_binary(vec![0x14, 0x15, 0x16]), + "ColC" => Value::test_binary(vec![0x17, 0x18, 0x19]), + })])), }, ] } diff --git a/crates/nu-command/src/bytes/reverse.rs b/crates/nu-command/src/bytes/reverse.rs index ed988716b4..68a238ef84 100644 --- a/crates/nu-command/src/bytes/reverse.rs +++ b/crates/nu-command/src/bytes/reverse.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CellPathOnlyArgs}; +use nu_cmd_base::input_handler::{CellPathOnlyArgs, operate}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-command/src/bytes/starts_with.rs b/crates/nu-command/src/bytes/starts_with.rs index 9681b4ccbe..69cb0a3d76 100644 --- a/crates/nu-command/src/bytes/starts_with.rs +++ b/crates/nu-command/src/bytes/starts_with.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; use nu_protocol::shell_error::io::IoError; use std::io::Read; diff --git a/crates/nu-command/src/charting/hashable_value.rs b/crates/nu-command/src/charting/hashable_value.rs index 636f5b7a05..d29d840f7b 100644 --- a/crates/nu-command/src/charting/hashable_value.rs +++ b/crates/nu-command/src/charting/hashable_value.rs @@ -181,9 +181,9 @@ impl PartialEq for HashableValue { mod test { use super::*; use nu_protocol::{ + BlockId, ast::{CellPath, PathMember}, engine::Closure, - BlockId, }; use std::collections::HashSet; diff --git a/crates/nu-command/src/charting/histogram.rs b/crates/nu-command/src/charting/histogram.rs index 349ec1c2a7..7587484638 100755 --- a/crates/nu-command/src/charting/histogram.rs +++ b/crates/nu-command/src/charting/histogram.rs @@ -38,37 +38,35 @@ impl Command for Histogram { result: None, }, Example { - description: - "Compute a histogram for the types of files, with frequency column named freq", + description: "Compute a histogram for the types of files, with frequency column named freq", example: "ls | histogram type freq", result: None, }, Example { description: "Compute a histogram for a list of numbers", example: "[1 2 1] | histogram", - result: Some(Value::test_list ( - vec![Value::test_record(record! { - "value" => Value::test_int(1), - "count" => Value::test_int(2), - "quantile" => Value::test_float(0.6666666666666666), - "percentage" => Value::test_string("66.67%"), - "frequency" => Value::test_string("******************************************************************"), - }), - Value::test_record(record! { - "value" => Value::test_int(2), - "count" => Value::test_int(1), - "quantile" => Value::test_float(0.3333333333333333), - "percentage" => Value::test_string("33.33%"), - "frequency" => Value::test_string("*********************************"), - })], - ) - ), + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "value" => Value::test_int(1), + "count" => Value::test_int(2), + "quantile" => Value::test_float(0.6666666666666666), + "percentage" => Value::test_string("66.67%"), + "frequency" => Value::test_string("******************************************************************"), + }), + Value::test_record(record! { + "value" => Value::test_int(2), + "count" => Value::test_int(1), + "quantile" => Value::test_float(0.3333333333333333), + "percentage" => Value::test_string("33.33%"), + "frequency" => Value::test_string("*********************************"), + }), + ])), }, Example { description: "Compute a histogram for a list of numbers, and percentage is based on the maximum value", example: "[1 2 3 1 1 1 2 2 1 1] | histogram --percentage-type relative", result: None, - } + }, ] } @@ -115,7 +113,7 @@ impl Command for Histogram { err_message: "calc method can only be 'normalize' or 'relative'" .to_string(), span: inner.span, - }) + }); } }, }; diff --git a/crates/nu-command/src/conversions/fill.rs b/crates/nu-command/src/conversions/fill.rs index 65d6b20b22..301ec74c24 100644 --- a/crates/nu-command/src/conversions/fill.rs +++ b/crates/nu-command/src/conversions/fill.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; use print_positions::print_positions; @@ -79,14 +79,12 @@ impl Command for Fill { fn examples(&self) -> Vec { vec![ Example { - description: - "Fill a string on the left side to a width of 15 with the character '─'", + description: "Fill a string on the left side to a width of 15 with the character '─'", example: "'nushell' | fill --alignment l --character '─' --width 15", result: Some(Value::string("nushell────────", Span::test_data())), }, Example { - description: - "Fill a string on the right side to a width of 15 with the character '─'", + description: "Fill a string on the right side to a width of 15 with the character '─'", example: "'nushell' | fill --alignment r --character '─' --width 15", result: Some(Value::string("────────nushell", Span::test_data())), }, @@ -96,8 +94,7 @@ impl Command for Fill { result: Some(Value::string("──────────", Span::test_data())), }, Example { - description: - "Fill a number on the left side to a width of 5 with the character '0'", + description: "Fill a number on the left side to a width of 5 with the character '0'", example: "1 | fill --alignment right --character '0' --width 5", result: Some(Value::string("00001", Span::test_data())), }, @@ -107,8 +104,7 @@ impl Command for Fill { result: Some(Value::string("01.10", Span::test_data())), }, Example { - description: - "Fill a filesize on both sides to a width of 10 with the character '0'", + description: "Fill a filesize on both sides to a width of 10 with the character '0'", example: "1kib | fill --alignment middle --character '0' --width 10", result: Some(Value::string("0001024000", Span::test_data())), }, diff --git a/crates/nu-command/src/conversions/into/binary.rs b/crates/nu-command/src/conversions/into/binary.rs index 3a9c6077ab..c977183ae8 100644 --- a/crates/nu-command/src/conversions/into/binary.rs +++ b/crates/nu-command/src/conversions/into/binary.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; struct Arguments { diff --git a/crates/nu-command/src/conversions/into/bool.rs b/crates/nu-command/src/conversions/into/bool.rs index b2de275497..59f09dc78e 100644 --- a/crates/nu-command/src/conversions/into/bool.rs +++ b/crates/nu-command/src/conversions/into/bool.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-command/src/conversions/into/cell_path.rs b/crates/nu-command/src/conversions/into/cell_path.rs index d96d76deab..d7ff08d3eb 100644 --- a/crates/nu-command/src/conversions/into/cell_path.rs +++ b/crates/nu-command/src/conversions/into/cell_path.rs @@ -204,7 +204,7 @@ fn value_to_path_member(val: &Value, span: Span) -> Result Result Result Result Result Result { #[cfg(test)] mod tests { use super::*; - use super::{action, DatetimeFormat, IntoDatetime, Zone}; + use super::{DatetimeFormat, IntoDatetime, Zone, action}; use nu_protocol::Type::Error; #[test] diff --git a/crates/nu-command/src/conversions/into/duration.rs b/crates/nu-command/src/conversions/into/duration.rs index c826d60551..95782a0b9d 100644 --- a/crates/nu-command/src/conversions/into/duration.rs +++ b/crates/nu-command/src/conversions/into/duration.rs @@ -1,7 +1,7 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; -use nu_parser::{parse_unit_value, DURATION_UNIT_GROUPS}; -use nu_protocol::{ast::Expr, Unit}; +use nu_parser::{DURATION_UNIT_GROUPS, parse_unit_value}; +use nu_protocol::{Unit, ast::Expr}; const NS_PER_US: i64 = 1_000; const NS_PER_MS: i64 = 1_000_000; @@ -139,8 +139,7 @@ impl Command for IntoDuration { }, Example { description: "Convert table of duration strings to table of duration values", - example: - "[[value]; ['1sec'] ['2min'] ['3hr'] ['4day'] ['5wk']] | into duration value", + example: "[[value]; ['1sec'] ['2min'] ['3hr'] ['4day'] ['5wk']] | into duration value", result: Some(Value::test_list(vec![ Value::test_record(record! { "value" => Value::test_duration(NS_PER_SEC), @@ -325,9 +324,8 @@ fn merge_record(record: &Record, head: Span, span: Span) -> Result false, @@ -270,7 +270,7 @@ fn action(input: &Value, args: &Arguments, span: Span) -> Value { help: None, }, span, - ) + ); } } } @@ -403,7 +403,7 @@ fn convert_int(input: &Value, head: Span, radix: u32) -> Value { help: Some(e.to_string()), }, head, - ) + ); } } } @@ -456,7 +456,7 @@ fn int_from_string(a_string: &str, span: Span) -> Result { from_type: "string".to_string(), span, help: Some(r#"digits following "0b" can only be 0 or 1"#.to_string()), - }) + }); } }; Ok(num) @@ -486,7 +486,7 @@ fn int_from_string(a_string: &str, span: Span) -> Result { from_type: "string".to_string(), span, help: Some(r#"octal digits following "0o" should be in 0-7"#.to_string()), - }) + }); } }; Ok(num) diff --git a/crates/nu-command/src/conversions/into/record.rs b/crates/nu-command/src/conversions/into/record.rs index bba7dc9d7c..5d1b9f9281 100644 --- a/crates/nu-command/src/conversions/into/record.rs +++ b/crates/nu-command/src/conversions/into/record.rs @@ -171,7 +171,7 @@ fn into_record(call: &Call, input: PipelineData) -> Result { - return Ok(split_cell_path(val, head)?.into_pipeline_data()) + return Ok(split_cell_path(val, head)?.into_pipeline_data()); } PipelineData::Empty => return Err(ShellError::PipelineEmpty { dst_span: head }), diff --git a/crates/nu-command/src/database/commands/query_db.rs b/crates/nu-command/src/database/commands/query_db.rs index a70a11c6ae..e5b3cd5aa0 100644 --- a/crates/nu-command/src/database/commands/query_db.rs +++ b/crates/nu-command/src/database/commands/query_db.rs @@ -1,4 +1,4 @@ -use crate::database::{values::sqlite::nu_value_to_params, SQLiteDatabase}; +use crate::database::{SQLiteDatabase, values::sqlite::nu_value_to_params}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-command/src/database/mod.rs b/crates/nu-command/src/database/mod.rs index 22b92a81d3..ae19019884 100644 --- a/crates/nu-command/src/database/mod.rs +++ b/crates/nu-command/src/database/mod.rs @@ -4,8 +4,8 @@ mod values; use commands::add_commands_decls; pub use values::{ - convert_sqlite_row_to_nu_value, convert_sqlite_value_to_nu_value, open_connection_in_memory, - open_connection_in_memory_custom, values_to_sql, SQLiteDatabase, MEMORY_DB, + MEMORY_DB, SQLiteDatabase, convert_sqlite_row_to_nu_value, convert_sqlite_value_to_nu_value, + open_connection_in_memory, open_connection_in_memory_custom, values_to_sql, }; use nu_protocol::engine::StateWorkingSet; diff --git a/crates/nu-command/src/database/values/mod.rs b/crates/nu-command/src/database/values/mod.rs index b9bd3d5d4c..7e3d2af454 100644 --- a/crates/nu-command/src/database/values/mod.rs +++ b/crates/nu-command/src/database/values/mod.rs @@ -2,6 +2,6 @@ pub mod definitions; pub mod sqlite; pub use sqlite::{ - convert_sqlite_row_to_nu_value, convert_sqlite_value_to_nu_value, open_connection_in_memory, - open_connection_in_memory_custom, values_to_sql, SQLiteDatabase, MEMORY_DB, + MEMORY_DB, SQLiteDatabase, convert_sqlite_row_to_nu_value, convert_sqlite_value_to_nu_value, + open_connection_in_memory, open_connection_in_memory_custom, values_to_sql, }; diff --git a/crates/nu-command/src/database/values/sqlite.rs b/crates/nu-command/src/database/values/sqlite.rs index 8959cf5998..642aea1753 100644 --- a/crates/nu-command/src/database/values/sqlite.rs +++ b/crates/nu-command/src/database/values/sqlite.rs @@ -3,12 +3,12 @@ use super::definitions::{ db_index::DbIndex, db_table::DbTable, }; use nu_protocol::{ - shell_error::io::IoError, CustomValue, PipelineData, Record, ShellError, Signals, Span, - Spanned, Value, + CustomValue, PipelineData, Record, ShellError, Signals, Span, Spanned, Value, + shell_error::io::IoError, }; use rusqlite::{ - types::ValueRef, Connection, DatabaseName, Error as SqliteError, OpenFlags, Row, Statement, - ToSql, + Connection, DatabaseName, Error as SqliteError, OpenFlags, Row, Statement, ToSql, + types::ValueRef, }; use serde::{Deserialize, Serialize}; use std::{ @@ -435,7 +435,7 @@ pub fn value_to_sql(value: Value) -> Result, ShellError wrong_type: val.get_type().to_string(), dst_span: Span::unknown(), src_span: val.span(), - }) + }); } }) } diff --git a/crates/nu-command/src/date/from_human.rs b/crates/nu-command/src/date/from_human.rs index ff99dff064..ae3e09a8f8 100644 --- a/crates/nu-command/src/date/from_human.rs +++ b/crates/nu-command/src/date/from_human.rs @@ -1,5 +1,5 @@ use chrono::{Local, TimeZone}; -use human_date_parser::{from_human_time, ParseResult}; +use human_date_parser::{ParseResult, from_human_time}; use nu_engine::command_prelude::*; #[derive(Clone)] @@ -99,7 +99,7 @@ fn helper(value: Value, head: Span) -> Value { src_span: span, }, span, - ) + ); } }; diff --git a/crates/nu-command/src/date/now.rs b/crates/nu-command/src/date/now.rs index 833ef0c310..711efc003d 100644 --- a/crates/nu-command/src/date/now.rs +++ b/crates/nu-command/src/date/now.rs @@ -43,8 +43,7 @@ impl Command for DateNow { result: None, }, Example { - description: - "Get the current date and format it according to the RFC 3339 standard.", + description: "Get the current date and format it according to the RFC 3339 standard.", example: r#"date now | format date "%+""#, result: None, }, @@ -59,8 +58,7 @@ impl Command for DateNow { result: None, }, Example { - description: - "Get current time and format it in the debug format (RFC 2822 with timezone)", + description: "Get current time and format it in the debug format (RFC 2822 with timezone)", example: r#"date now | debug"#, result: None, }, diff --git a/crates/nu-command/src/date/utils.rs b/crates/nu-command/src/date/utils.rs index 62e8c17be8..80f27f452c 100644 --- a/crates/nu-command/src/date/utils.rs +++ b/crates/nu-command/src/date/utils.rs @@ -1,5 +1,5 @@ use chrono::{DateTime, FixedOffset, Local, LocalResult, TimeZone}; -use nu_protocol::{record, ShellError, Span, Value}; +use nu_protocol::{ShellError, Span, Value, record}; pub(crate) fn parse_date_from_string( input: &str, @@ -109,8 +109,7 @@ pub(crate) fn generate_strftime_list(head: Span, show_parse_only_formats: bool) }, FormatSpecification { spec: "%W", - description: - "Same as %U, but week 1 starts with the first Monday in that year instead.", + description: "Same as %U, but week 1 starts with the first Monday in that year instead.", }, FormatSpecification { spec: "%G", @@ -226,8 +225,7 @@ pub(crate) fn generate_strftime_list(head: Span, show_parse_only_formats: bool) }, FormatSpecification { spec: "%Z", - description: - "Local time zone name. Skips all non-whitespace characters during parsing.", + description: "Local time zone name. Skips all non-whitespace characters during parsing.", }, FormatSpecification { spec: "%z", diff --git a/crates/nu-command/src/debug/ast.rs b/crates/nu-command/src/debug/ast.rs index 45e7738c32..a932b84bce 100644 --- a/crates/nu-command/src/debug/ast.rs +++ b/crates/nu-command/src/debug/ast.rs @@ -1,7 +1,7 @@ use nu_engine::command_prelude::*; use nu_parser::{flatten_block, parse}; use nu_protocol::{engine::StateWorkingSet, record}; -use serde_json::{json, Value as JsonValue}; +use serde_json::{Value as JsonValue, json}; #[derive(Clone)] pub struct Ast; @@ -52,8 +52,7 @@ impl Command for Ast { result: None, }, Example { - description: - "Print the ast of a pipeline with an error, as json, in a nushell table", + description: "Print the ast of a pipeline with an error, as json, in a nushell table", example: "ast 'for x in 1..10 { echo $x ' --json | get block | from json", result: None, }, @@ -288,15 +287,15 @@ impl Command for Ast { fn json_merge(a: &mut JsonValue, b: &JsonValue) { match (a, b) { - (JsonValue::Object(ref mut a), JsonValue::Object(b)) => { + (JsonValue::Object(a), JsonValue::Object(b)) => { for (k, v) in b { json_merge(a.entry(k).or_insert(JsonValue::Null), v); } } - (JsonValue::Array(ref mut a), JsonValue::Array(b)) => { + (JsonValue::Array(a), JsonValue::Array(b)) => { a.extend(b.clone()); } - (JsonValue::Array(ref mut a), JsonValue::Object(b)) => { + (JsonValue::Array(a), JsonValue::Object(b)) => { a.extend([JsonValue::Object(b.clone())]); } (a, b) => { diff --git a/crates/nu-command/src/debug/debug_.rs b/crates/nu-command/src/debug/debug_.rs index 1e559158b3..48de0b2fad 100644 --- a/crates/nu-command/src/debug/debug_.rs +++ b/crates/nu-command/src/debug/debug_.rs @@ -78,8 +78,7 @@ impl Command for Debug { }, Example { description: "Debug print a table", - example: - "[[version patch]; ['0.1.0' false] ['0.1.1' true] ['0.2.0' false]] | debug", + example: "[[version patch]; ['0.1.0' false] ['0.1.1' true] ['0.2.0' false]] | debug", result: Some(Value::list( vec![ Value::test_string("{version: 0.1.0, patch: false}"), diff --git a/crates/nu-command/src/debug/explain.rs b/crates/nu-command/src/debug/explain.rs index 190bd9cbe5..7d7624af19 100644 --- a/crates/nu-command/src/debug/explain.rs +++ b/crates/nu-command/src/debug/explain.rs @@ -47,8 +47,7 @@ impl Command for Explain { fn examples(&self) -> Vec { vec![Example { description: "Explain a command within a closure", - example: - "explain {|| ls | sort-by name type --ignore-case | get name } | table --expand", + example: "explain {|| ls | sort-by name type --ignore-case | get name } | table --expand", result: None, }] } diff --git a/crates/nu-command/src/debug/inspect_table.rs b/crates/nu-command/src/debug/inspect_table.rs index 6bd5a3cce8..04eaa240ad 100644 --- a/crates/nu-command/src/debug/inspect_table.rs +++ b/crates/nu-command/src/debug/inspect_table.rs @@ -2,13 +2,13 @@ // IMHO: it shall not take 300+ lines :) use self::{global_horizontal_char::SetHorizontalChar, set_widths::SetWidths}; -use nu_protocol::engine::EngineState; use nu_protocol::Value; +use nu_protocol::engine::EngineState; use nu_table::{string_width, string_wrap}; use tabled::{ - grid::config::ColoredConfig, - settings::{peaker::Priority, width::Wrap, Settings, Style}, Table, + grid::config::ColoredConfig, + settings::{Settings, Style, peaker::Priority, width::Wrap}, }; pub fn build_table( @@ -199,8 +199,8 @@ fn push_empty_column(data: &mut Vec>) { mod util { use crate::debug::explain::debug_string_without_formatting; use nu_engine::get_columns; - use nu_protocol::engine::EngineState; use nu_protocol::Value; + use nu_protocol::engine::EngineState; /// Try to build column names and a table grid. pub fn collect_input( @@ -263,10 +263,12 @@ mod util { } else if cols.is_empty() && records.is_empty() { vec![] } else if cols.len() == records.len() { - vec![records - .into_iter() - .map(|s| debug_string_without_formatting(engine_state, &s)) - .collect()] + vec![ + records + .into_iter() + .map(|s| debug_string_without_formatting(engine_state, &s)) + .collect(), + ] } else { records .into_iter() diff --git a/crates/nu-command/src/debug/metadata.rs b/crates/nu-command/src/debug/metadata.rs index c9b48bb79a..61b038fd04 100644 --- a/crates/nu-command/src/debug/metadata.rs +++ b/crates/nu-command/src/debug/metadata.rs @@ -1,7 +1,7 @@ use nu_engine::command_prelude::*; use nu_protocol::{ - ast::{Expr, Expression}, DataSource, PipelineMetadata, + ast::{Expr, Expression}, }; #[derive(Clone)] diff --git a/crates/nu-command/src/debug/metadata_access.rs b/crates/nu-command/src/debug/metadata_access.rs index ff176168e1..6abf16dc2a 100644 --- a/crates/nu-command/src/debug/metadata_access.rs +++ b/crates/nu-command/src/debug/metadata_access.rs @@ -1,7 +1,7 @@ use nu_engine::{command_prelude::*, get_eval_block_with_early_return}; use nu_protocol::{ - engine::{Call, Closure, Command, EngineState, Stack}, DataSource, PipelineData, PipelineMetadata, ShellError, Signature, SyntaxShape, Type, Value, + engine::{Call, Closure, Command, EngineState, Stack}, }; #[derive(Clone)] diff --git a/crates/nu-command/src/debug/metadata_set.rs b/crates/nu-command/src/debug/metadata_set.rs index 6274de7544..7b943f8c65 100644 --- a/crates/nu-command/src/debug/metadata_set.rs +++ b/crates/nu-command/src/debug/metadata_set.rs @@ -95,7 +95,7 @@ impl Command for MetadataSet { #[cfg(test)] mod test { - use crate::{test_examples_with_commands, Metadata}; + use crate::{Metadata, test_examples_with_commands}; use super::*; diff --git a/crates/nu-command/src/debug/profile.rs b/crates/nu-command/src/debug/profile.rs index 6fe88e2cf2..4ec9e18de5 100644 --- a/crates/nu-command/src/debug/profile.rs +++ b/crates/nu-command/src/debug/profile.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEvalOnce}; +use nu_engine::{ClosureEvalOnce, command_prelude::*}; use nu_protocol::{ debugger::{DurationMode, Profiler, ProfilerOptions}, engine::Closure, diff --git a/crates/nu-command/src/debug/timeit.rs b/crates/nu-command/src/debug/timeit.rs index 6c372db3f6..b6835541dd 100644 --- a/crates/nu-command/src/debug/timeit.rs +++ b/crates/nu-command/src/debug/timeit.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEvalOnce}; +use nu_engine::{ClosureEvalOnce, command_prelude::*}; use nu_protocol::engine::Closure; use web_time::Instant; diff --git a/crates/nu-command/src/debug/view_ir.rs b/crates/nu-command/src/debug/view_ir.rs index 1a7309de45..c38808008d 100644 --- a/crates/nu-command/src/debug/view_ir.rs +++ b/crates/nu-command/src/debug/view_ir.rs @@ -119,7 +119,7 @@ the declaration may not be in scope. return Err(ShellError::TypeMismatch { err_message: "expected closure, string, or int".into(), span: call.head, - }) + }); } }; diff --git a/crates/nu-command/src/debug/view_source.rs b/crates/nu-command/src/debug/view_source.rs index c0003b5b09..ddacd64c78 100644 --- a/crates/nu-command/src/debug/view_source.rs +++ b/crates/nu-command/src/debug/view_source.rs @@ -250,7 +250,9 @@ impl Command for ViewSource { Example { description: "View the source of a custom command with flags and arguments", example: r#"def test [a?:any --b:int ...rest:string] { echo 'test' }; view source test"#, - result: Some(Value::test_string("def test [ a?: any --b: int ...rest: string] { echo 'test' }")), + result: Some(Value::test_string( + "def test [ a?: any --b: int ...rest: string] { echo 'test' }", + )), }, Example { description: "View the source of a module", diff --git a/crates/nu-command/src/env/config/config_nu.rs b/crates/nu-command/src/env/config/config_nu.rs index ee09965aa6..0767e855b3 100644 --- a/crates/nu-command/src/env/config/config_nu.rs +++ b/crates/nu-command/src/env/config/config_nu.rs @@ -42,8 +42,7 @@ impl Command for ConfigNu { result: None, }, Example { - description: - "pretty-print the internal `config.nu` file which is loaded before user's config", + description: "pretty-print the internal `config.nu` file which is loaded before user's config", example: "config nu --default | nu-highlight", result: None, }, diff --git a/crates/nu-command/src/env/load_env.rs b/crates/nu-command/src/env/load_env.rs index b508aa6f3b..54505e9926 100644 --- a/crates/nu-command/src/env/load_env.rs +++ b/crates/nu-command/src/env/load_env.rs @@ -50,7 +50,7 @@ impl Command for LoadEnv { input: "value originated from here".into(), msg_span: span, input_span: input.span().unwrap_or(span), - }) + }); } }, }; diff --git a/crates/nu-command/src/env/source_env.rs b/crates/nu-command/src/env/source_env.rs index a16bbe557f..b00dcde8e7 100644 --- a/crates/nu-command/src/env/source_env.rs +++ b/crates/nu-command/src/env/source_env.rs @@ -2,7 +2,7 @@ use nu_engine::{ command_prelude::*, find_in_dirs_env, get_dirs_var_from_call, get_eval_block_with_early_return, redirect_env, }; -use nu_protocol::{engine::CommandType, shell_error::io::IoError, BlockId}; +use nu_protocol::{BlockId, engine::CommandType, shell_error::io::IoError}; use std::path::PathBuf; /// Source a file for environment variables. diff --git a/crates/nu-command/src/example_test.rs b/crates/nu-command/src/example_test.rs index dca285f835..86004d2ca5 100644 --- a/crates/nu-command/src/example_test.rs +++ b/crates/nu-command/src/example_test.rs @@ -33,8 +33,8 @@ mod test_examples { }; use nu_cmd_lang::{Break, Describe, Echo, If, Let, Mut}; use nu_protocol::{ - engine::{Command, EngineState, StateWorkingSet}, Type, + engine::{Command, EngineState, StateWorkingSet}, }; use std::collections::HashSet; diff --git a/crates/nu-command/src/experimental/is_admin.rs b/crates/nu-command/src/experimental/is_admin.rs index 37434f716e..ee79c4116a 100644 --- a/crates/nu-command/src/experimental/is_admin.rs +++ b/crates/nu-command/src/experimental/is_admin.rs @@ -34,13 +34,11 @@ impl Command for IsAdmin { } fn examples(&self) -> Vec { - vec![ - Example { - description: "Return 'iamroot' if nushell is running with admin/root privileges, and 'iamnotroot' if not.", - example: r#"if (is-admin) { "iamroot" } else { "iamnotroot" }"#, - result: Some(Value::test_string("iamnotroot")), - }, - ] + vec![Example { + description: "Return 'iamroot' if nushell is running with admin/root privileges, and 'iamnotroot' if not.", + example: r#"if (is-admin) { "iamroot" } else { "iamnotroot" }"#, + result: Some(Value::test_string("iamnotroot")), + }] } } @@ -58,7 +56,7 @@ fn is_root_impl() -> bool { fn is_root_impl() -> bool { use windows::Win32::{ Foundation::{CloseHandle, HANDLE}, - Security::{GetTokenInformation, TokenElevation, TOKEN_ELEVATION, TOKEN_QUERY}, + Security::{GetTokenInformation, TOKEN_ELEVATION, TOKEN_QUERY, TokenElevation}, System::Threading::{GetCurrentProcess, OpenProcessToken}, }; diff --git a/crates/nu-command/src/experimental/job_recv.rs b/crates/nu-command/src/experimental/job_recv.rs index 76a8dde2b3..81861c2d96 100644 --- a/crates/nu-command/src/experimental/job_recv.rs +++ b/crates/nu-command/src/experimental/job_recv.rs @@ -6,8 +6,8 @@ use std::{ use nu_engine::command_prelude::*; use nu_protocol::{ - engine::{FilterTag, Mailbox}, Signals, + engine::{FilterTag, Mailbox}, }; #[derive(Clone)] diff --git a/crates/nu-command/src/experimental/job_send.rs b/crates/nu-command/src/experimental/job_send.rs index 08495d5261..3df67add77 100644 --- a/crates/nu-command/src/experimental/job_send.rs +++ b/crates/nu-command/src/experimental/job_send.rs @@ -1,5 +1,5 @@ use nu_engine::command_prelude::*; -use nu_protocol::{engine::FilterTag, JobId}; +use nu_protocol::{JobId, engine::FilterTag}; #[derive(Clone)] pub struct JobSend; diff --git a/crates/nu-command/src/experimental/job_spawn.rs b/crates/nu-command/src/experimental/job_spawn.rs index 09ff929a8a..05c1d8885e 100644 --- a/crates/nu-command/src/experimental/job_spawn.rs +++ b/crates/nu-command/src/experimental/job_spawn.rs @@ -1,15 +1,17 @@ use std::{ sync::{ + Arc, Mutex, atomic::{AtomicBool, AtomicU32}, - mpsc, Arc, Mutex, + mpsc, }, thread, }; -use nu_engine::{command_prelude::*, ClosureEvalOnce}; +use nu_engine::{ClosureEvalOnce, command_prelude::*}; use nu_protocol::{ + OutDest, Signals, engine::{Closure, CurrentJob, Job, Mailbox, Redirection, ThreadJob}, - report_shell_error, OutDest, Signals, + report_shell_error, }; #[derive(Clone)] diff --git a/crates/nu-command/src/experimental/job_unfreeze.rs b/crates/nu-command/src/experimental/job_unfreeze.rs index 3143b31184..157f5a8ca8 100644 --- a/crates/nu-command/src/experimental/job_unfreeze.rs +++ b/crates/nu-command/src/experimental/job_unfreeze.rs @@ -1,10 +1,11 @@ use nu_engine::command_prelude::*; use nu_protocol::{ + JobId, engine::{FrozenJob, Job, ThreadJob}, process::check_ok, - shell_error, JobId, + shell_error, }; -use nu_system::{kill_by_pid, ForegroundWaitStatus}; +use nu_system::{ForegroundWaitStatus, kill_by_pid}; #[derive(Clone)] pub struct JobUnfreeze; @@ -59,13 +60,13 @@ impl Command for JobUnfreeze { return Err(ShellError::JobNotFound { id: id.get(), span: head, - }) + }); } Some(Job::Thread(ThreadJob { .. })) => { return Err(ShellError::JobNotFrozen { id: id.get(), span: head, - }) + }); } Some(Job::Frozen(FrozenJob { .. })) => jobs .remove_job(id) diff --git a/crates/nu-command/src/filesystem/cd.rs b/crates/nu-command/src/filesystem/cd.rs index be5381ae7d..4d75b767a6 100644 --- a/crates/nu-command/src/filesystem/cd.rs +++ b/crates/nu-command/src/filesystem/cd.rs @@ -2,7 +2,7 @@ use std::path::PathBuf; use nu_engine::command_prelude::*; use nu_protocol::shell_error::{self, io::IoError}; -use nu_utils::filesystem::{have_permission, PermissionResult}; +use nu_utils::filesystem::{PermissionResult, have_permission}; #[derive(Clone)] pub struct Cd; diff --git a/crates/nu-command/src/filesystem/du.rs b/crates/nu-command/src/filesystem/du.rs index e4b145065c..7042550a9c 100644 --- a/crates/nu-command/src/filesystem/du.rs +++ b/crates/nu-command/src/filesystem/du.rs @@ -164,7 +164,7 @@ fn du_for_one_pattern( current_dir: &Path, span: Span, signals: Signals, -) -> Result + Send, ShellError> { +) -> Result + Send + use<>, ShellError> { let exclude = args.exclude.map_or(Ok(None), move |x| { Pattern::new(x.item.as_ref()) .map(Some) diff --git a/crates/nu-command/src/filesystem/glob.rs b/crates/nu-command/src/filesystem/glob.rs index 740d5ec9e9..13e63a2d5b 100644 --- a/crates/nu-command/src/filesystem/glob.rs +++ b/crates/nu-command/src/filesystem/glob.rs @@ -70,14 +70,12 @@ impl Command for Glob { result: None, }, Example { - description: - "Search for files and folders that begin with uppercase C or lowercase c", + description: "Search for files and folders that begin with uppercase C or lowercase c", example: r#"glob "[Cc]*""#, result: None, }, Example { - description: - "Search for files and folders like abc or xyz substituting a character for ?", + description: "Search for files and folders like abc or xyz substituting a character for ?", example: r#"glob "{a?c,x?z}""#, result: None, }, @@ -201,7 +199,7 @@ impl Command for Glob { span: Some(glob_span), help: None, inner: vec![], - }) + }); } }; @@ -220,7 +218,7 @@ impl Command for Glob { span: Some(glob_span), help: None, inner: vec![], - }) + }); } }; diff --git a/crates/nu-command/src/filesystem/ls.rs b/crates/nu-command/src/filesystem/ls.rs index 4a188429f3..57bf8554d0 100644 --- a/crates/nu-command/src/filesystem/ls.rs +++ b/crates/nu-command/src/filesystem/ls.rs @@ -5,7 +5,7 @@ use nu_engine::glob_from; use nu_engine::{command_prelude::*, env::current_dir}; use nu_glob::MatchOptions; use nu_path::{expand_path_with, expand_to_real_path}; -use nu_protocol::{shell_error::io::IoError, DataSource, NuGlob, PipelineMetadata, Signals}; +use nu_protocol::{DataSource, NuGlob, PipelineMetadata, Signals, shell_error::io::IoError}; use pathdiff::diff_paths; use rayon::prelude::*; #[cfg(unix)] @@ -13,7 +13,7 @@ use std::os::unix::fs::PermissionsExt; use std::{ cmp::Ordering, path::PathBuf, - sync::{mpsc, Arc, Mutex}, + sync::{Arc, Mutex, mpsc}, time::{SystemTime, UNIX_EPOCH}, }; @@ -189,20 +189,17 @@ impl Command for Ls { result: None, }, Example { - description: - "List only the names (not paths) of all dirs in your home directory which have not been modified in 7 days", + description: "List only the names (not paths) of all dirs in your home directory which have not been modified in 7 days", example: "ls -as ~ | where type == dir and modified < ((date now) - 7day)", result: None, }, Example { - description: - "Recursively list all files and subdirectories under the current directory using a glob pattern", + description: "Recursively list all files and subdirectories under the current directory using a glob pattern", example: "ls -a **/*", result: None, }, Example { - description: - "Recursively list *.rs and *.toml files using the glob command", + description: "Recursively list *.rs and *.toml files using the glob command", example: "ls ...(glob **/*.{rs,toml})", result: None, }, @@ -799,8 +796,8 @@ mod windows_helper { use std::os::windows::prelude::OsStrExt; use windows::Win32::Foundation::FILETIME; use windows::Win32::Storage::FileSystem::{ - FindClose, FindFirstFileW, FILE_ATTRIBUTE_DIRECTORY, FILE_ATTRIBUTE_READONLY, - FILE_ATTRIBUTE_REPARSE_POINT, WIN32_FIND_DATAW, + FILE_ATTRIBUTE_DIRECTORY, FILE_ATTRIBUTE_READONLY, FILE_ATTRIBUTE_REPARSE_POINT, FindClose, + FindFirstFileW, WIN32_FIND_DATAW, }; use windows::Win32::System::SystemServices::{ IO_REPARSE_TAG_MOUNT_POINT, IO_REPARSE_TAG_SYMLINK, @@ -858,7 +855,7 @@ mod windows_helper { ); } - let file_size = (find_data.nFileSizeHigh as u64) << 32 | find_data.nFileSizeLow as u64; + let file_size = ((find_data.nFileSizeHigh as u64) << 32) | find_data.nFileSizeLow as u64; record.push("size", Value::filesize(file_size as i64, span)); if long { diff --git a/crates/nu-command/src/filesystem/open.rs b/crates/nu-command/src/filesystem/open.rs index 9932c9c9f5..ca9e3fc478 100644 --- a/crates/nu-command/src/filesystem/open.rs +++ b/crates/nu-command/src/filesystem/open.rs @@ -1,10 +1,9 @@ #[allow(deprecated)] use nu_engine::{command_prelude::*, current_dir, eval_call}; use nu_protocol::{ - ast, + DataSource, NuGlob, PipelineMetadata, ast, debugger::{WithDebug, WithoutDebug}, shell_error::{self, io::IoError}, - DataSource, NuGlob, PipelineMetadata, }; use std::{ collections::HashMap, @@ -290,7 +289,7 @@ impl Command for Open { | rename extension command "#, result: None, - } + }, ] } } diff --git a/crates/nu-command/src/filesystem/rm.rs b/crates/nu-command/src/filesystem/rm.rs index bf21e000c0..ac0867420d 100644 --- a/crates/nu-command/src/filesystem/rm.rs +++ b/crates/nu-command/src/filesystem/rm.rs @@ -4,9 +4,8 @@ use nu_engine::{command_prelude::*, env::current_dir}; use nu_glob::MatchOptions; use nu_path::expand_path_with; use nu_protocol::{ - report_shell_error, + NuGlob, report_shell_error, shell_error::{self, io::IoError}, - NuGlob, }; #[cfg(unix)] use std::os::unix::prelude::FileTypeExt; @@ -71,8 +70,7 @@ impl Command for Rm { fn examples(&self) -> Vec { let mut examples = vec![Example { - description: - "Delete, or move a file to the trash (based on the 'always_trash' config option)", + description: "Delete, or move a file to the trash (based on the 'always_trash' config option)", example: "rm file.txt", result: None, }]; diff --git a/crates/nu-command/src/filesystem/save.rs b/crates/nu-command/src/filesystem/save.rs index dc02e526f3..0d50b63cc7 100644 --- a/crates/nu-command/src/filesystem/save.rs +++ b/crates/nu-command/src/filesystem/save.rs @@ -4,8 +4,8 @@ use nu_engine::get_eval_block; use nu_engine::{command_prelude::*, current_dir}; use nu_path::expand_path_with; use nu_protocol::{ - ast, byte_stream::copy_with_signals, process::ChildPipe, shell_error::io::IoError, - ByteStreamSource, DataSource, OutDest, PipelineMetadata, Signals, + ByteStreamSource, DataSource, OutDest, PipelineMetadata, Signals, ast, + byte_stream::copy_with_signals, process::ChildPipe, shell_error::io::IoError, }; use std::{ fs::File, @@ -264,8 +264,7 @@ impl Command for Save { result: None, }, Example { - description: - "Show the extensions for which the `save` command will automatically serialize", + description: "Show the extensions for which the `save` command will automatically serialize", example: r#"scope commands | where name starts-with "to " | insert extension { get name | str replace -r "^to " "" | $"*.($in)" } diff --git a/crates/nu-command/src/filesystem/ucp.rs b/crates/nu-command/src/filesystem/ucp.rs index 56eea910ad..eaa4c4f626 100644 --- a/crates/nu-command/src/filesystem/ucp.rs +++ b/crates/nu-command/src/filesystem/ucp.rs @@ -1,6 +1,6 @@ #[allow(deprecated)] use nu_engine::{command_prelude::*, current_dir}; -use nu_protocol::{shell_error::io::IoError, NuGlob}; +use nu_protocol::{NuGlob, shell_error::io::IoError}; use std::path::PathBuf; use uu_cp::{BackupMode, CopyMode, UpdateMode}; @@ -274,7 +274,7 @@ impl Command for UCp { span: None, help: None, inner: vec![], - }) + }); } }; // TODO: What should we do in place of set_exit_code? diff --git a/crates/nu-command/src/filesystem/umv.rs b/crates/nu-command/src/filesystem/umv.rs index 9c3c713245..6a7d6965d8 100644 --- a/crates/nu-command/src/filesystem/umv.rs +++ b/crates/nu-command/src/filesystem/umv.rs @@ -1,7 +1,7 @@ #[allow(deprecated)] use nu_engine::{command_prelude::*, current_dir}; use nu_path::expand_path_with; -use nu_protocol::{shell_error::io::IoError, NuGlob}; +use nu_protocol::{NuGlob, shell_error::io::IoError}; use std::{ffi::OsString, path::PathBuf}; use uu_mv::{BackupMode, UpdateMode}; diff --git a/crates/nu-command/src/filesystem/utouch.rs b/crates/nu-command/src/filesystem/utouch.rs index 48077b0179..c724b59646 100644 --- a/crates/nu-command/src/filesystem/utouch.rs +++ b/crates/nu-command/src/filesystem/utouch.rs @@ -3,9 +3,9 @@ use filetime::FileTime; use nu_engine::command_prelude::*; use nu_glob::{glob, is_glob}; use nu_path::expand_path_with; -use nu_protocol::{shell_error::io::IoError, NuGlob}; +use nu_protocol::{NuGlob, shell_error::io::IoError}; use std::path::PathBuf; -use uu_touch::{error::TouchError, ChangeTimes, InputFile, Options, Source}; +use uu_touch::{ChangeTimes, InputFile, Options, Source, error::TouchError}; #[derive(Clone)] pub struct UTouch; diff --git a/crates/nu-command/src/filesystem/watch.rs b/crates/nu-command/src/filesystem/watch.rs index 3028181a21..3eba5f5312 100644 --- a/crates/nu-command/src/filesystem/watch.rs +++ b/crates/nu-command/src/filesystem/watch.rs @@ -1,11 +1,11 @@ use notify_debouncer_full::{ new_debouncer, notify::{ - event::{DataChange, ModifyKind, RenameMode}, EventKind, RecursiveMode, Watcher, + event::{DataChange, ModifyKind, RenameMode}, }, }; -use nu_engine::{command_prelude::*, ClosureEval}; +use nu_engine::{ClosureEval, command_prelude::*}; use nu_protocol::{ engine::{Closure, StateWorkingSet}, format_shell_error, @@ -13,7 +13,7 @@ use nu_protocol::{ }; use std::{ path::PathBuf, - sync::mpsc::{channel, RecvTimeoutError}, + sync::mpsc::{RecvTimeoutError, channel}, time::Duration, }; @@ -89,7 +89,7 @@ impl Command for Watch { err.kind(), path_arg.span, PathBuf::from(path_no_whitespace), - ))) + ))); } }; @@ -108,7 +108,7 @@ impl Command for Watch { return Err(ShellError::TypeMismatch { err_message: "Debounce duration is invalid".to_string(), span: val.span, - }) + }); } }, None => DEFAULT_WATCH_DEBOUNCE_DURATION, @@ -128,7 +128,7 @@ impl Command for Watch { return Err(ShellError::TypeMismatch { err_message: "Glob pattern is invalid".to_string(), span: glob.span, - }) + }); } } } diff --git a/crates/nu-command/src/filters/chunk_by.rs b/crates/nu-command/src/filters/chunk_by.rs index 18a5110918..3cc52b2b2a 100644 --- a/crates/nu-command/src/filters/chunk_by.rs +++ b/crates/nu-command/src/filters/chunk_by.rs @@ -1,7 +1,7 @@ use super::utils::chain_error_with_input; -use nu_engine::{command_prelude::*, ClosureEval}; -use nu_protocol::engine::Closure; +use nu_engine::{ClosureEval, command_prelude::*}; use nu_protocol::Signals; +use nu_protocol::engine::Closure; #[derive(Clone)] pub struct ChunkBy; diff --git a/crates/nu-command/src/filters/chunks.rs b/crates/nu-command/src/filters/chunks.rs index 2ff9b1b0a7..12ef37bd59 100644 --- a/crates/nu-command/src/filters/chunks.rs +++ b/crates/nu-command/src/filters/chunks.rs @@ -1,5 +1,5 @@ use nu_engine::command_prelude::*; -use nu_protocol::{shell_error::io::IoError, ListStream}; +use nu_protocol::{ListStream, shell_error::io::IoError}; use std::{ io::{BufRead, Cursor, ErrorKind}, num::NonZeroUsize, diff --git a/crates/nu-command/src/filters/columns.rs b/crates/nu-command/src/filters/columns.rs index e0d5b273a8..3cb11f949d 100644 --- a/crates/nu-command/src/filters/columns.rs +++ b/crates/nu-command/src/filters/columns.rs @@ -106,7 +106,7 @@ fn getcol(head: Span, input: PipelineData) -> Result { wrong_type: other.get_type().to_string(), dst_span: head, src_span: other.span(), - }) + }); } }; diff --git a/crates/nu-command/src/filters/default.rs b/crates/nu-command/src/filters/default.rs index f0dc641d5f..51e6a0aadb 100644 --- a/crates/nu-command/src/filters/default.rs +++ b/crates/nu-command/src/filters/default.rs @@ -55,8 +55,7 @@ impl Command for Default { result: None, }, Example { - description: - "Get the env value of `MY_ENV` with a default value 'abc' if not present", + description: "Get the env value of `MY_ENV` with a default value 'abc' if not present", example: "$env | get --ignore-errors MY_ENV | default 'abc'", result: Some(Value::test_string("abc")), }, diff --git a/crates/nu-command/src/filters/drop/nth.rs b/crates/nu-command/src/filters/drop/nth.rs index 02d97b70a3..ed4e0842d0 100644 --- a/crates/nu-command/src/filters/drop/nth.rs +++ b/crates/nu-command/src/filters/drop/nth.rs @@ -159,7 +159,7 @@ impl Command for DropNth { head, engine_state.signals().clone(), metadata, - )) + )); } }; diff --git a/crates/nu-command/src/filters/each.rs b/crates/nu-command/src/filters/each.rs index 9606a95bc1..5bf8570070 100644 --- a/crates/nu-command/src/filters/each.rs +++ b/crates/nu-command/src/filters/each.rs @@ -1,5 +1,5 @@ use super::utils::chain_error_with_input; -use nu_engine::{command_prelude::*, ClosureEval, ClosureEvalOnce}; +use nu_engine::{ClosureEval, ClosureEvalOnce, command_prelude::*}; use nu_protocol::engine::Closure; #[derive(Clone)] @@ -78,8 +78,7 @@ with 'transpose' first."# }, Example { example: r#"[1 2 3] | enumerate | each {|e| if $e.item == 2 { $"found 2 at ($e.index)!"} }"#, - description: - "Iterate over each element, producing a list showing indexes of any 2s", + description: "Iterate over each element, producing a list showing indexes of any 2s", result: Some(Value::test_list(vec![Value::test_string("found 2 at 1!")])), }, Example { diff --git a/crates/nu-command/src/filters/filter.rs b/crates/nu-command/src/filters/filter.rs index ea7960c4d3..0bb2460048 100644 --- a/crates/nu-command/src/filters/filter.rs +++ b/crates/nu-command/src/filters/filter.rs @@ -1,5 +1,5 @@ use super::utils::chain_error_with_input; -use nu_engine::{command_prelude::*, ClosureEval, ClosureEvalOnce}; +use nu_engine::{ClosureEval, ClosureEvalOnce, command_prelude::*}; use nu_protocol::engine::Closure; #[derive(Clone)] diff --git a/crates/nu-command/src/filters/find.rs b/crates/nu-command/src/filters/find.rs index fcd21efff0..28eac810fe 100644 --- a/crates/nu-command/src/filters/find.rs +++ b/crates/nu-command/src/filters/find.rs @@ -76,7 +76,10 @@ impl Command for Find { Example { description: "Search and highlight text for a term in a string. Note that regular search is case insensitive", example: r#"'Cargo.toml' | find cargo"#, - result: Some(Value::test_string("\u{1b}[37m\u{1b}[0m\u{1b}[41;37mCargo\u{1b}[0m\u{1b}[37m.toml\u{1b}[0m".to_owned())), + result: Some(Value::test_string( + "\u{1b}[37m\u{1b}[0m\u{1b}[41;37mCargo\u{1b}[0m\u{1b}[37m.toml\u{1b}[0m" + .to_owned(), + )), }, Example { description: "Search a number or a file size in a list of numbers", @@ -90,7 +93,14 @@ impl Command for Find { description: "Search a char in a list of string", example: r#"[moe larry curly] | find l"#, result: Some(Value::list( - vec![Value::test_string("\u{1b}[37m\u{1b}[0m\u{1b}[41;37ml\u{1b}[0m\u{1b}[37marry\u{1b}[0m"), Value::test_string("\u{1b}[37mcur\u{1b}[0m\u{1b}[41;37ml\u{1b}[0m\u{1b}[37my\u{1b}[0m")], + vec![ + Value::test_string( + "\u{1b}[37m\u{1b}[0m\u{1b}[41;37ml\u{1b}[0m\u{1b}[37marry\u{1b}[0m", + ), + Value::test_string( + "\u{1b}[37mcur\u{1b}[0m\u{1b}[41;37ml\u{1b}[0m\u{1b}[37my\u{1b}[0m", + ), + ], Span::test_data(), )), }, @@ -119,28 +129,24 @@ impl Command for Find { Example { description: "Find value in records using regex", example: r#"[[version name]; ['0.1.0' nushell] ['0.1.1' fish] ['0.2.0' zsh]] | find --regex "nu""#, - result: Some(Value::test_list( - vec![Value::test_record(record! { - "version" => Value::test_string("0.1.0"), - "name" => Value::test_string("nushell".to_string()), - })], - )), + result: Some(Value::test_list(vec![Value::test_record(record! { + "version" => Value::test_string("0.1.0"), + "name" => Value::test_string("nushell".to_string()), + })])), }, Example { description: "Find inverted values in records using regex", example: r#"[[version name]; ['0.1.0' nushell] ['0.1.1' fish] ['0.2.0' zsh]] | find --regex "nu" --invert"#, - result: Some(Value::test_list( - vec![ - Value::test_record(record!{ - "version" => Value::test_string("0.1.1"), - "name" => Value::test_string("fish".to_string()), - }), - Value::test_record(record! { - "version" => Value::test_string("0.2.0"), - "name" =>Value::test_string("zsh".to_string()), - }), - ], - )), + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "version" => Value::test_string("0.1.1"), + "name" => Value::test_string("fish".to_string()), + }), + Value::test_record(record! { + "version" => Value::test_string("0.2.0"), + "name" =>Value::test_string("zsh".to_string()), + }), + ])), }, Example { description: "Find value in list using regex", @@ -166,20 +172,18 @@ impl Command for Find { }, Example { description: "Remove ANSI sequences from result", - example:"[[foo bar]; [abc 123] [def 456]] | find --no-highlight 123", + example: "[[foo bar]; [abc 123] [def 456]] | find --no-highlight 123", result: Some(Value::list( vec![Value::test_record(record! { "foo" => Value::test_string("abc"), "bar" => Value::test_int(123) - } - )], + })], Span::test_data(), - )) + )), }, Example { description: "Find and highlight text in specific columns", - example: - "[[col1 col2 col3]; [moe larry curly] [larry curly moe]] | find moe --columns [col1]", + example: "[[col1 col2 col3]; [moe larry curly] [larry curly moe]] | find moe --columns [col1]", result: Some(Value::list( vec![Value::test_record(record! { "col1" => Value::test_string( diff --git a/crates/nu-command/src/filters/first.rs b/crates/nu-command/src/filters/first.rs index a1f15c64ce..78706e4432 100644 --- a/crates/nu-command/src/filters/first.rs +++ b/crates/nu-command/src/filters/first.rs @@ -1,5 +1,5 @@ use nu_engine::command_prelude::*; -use nu_protocol::{shell_error::io::IoError, Signals}; +use nu_protocol::{Signals, shell_error::io::IoError}; use std::io::Read; #[derive(Clone)] diff --git a/crates/nu-command/src/filters/flatten.rs b/crates/nu-command/src/filters/flatten.rs index 982db17029..1d8b62b299 100644 --- a/crates/nu-command/src/filters/flatten.rs +++ b/crates/nu-command/src/filters/flatten.rs @@ -47,26 +47,25 @@ impl Command for Flatten { Example { description: "flatten a table", example: "[[N, u, s, h, e, l, l]] | flatten ", - result: Some(Value::test_list( - vec![ - Value::test_string("N"), - Value::test_string("u"), - Value::test_string("s"), - Value::test_string("h"), - Value::test_string("e"), - Value::test_string("l"), - Value::test_string("l")], - )) + result: Some(Value::test_list(vec![ + Value::test_string("N"), + Value::test_string("u"), + Value::test_string("s"), + Value::test_string("h"), + Value::test_string("e"), + Value::test_string("l"), + Value::test_string("l"), + ])), }, Example { description: "flatten a table, get the first item", example: "[[N, u, s, h, e, l, l]] | flatten | first", - result: None,//Some(Value::test_string("N")), + result: None, //Some(Value::test_string("N")), }, Example { description: "flatten a column having a nested table", example: "[[origin, people]; [Ecuador, ([[name, meal]; ['Andres', 'arepa']])]] | flatten --all | get meal", - result: None,//Some(Value::test_string("arepa")), + result: None, //Some(Value::test_string("arepa")), }, Example { description: "restrict the flattening by passing column names", @@ -109,7 +108,7 @@ impl Command for Flatten { ], Span::test_data(), )), - } + }, ] } } diff --git a/crates/nu-command/src/filters/get.rs b/crates/nu-command/src/filters/get.rs index d681849448..436435478a 100644 --- a/crates/nu-command/src/filters/get.rs +++ b/crates/nu-command/src/filters/get.rs @@ -1,7 +1,7 @@ use std::borrow::Cow; use nu_engine::command_prelude::*; -use nu_protocol::{ast::PathMember, Signals}; +use nu_protocol::{Signals, ast::PathMember}; #[derive(Clone)] pub struct Get; @@ -75,8 +75,7 @@ If multiple cell paths are given, this will produce a list of values."# result: Some(Value::test_string("A0")), }, Example { - description: - "Extract the name of the 3rd record in a list (same as `ls | $in.name.2`)", + description: "Extract the name of the 3rd record in a list (same as `ls | $in.name.2`)", example: "ls | get name.2", result: None, }, @@ -175,7 +174,7 @@ fn action( wrong_type: "nothing".into(), dst_span: span, src_span: val.span(), - }) + }); } _ => (), } diff --git a/crates/nu-command/src/filters/group_by.rs b/crates/nu-command/src/filters/group_by.rs index a8da1cedf3..7b9e5f85ef 100644 --- a/crates/nu-command/src/filters/group_by.rs +++ b/crates/nu-command/src/filters/group_by.rs @@ -1,6 +1,6 @@ use indexmap::IndexMap; -use nu_engine::{command_prelude::*, ClosureEval}; -use nu_protocol::{engine::Closure, FromValue, IntoValue}; +use nu_engine::{ClosureEval, command_prelude::*}; +use nu_protocol::{FromValue, IntoValue, engine::Closure}; #[derive(Clone)] pub struct GroupBy; @@ -167,7 +167,7 @@ impl Command for GroupBy { })], ), }), - })) + })), }, Example { description: "Group items by multiple columns' values", @@ -212,7 +212,7 @@ impl Command for GroupBy { }) ]), }), - ])) + ])), }, ] } diff --git a/crates/nu-command/src/filters/insert.rs b/crates/nu-command/src/filters/insert.rs index e2801bf6ee..d9a1b419a2 100644 --- a/crates/nu-command/src/filters/insert.rs +++ b/crates/nu-command/src/filters/insert.rs @@ -1,6 +1,6 @@ use std::borrow::Cow; -use nu_engine::{command_prelude::*, ClosureEval, ClosureEvalOnce}; +use nu_engine::{ClosureEval, ClosureEvalOnce, command_prelude::*}; use nu_protocol::ast::PathMember; #[derive(Clone)] diff --git a/crates/nu-command/src/filters/interleave.rs b/crates/nu-command/src/filters/interleave.rs index 4f2b457af3..f643c957c2 100644 --- a/crates/nu-command/src/filters/interleave.rs +++ b/crates/nu-command/src/filters/interleave.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEvalOnce}; +use nu_engine::{ClosureEvalOnce, command_prelude::*}; use nu_protocol::{engine::Closure, shell_error::io::IoError}; use std::{sync::mpsc, thread}; diff --git a/crates/nu-command/src/filters/items.rs b/crates/nu-command/src/filters/items.rs index a32f2808b8..ff27900e6e 100644 --- a/crates/nu-command/src/filters/items.rs +++ b/crates/nu-command/src/filters/items.rs @@ -1,5 +1,5 @@ use super::utils::chain_error_with_input; -use nu_engine::{command_prelude::*, ClosureEval}; +use nu_engine::{ClosureEval, command_prelude::*}; use nu_protocol::engine::Closure; #[derive(Clone)] @@ -95,8 +95,7 @@ impl Command for Items { fn examples(&self) -> Vec { vec![Example { - example: - "{ new: york, san: francisco } | items {|key, value| echo $'($key) ($value)' }", + example: "{ new: york, san: francisco } | items {|key, value| echo $'($key) ($value)' }", description: "Iterate over each key-value pair of a record", result: Some(Value::list( vec![ diff --git a/crates/nu-command/src/filters/merge/deep.rs b/crates/nu-command/src/filters/merge/deep.rs index 42d4cefd9d..43b30857d4 100644 --- a/crates/nu-command/src/filters/merge/deep.rs +++ b/crates/nu-command/src/filters/merge/deep.rs @@ -1,4 +1,4 @@ -use super::common::{do_merge, typecheck_merge, ListMerge, MergeStrategy}; +use super::common::{ListMerge, MergeStrategy, do_merge, typecheck_merge}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-command/src/filters/merge/merge_.rs b/crates/nu-command/src/filters/merge/merge_.rs index 5974f13d60..d4634a9aca 100644 --- a/crates/nu-command/src/filters/merge/merge_.rs +++ b/crates/nu-command/src/filters/merge/merge_.rs @@ -1,4 +1,4 @@ -use super::common::{do_merge, typecheck_merge, MergeStrategy}; +use super::common::{MergeStrategy, do_merge, typecheck_merge}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-command/src/filters/move_.rs b/crates/nu-command/src/filters/move_.rs index 11a165ab9c..2951d23178 100644 --- a/crates/nu-command/src/filters/move_.rs +++ b/crates/nu-command/src/filters/move_.rs @@ -51,50 +51,44 @@ impl Command for Move { Example { example: "[[name value index]; [foo a 1] [bar b 2] [baz c 3]] | move index --before name", description: "Move a column before the first column", - result: - Some(Value::test_list( - vec![ - Value::test_record(record! { - "index" => Value::test_int(1), - "name" => Value::test_string("foo"), - "value" => Value::test_string("a"), - }), - Value::test_record(record! { - "index" => Value::test_int(2), - "name" => Value::test_string("bar"), - "value" => Value::test_string("b"), - }), - Value::test_record(record! { - "index" => Value::test_int(3), - "name" => Value::test_string("baz"), - "value" => Value::test_string("c"), - }), - ], - )) + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "index" => Value::test_int(1), + "name" => Value::test_string("foo"), + "value" => Value::test_string("a"), + }), + Value::test_record(record! { + "index" => Value::test_int(2), + "name" => Value::test_string("bar"), + "value" => Value::test_string("b"), + }), + Value::test_record(record! { + "index" => Value::test_int(3), + "name" => Value::test_string("baz"), + "value" => Value::test_string("c"), + }), + ])), }, Example { example: "[[name value index]; [foo a 1] [bar b 2] [baz c 3]] | move value name --after index", description: "Move multiple columns after the last column and reorder them", - result: - Some(Value::test_list( - vec![ - Value::test_record(record! { - "index" => Value::test_int(1), - "value" => Value::test_string("a"), - "name" => Value::test_string("foo"), - }), - Value::test_record(record! { - "index" => Value::test_int(2), - "value" => Value::test_string("b"), - "name" => Value::test_string("bar"), - }), - Value::test_record(record! { - "index" => Value::test_int(3), - "value" => Value::test_string("c"), - "name" => Value::test_string("baz"), - }), - ], - )) + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "index" => Value::test_int(1), + "value" => Value::test_string("a"), + "name" => Value::test_string("foo"), + }), + Value::test_record(record! { + "index" => Value::test_int(2), + "value" => Value::test_string("b"), + "name" => Value::test_string("bar"), + }), + Value::test_record(record! { + "index" => Value::test_int(3), + "value" => Value::test_string("c"), + "name" => Value::test_string("baz"), + }), + ])), }, Example { example: "{ name: foo, value: a, index: 1 } | move name --before index", @@ -103,7 +97,7 @@ impl Command for Move { "value" => Value::test_string("a"), "name" => Value::test_string("foo"), "index" => Value::test_int(1), - })) + })), }, ] } @@ -140,7 +134,7 @@ impl Command for Move { span: Some(head), help: None, inner: vec![], - }) + }); } _ => { return Err(ShellError::GenericError { @@ -149,7 +143,7 @@ impl Command for Move { span: Some(head), help: None, inner: vec![], - }) + }); } }; diff --git a/crates/nu-command/src/filters/par_each.rs b/crates/nu-command/src/filters/par_each.rs index 4e4d526657..cb1f13cc62 100644 --- a/crates/nu-command/src/filters/par_each.rs +++ b/crates/nu-command/src/filters/par_each.rs @@ -1,6 +1,6 @@ use super::utils::chain_error_with_input; -use nu_engine::{command_prelude::*, ClosureEvalOnce}; -use nu_protocol::{engine::Closure, Signals}; +use nu_engine::{ClosureEvalOnce, command_prelude::*}; +use nu_protocol::{Signals, engine::Closure}; use rayon::prelude::*; #[derive(Clone)] @@ -49,8 +49,7 @@ impl Command for ParEach { vec![ Example { example: "[1 2 3] | par-each {|e| $e * 2 }", - description: - "Multiplies each number. Note that the list will become arbitrarily disordered.", + description: "Multiplies each number. Note that the list will become arbitrarily disordered.", result: None, }, Example { @@ -82,8 +81,7 @@ impl Command for ParEach { }, Example { example: r#"[1 2 3] | enumerate | par-each { |e| if $e.item == 2 { $"found 2 at ($e.index)!"} }"#, - description: - "Iterate over each element, producing a list showing indexes of any 2s", + description: "Iterate over each element, producing a list showing indexes of any 2s", result: Some(Value::test_list(vec![Value::test_string("found 2 at 1!")])), }, ] diff --git a/crates/nu-command/src/filters/reduce.rs b/crates/nu-command/src/filters/reduce.rs index 9d17339d0e..6fc222c371 100644 --- a/crates/nu-command/src/filters/reduce.rs +++ b/crates/nu-command/src/filters/reduce.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEval}; +use nu_engine::{ClosureEval, command_prelude::*}; use nu_protocol::engine::Closure; #[derive(Clone)] @@ -52,8 +52,7 @@ impl Command for Reduce { result: Some(Value::test_int(-8)), }, Example { - example: - "[ 8 7 6 ] | enumerate | reduce --fold 0 {|it, acc| $acc + $it.item + $it.index }", + example: "[ 8 7 6 ] | enumerate | reduce --fold 0 {|it, acc| $acc + $it.item + $it.index }", description: "Sum values of a list, plus their indexes", result: Some(Value::test_int(24)), }, @@ -74,14 +73,12 @@ impl Command for Reduce { }, Example { example: r#"['foo.gz', 'bar.gz', 'baz.gz'] | enumerate | reduce --fold '' {|str all| $"($all)(if $str.index != 0 {'; '})($str.index + 1)-($str.item)" }"#, - description: - "Add ascending numbers to each of the filenames, and join with semicolons.", + description: "Add ascending numbers to each of the filenames, and join with semicolons.", result: Some(Value::test_string("1-foo.gz; 2-bar.gz; 3-baz.gz")), }, Example { example: r#"let s = "Str"; 0..2 | reduce --fold '' {|it, acc| $acc + $s}"#, - description: - "Concatenate a string with itself, using a range to determine the number of times.", + description: "Concatenate a string with itself, using a range to determine the number of times.", result: Some(Value::test_string("StrStrStr")), }, Example { @@ -92,7 +89,7 @@ impl Command for Reduce { "b" => Value::test_int(2), "c" => Value::test_int(3), ))), - } + }, ] } @@ -140,7 +137,7 @@ mod test { #[test] fn test_examples() { - use crate::{test_examples_with_commands, Merge}; + use crate::{Merge, test_examples_with_commands}; test_examples_with_commands(Reduce {}, &[&Merge]) } diff --git a/crates/nu-command/src/filters/reject.rs b/crates/nu-command/src/filters/reject.rs index b728ca828e..4d930a7ecb 100644 --- a/crates/nu-command/src/filters/reject.rs +++ b/crates/nu-command/src/filters/reject.rs @@ -109,21 +109,17 @@ impl Command for Reject { Example { description: "Reject a column in a table", example: "[[a, b]; [1, 2]] | reject a", - result: Some(Value::test_list( - vec![Value::test_record(record! { - "b" => Value::test_int(2), - })], - )), + result: Some(Value::test_list(vec![Value::test_record(record! { + "b" => Value::test_int(2), + })])), }, Example { description: "Reject a row in a table", example: "[[a, b]; [1, 2] [3, 4]] | reject 1", - result: Some(Value::test_list( - vec![Value::test_record(record! { - "a" => Value::test_int(1), - "b" => Value::test_int(2), - })], - )), + result: Some(Value::test_list(vec![Value::test_record(record! { + "a" => Value::test_int(1), + "b" => Value::test_int(2), + })])), }, Example { description: "Reject the specified field in a record", diff --git a/crates/nu-command/src/filters/rename.rs b/crates/nu-command/src/filters/rename.rs index 174d8d43ae..3511ebcf20 100644 --- a/crates/nu-command/src/filters/rename.rs +++ b/crates/nu-command/src/filters/rename.rs @@ -1,5 +1,5 @@ use indexmap::IndexMap; -use nu_engine::{command_prelude::*, ClosureEval}; +use nu_engine::{ClosureEval, command_prelude::*}; use nu_protocol::engine::Closure; #[derive(Clone)] @@ -146,24 +146,27 @@ fn rename( let span = item.span(); match item { Value::Record { val: record, .. } => { - let record = - if let Some(closure) = &mut closure { - record - .into_owned().into_iter() - .map(|(col, val)| { - let col = Value::string(col, span); - let data = closure.run_with_value(col)?; - let col = data.collect_string_strict(span)?.0; - Ok((col, val)) - }) - .collect::>() - } else { - match &specified_column { - Some(columns) => { - // record columns are unique so we can track the number - // of renamed columns to check if any were missed - let mut renamed = 0; - let record = record.into_owned().into_iter().map(|(col, val)| { + let record = if let Some(closure) = &mut closure { + record + .into_owned() + .into_iter() + .map(|(col, val)| { + let col = Value::string(col, span); + let data = closure.run_with_value(col)?; + let col = data.collect_string_strict(span)?.0; + Ok((col, val)) + }) + .collect::>() + } else { + match &specified_column { + Some(columns) => { + // record columns are unique so we can track the number + // of renamed columns to check if any were missed + let mut renamed = 0; + let record = record + .into_owned() + .into_iter() + .map(|(col, val)| { let col = if let Some(col) = columns.get(&col) { renamed += 1; col.clone() @@ -172,36 +175,40 @@ fn rename( }; (col, val) - }).collect::(); - - let missing_column = if renamed < columns.len() { - columns.iter().find_map(|(col, new_col)| { - (!record.contains(new_col)).then_some(col) - }) - } else { - None - }; - - if let Some(missing) = missing_column { - Err(ShellError::UnsupportedInput { - msg: format!("The column '{missing}' does not exist in the input"), - input: "value originated from here".into(), - msg_span: head, - input_span: span, - }) - } else { - Ok(record) - } - } - None => Ok(record - .into_owned().into_iter() - .enumerate() - .map(|(i, (col, val))| { - (columns.get(i).cloned().unwrap_or(col), val) }) - .collect()), + .collect::(); + + let missing_column = if renamed < columns.len() { + columns.iter().find_map(|(col, new_col)| { + (!record.contains(new_col)).then_some(col) + }) + } else { + None + }; + + if let Some(missing) = missing_column { + Err(ShellError::UnsupportedInput { + msg: format!( + "The column '{missing}' does not exist in the input" + ), + input: "value originated from here".into(), + msg_span: head, + input_span: span, + }) + } else { + Ok(record) + } } - }; + None => Ok(record + .into_owned() + .into_iter() + .enumerate() + .map(|(i, (col, val))| { + (columns.get(i).cloned().unwrap_or(col), val) + }) + .collect()), + } + }; match record { Ok(record) => Value::record(record, span), diff --git a/crates/nu-command/src/filters/select.rs b/crates/nu-command/src/filters/select.rs index dec54a4968..4d5e2b936c 100644 --- a/crates/nu-command/src/filters/select.rs +++ b/crates/nu-command/src/filters/select.rs @@ -1,5 +1,5 @@ use nu_engine::command_prelude::*; -use nu_protocol::{ast::PathMember, PipelineIterator}; +use nu_protocol::{PipelineIterator, ast::PathMember}; use std::collections::BTreeSet; #[derive(Clone)] @@ -116,11 +116,9 @@ produce a table, a list will produce a list, and a record will produce a record. Example { description: "Select a column in a table", example: "[{a: a b: b}] | select a", - result: Some(Value::test_list( - vec![Value::test_record(record! { - "a" => Value::test_string("a") - })], - )), + result: Some(Value::test_list(vec![Value::test_record(record! { + "a" => Value::test_string("a") + })])), }, Example { description: "Select a field in a record", @@ -151,7 +149,7 @@ produce a table, a list will produce a list, and a record will produce a record. "name" => Value::test_string("Cargo.lock"), "type" => Value::test_string("toml") }), - ])) + ])), }, Example { description: "Select multiple columns by spreading a list", @@ -165,7 +163,7 @@ produce a table, a list will produce a list, and a record will produce a record. "name" => Value::test_string("Cargo.lock"), "type" => Value::test_string("toml") }), - ])) + ])), }, ] } diff --git a/crates/nu-command/src/filters/skip/skip_.rs b/crates/nu-command/src/filters/skip/skip_.rs index d4adca1455..383dd3f2df 100644 --- a/crates/nu-command/src/filters/skip/skip_.rs +++ b/crates/nu-command/src/filters/skip/skip_.rs @@ -83,7 +83,7 @@ impl Command for Skip { return Err(ShellError::TypeMismatch { err_message: "expected int".into(), span, - }) + }); } } } diff --git a/crates/nu-command/src/filters/skip/skip_until.rs b/crates/nu-command/src/filters/skip/skip_until.rs index 6f9ada280c..ca365d8a16 100644 --- a/crates/nu-command/src/filters/skip/skip_until.rs +++ b/crates/nu-command/src/filters/skip/skip_until.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEval}; +use nu_engine::{ClosureEval, command_prelude::*}; use nu_protocol::engine::Closure; #[derive(Clone)] diff --git a/crates/nu-command/src/filters/skip/skip_while.rs b/crates/nu-command/src/filters/skip/skip_while.rs index 494cf91558..ac1e7af7b6 100644 --- a/crates/nu-command/src/filters/skip/skip_while.rs +++ b/crates/nu-command/src/filters/skip/skip_while.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEval}; +use nu_engine::{ClosureEval, command_prelude::*}; use nu_protocol::engine::Closure; #[derive(Clone)] diff --git a/crates/nu-command/src/filters/sort.rs b/crates/nu-command/src/filters/sort.rs index 7eb37d5837..fb3547aacb 100644 --- a/crates/nu-command/src/filters/sort.rs +++ b/crates/nu-command/src/filters/sort.rs @@ -182,7 +182,7 @@ impl Command for Sort { Value::Nothing { .. } => { return Err(ShellError::PipelineEmpty { dst_span: value.span(), - }) + }); } ref other => { return Err(ShellError::OnlySupportsThisInputType { @@ -190,7 +190,7 @@ impl Command for Sort { wrong_type: other.get_type().to_string(), dst_span: call.head, src_span: value.span(), - }) + }); } }; Ok(sorted.into_pipeline_data_with_metadata(metadata)) diff --git a/crates/nu-command/src/filters/sort_by.rs b/crates/nu-command/src/filters/sort_by.rs index 357d3be13d..2821521271 100644 --- a/crates/nu-command/src/filters/sort_by.rs +++ b/crates/nu-command/src/filters/sort_by.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEval}; +use nu_engine::{ClosureEval, command_prelude::*}; use crate::Comparator; @@ -88,15 +88,15 @@ impl Command for SortBy { example: "[[name info]; [Cairo {founded: 969}] [Kyoto {founded: 794}]] | sort-by info.founded", result: Some(Value::test_list(vec![ Value::test_record(record! { - "name" => Value::test_string("Kyoto"), - "info" => Value::test_record( - record! { "founded" => Value::test_int(794) }, - )}), + "name" => Value::test_string("Kyoto"), + "info" => Value::test_record( + record! { "founded" => Value::test_int(794) }, + )}), Value::test_record(record! { - "name" => Value::test_string("Cairo"), - "info" => Value::test_record( - record! { "founded" => Value::test_int(969) }, - )}) + "name" => Value::test_string("Cairo"), + "info" => Value::test_record( + record! { "founded" => Value::test_int(969) }, + )}), ])), }, Example { @@ -104,8 +104,8 @@ impl Command for SortBy { example: "[[2 50] [10 1]] | sort-by { last }", result: Some(Value::test_list(vec![ Value::test_list(vec![Value::test_int(10), Value::test_int(1)]), - Value::test_list(vec![Value::test_int(2), Value::test_int(50)]) - ])) + Value::test_list(vec![Value::test_int(2), Value::test_int(50)]), + ])), }, Example { description: "Sort in a custom order", @@ -116,8 +116,8 @@ impl Command for SortBy { Value::test_int(4), Value::test_int(7), Value::test_int(8), - ])) - } + ])), + }, ] } @@ -177,7 +177,7 @@ impl Command for SortBy { #[cfg(test)] mod test { - use crate::{test_examples_with_commands, Last}; + use crate::{Last, test_examples_with_commands}; use super::*; diff --git a/crates/nu-command/src/filters/take/take_until.rs b/crates/nu-command/src/filters/take/take_until.rs index 4e8f38a3d2..f2b8fce5b7 100644 --- a/crates/nu-command/src/filters/take/take_until.rs +++ b/crates/nu-command/src/filters/take/take_until.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEval}; +use nu_engine::{ClosureEval, command_prelude::*}; use nu_protocol::engine::Closure; #[derive(Clone)] diff --git a/crates/nu-command/src/filters/take/take_while.rs b/crates/nu-command/src/filters/take/take_while.rs index c9e218f543..8c46493a6e 100644 --- a/crates/nu-command/src/filters/take/take_while.rs +++ b/crates/nu-command/src/filters/take/take_while.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEval}; +use nu_engine::{ClosureEval, command_prelude::*}; use nu_protocol::engine::Closure; #[derive(Clone)] diff --git a/crates/nu-command/src/filters/tee.rs b/crates/nu-command/src/filters/tee.rs index d2f0ba5bec..8d7e29ed95 100644 --- a/crates/nu-command/src/filters/tee.rs +++ b/crates/nu-command/src/filters/tee.rs @@ -2,14 +2,14 @@ use nu_engine::{command_prelude::*, get_eval_block_with_early_return}; #[cfg(feature = "os")] use nu_protocol::process::ChildPipe; use nu_protocol::{ - byte_stream::copy_with_signals, engine::Closure, report_shell_error, shell_error::io::IoError, ByteStream, ByteStreamSource, OutDest, PipelineMetadata, Signals, + byte_stream::copy_with_signals, engine::Closure, report_shell_error, shell_error::io::IoError, }; use std::{ io::{self, Read, Write}, sync::{ - mpsc::{self, Sender}, Arc, + mpsc::{self, Sender}, }, thread::{self, JoinHandle}, }; @@ -55,8 +55,7 @@ use it in your pipeline."# result: None, }, Example { - example: - "nu -c 'print -e error; print ok' | tee --stderr { save error.log } | complete", + example: "nu -c 'print -e error; print ok' | tee --stderr { save error.log } | complete", description: "Save error messages from an external command to a file without \ redirecting them", result: None, @@ -70,7 +69,7 @@ use it in your pipeline."# example: "10000 | tee { 1..$in | print } | $in * 5", description: "Do something with a value on another thread, while also passing through the value", result: Some(Value::test_int(50000)), - } + }, ] } @@ -555,8 +554,8 @@ fn tee_forwards_errors_back_immediately() { #[test] fn tee_waits_for_the_other_thread() { use std::sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }; use std::time::Duration; let waited = Arc::new(AtomicBool::new(false)); diff --git a/crates/nu-command/src/filters/transpose.rs b/crates/nu-command/src/filters/transpose.rs index a85e95863e..be9c5c51c8 100644 --- a/crates/nu-command/src/filters/transpose.rs +++ b/crates/nu-command/src/filters/transpose.rs @@ -106,8 +106,7 @@ impl Command for Transpose { ])), }, Example { - description: - "Transposes the table without column names and specify a new column name", + description: "Transposes the table without column names and specify a new column name", example: "[[c1 c2]; [1 2]] | transpose --ignore-titles val", result: Some(Value::test_list(vec![ Value::test_record(record! { @@ -180,7 +179,7 @@ pub fn transpose( for value in input.iter() { match value { Value::Error { .. } => { - return Ok(value.clone().into_pipeline_data_with_metadata(metadata)) + return Ok(value.clone().into_pipeline_data_with_metadata(metadata)); } Value::Record { .. } => {} // go on, this is what we're looking for _ => { @@ -189,7 +188,7 @@ pub fn transpose( wrong_type: "list".into(), dst_span: call.head, src_span: value.span(), - }) + }); } } } diff --git a/crates/nu-command/src/filters/uniq.rs b/crates/nu-command/src/filters/uniq.rs index 179353ed1f..b8c7a3c933 100644 --- a/crates/nu-command/src/filters/uniq.rs +++ b/crates/nu-command/src/filters/uniq.rs @@ -2,7 +2,7 @@ use itertools::Itertools; use nu_engine::command_prelude::*; use nu_protocol::PipelineMetadata; use nu_utils::IgnoreCaseExt; -use std::collections::{hash_map::IntoIter, HashMap}; +use std::collections::{HashMap, hash_map::IntoIter}; #[derive(Clone)] pub struct Uniq; @@ -84,41 +84,34 @@ impl Command for Uniq { Example { description: "Return the input values that occur more than once", example: "[1 2 2] | uniq -d", - result: Some(Value::list( - vec![Value::test_int(2)], - Span::test_data(), - )), + result: Some(Value::list(vec![Value::test_int(2)], Span::test_data())), }, Example { description: "Return the input values that occur once only", example: "[1 2 2] | uniq --unique", - result: Some(Value::list( - vec![Value::test_int(1)], - Span::test_data(), - )), + result: Some(Value::list(vec![Value::test_int(1)], Span::test_data())), }, Example { description: "Ignore differences in case when comparing input values", example: "['hello' 'goodbye' 'Hello'] | uniq --ignore-case", - result: Some(Value::test_list( - vec![Value::test_string("hello"), Value::test_string("goodbye")], - )), + result: Some(Value::test_list(vec![ + Value::test_string("hello"), + Value::test_string("goodbye"), + ])), }, Example { description: "Return a table containing the distinct input values together with their counts", example: "[1 2 2] | uniq --count", - result: Some(Value::test_list( - vec![ - Value::test_record(record! { - "value" => Value::test_int(1), - "count" => Value::test_int(1), - }), - Value::test_record(record! { - "value" => Value::test_int(2), - "count" => Value::test_int(2), - }), - ], - )), + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "value" => Value::test_int(1), + "count" => Value::test_int(1), + }), + Value::test_record(record! { + "value" => Value::test_int(2), + "count" => Value::test_int(2), + }), + ])), }, ] } diff --git a/crates/nu-command/src/filters/update.rs b/crates/nu-command/src/filters/update.rs index 3fe63ce676..422a99bca4 100644 --- a/crates/nu-command/src/filters/update.rs +++ b/crates/nu-command/src/filters/update.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEval, ClosureEvalOnce}; +use nu_engine::{ClosureEval, ClosureEvalOnce, command_prelude::*}; use nu_protocol::ast::PathMember; #[derive(Clone)] @@ -67,36 +67,36 @@ When updating a specific index, the closure will instead be run once. The first Example { description: "Use a closure to alter each value in the 'authors' column to a single string", example: "[[project, authors]; ['nu', ['Andrés', 'JT', 'Yehuda']]] | update authors {|row| $row.authors | str join ',' }", - result: Some(Value::test_list( - vec![Value::test_record(record! { - "project" => Value::test_string("nu"), - "authors" => Value::test_string("Andrés,JT,Yehuda"), - })], - )), + result: Some(Value::test_list(vec![Value::test_record(record! { + "project" => Value::test_string("nu"), + "authors" => Value::test_string("Andrés,JT,Yehuda"), + })])), }, Example { description: "Implicitly use the `$in` value in a closure to update 'authors'", example: "[[project, authors]; ['nu', ['Andrés', 'JT', 'Yehuda']]] | update authors { str join ',' }", - result: Some(Value::test_list( - vec![Value::test_record(record! { - "project" => Value::test_string("nu"), - "authors" => Value::test_string("Andrés,JT,Yehuda"), - })], - )), + result: Some(Value::test_list(vec![Value::test_record(record! { + "project" => Value::test_string("nu"), + "authors" => Value::test_string("Andrés,JT,Yehuda"), + })])), }, Example { description: "Update a value at an index in a list", example: "[1 2 3] | update 1 4", - result: Some(Value::test_list( - vec![Value::test_int(1), Value::test_int(4), Value::test_int(3)] - )), + result: Some(Value::test_list(vec![ + Value::test_int(1), + Value::test_int(4), + Value::test_int(3), + ])), }, Example { description: "Use a closure to compute a new value at an index", example: "[1 2 3] | update 1 {|i| $i + 2 }", - result: Some(Value::test_list( - vec![Value::test_int(1), Value::test_int(4), Value::test_int(3)] - )), + result: Some(Value::test_list(vec![ + Value::test_int(1), + Value::test_int(4), + Value::test_int(3), + ])), }, ] } diff --git a/crates/nu-command/src/filters/upsert.rs b/crates/nu-command/src/filters/upsert.rs index 750263f402..1e56053979 100644 --- a/crates/nu-command/src/filters/upsert.rs +++ b/crates/nu-command/src/filters/upsert.rs @@ -1,6 +1,6 @@ use std::borrow::Cow; -use nu_engine::{command_prelude::*, ClosureEval, ClosureEvalOnce}; +use nu_engine::{ClosureEval, ClosureEvalOnce, command_prelude::*}; use nu_protocol::ast::PathMember; #[derive(Clone)] diff --git a/crates/nu-command/src/filters/utils.rs b/crates/nu-command/src/filters/utils.rs index 4c67667e8e..6230bc2ab2 100644 --- a/crates/nu-command/src/filters/utils.rs +++ b/crates/nu-command/src/filters/utils.rs @@ -1,7 +1,7 @@ use nu_engine::{CallExt, ClosureEval}; use nu_protocol::{ - engine::{Call, Closure, EngineState, Stack}, IntoPipelineData, PipelineData, ShellError, Span, Value, + engine::{Call, Closure, EngineState, Stack}, }; pub fn chain_error_with_input( diff --git a/crates/nu-command/src/filters/values.rs b/crates/nu-command/src/filters/values.rs index 5039938055..f4a321ae94 100644 --- a/crates/nu-command/src/filters/values.rs +++ b/crates/nu-command/src/filters/values.rs @@ -121,7 +121,7 @@ pub fn get_values<'a>( wrong_type: item.get_type().to_string(), dst_span: head, src_span: input_span, - }) + }); } } } diff --git a/crates/nu-command/src/filters/where_.rs b/crates/nu-command/src/filters/where_.rs index cf40639172..7859448231 100644 --- a/crates/nu-command/src/filters/where_.rs +++ b/crates/nu-command/src/filters/where_.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEval}; +use nu_engine::{ClosureEval, command_prelude::*}; use nu_protocol::engine::{Closure, CommandType}; #[derive(Clone)] @@ -78,18 +78,14 @@ not supported."# Example { description: "Filter rows of a table according to a condition", example: "[{a: 1} {a: 2}] | where a > 1", - result: Some(Value::test_list( - vec![Value::test_record(record! { - "a" => Value::test_int(2), - })], - )), + result: Some(Value::test_list(vec![Value::test_record(record! { + "a" => Value::test_int(2), + })])), }, Example { description: "Filter items of a list according to a condition", example: "[1 2] | where {|x| $x > 1}", - result: Some(Value::test_list( - vec![Value::test_int(2)], - )), + result: Some(Value::test_list(vec![Value::test_int(2)])), }, Example { description: "List all files in the current directory with sizes greater than 2kb", @@ -125,9 +121,7 @@ not supported."# description: "same as above but with regex only", example: "ls | where name =~ '(?i)readme'", result: None, - } - - + }, ] } } diff --git a/crates/nu-command/src/filters/zip.rs b/crates/nu-command/src/filters/zip.rs index 14e3d57ddd..d7315fb002 100644 --- a/crates/nu-command/src/filters/zip.rs +++ b/crates/nu-command/src/filters/zip.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEvalOnce}; +use nu_engine::{ClosureEvalOnce, command_prelude::*}; #[derive(Clone)] pub struct Zip; diff --git a/crates/nu-command/src/formats/from/csv.rs b/crates/nu-command/src/formats/from/csv.rs index 8ec9ac49d3..d1cb497f83 100644 --- a/crates/nu-command/src/formats/from/csv.rs +++ b/crates/nu-command/src/formats/from/csv.rs @@ -1,4 +1,4 @@ -use super::delimited::{from_delimited_data, trim_from_str, DelimitedReaderConfig}; +use super::delimited::{DelimitedReaderConfig, from_delimited_data, trim_from_str}; use nu_engine::command_prelude::*; #[derive(Clone)] @@ -77,32 +77,28 @@ impl Command for FromCsv { Example { description: "Convert comma-separated data to a table", example: "\"ColA,ColB\n1,2\" | from csv", - result: Some(Value::test_list ( - vec![Value::test_record(record! { - "ColA" => Value::test_int(1), - "ColB" => Value::test_int(2), - })], - )) + result: Some(Value::test_list(vec![Value::test_record(record! { + "ColA" => Value::test_int(1), + "ColB" => Value::test_int(2), + })])), }, Example { description: "Convert comma-separated data to a table, allowing variable number of columns per row", example: "\"ColA,ColB\n1,2\n3,4,5\n6\" | from csv --flexible", - result: Some(Value::test_list ( - vec![ - Value::test_record(record! { - "ColA" => Value::test_int(1), - "ColB" => Value::test_int(2), - }), - Value::test_record(record! { - "ColA" => Value::test_int(3), - "ColB" => Value::test_int(4), - "column2" => Value::test_int(5), - }), - Value::test_record(record! { - "ColA" => Value::test_int(6), - }), - ], - )) + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "ColA" => Value::test_int(1), + "ColB" => Value::test_int(2), + }), + Value::test_record(record! { + "ColA" => Value::test_int(3), + "ColB" => Value::test_int(4), + "column2" => Value::test_int(5), + }), + Value::test_record(record! { + "ColA" => Value::test_int(6), + }), + ])), }, Example { description: "Convert comma-separated data to a table, ignoring headers", diff --git a/crates/nu-command/src/formats/from/json.rs b/crates/nu-command/src/formats/from/json.rs index 81a8175cca..ba3995c38e 100644 --- a/crates/nu-command/src/formats/from/json.rs +++ b/crates/nu-command/src/formats/from/json.rs @@ -1,7 +1,7 @@ use std::io::{BufRead, Cursor}; use nu_engine::command_prelude::*; -use nu_protocol::{shell_error::io::IoError, ListStream, Signals}; +use nu_protocol::{ListStream, Signals, shell_error::io::IoError}; #[derive(Clone)] pub struct FromJson; diff --git a/crates/nu-command/src/formats/from/msgpackz.rs b/crates/nu-command/src/formats/from/msgpackz.rs index 4f31f74ec6..92459815a6 100644 --- a/crates/nu-command/src/formats/from/msgpackz.rs +++ b/crates/nu-command/src/formats/from/msgpackz.rs @@ -2,7 +2,7 @@ use std::io::Cursor; use nu_engine::command_prelude::*; -use super::msgpack::{read_msgpack, Opts}; +use super::msgpack::{Opts, read_msgpack}; const BUFFER_SIZE: usize = 65536; diff --git a/crates/nu-command/src/formats/from/ods.rs b/crates/nu-command/src/formats/from/ods.rs index f1f4252f1e..a6308ac4d9 100644 --- a/crates/nu-command/src/formats/from/ods.rs +++ b/crates/nu-command/src/formats/from/ods.rs @@ -100,7 +100,7 @@ fn collect_binary(input: PipelineData, span: Span) -> Result, ShellError input: "value originates from here".into(), msg_span: span, input_span: x.span(), - }) + }); } None => break, } diff --git a/crates/nu-command/src/formats/from/ssv.rs b/crates/nu-command/src/formats/from/ssv.rs index 48fb0515cf..fb2d55c19e 100644 --- a/crates/nu-command/src/formats/from/ssv.rs +++ b/crates/nu-command/src/formats/from/ssv.rs @@ -34,35 +34,32 @@ impl Command for FromSsv { } fn examples(&self) -> Vec { - vec![Example { - example: r#"'FOO BAR + vec![ + Example { + example: r#"'FOO BAR 1 2' | from ssv"#, - description: "Converts ssv formatted string to table", - result: Some(Value::test_list( - vec![Value::test_record(record! { + description: "Converts ssv formatted string to table", + result: Some(Value::test_list(vec![Value::test_record(record! { "FOO" => Value::test_string("1"), "BAR" => Value::test_string("2"), - })], - )), - }, Example { - example: r#"'FOO BAR + })])), + }, + Example { + example: r#"'FOO BAR 1 2' | from ssv --noheaders"#, - description: "Converts ssv formatted string to table but not treating the first row as column names", - result: Some( - Value::test_list( - vec![ - Value::test_record(record! { - "column0" => Value::test_string("FOO"), - "column1" => Value::test_string("BAR"), - }), - Value::test_record(record! { - "column0" => Value::test_string("1"), - "column1" => Value::test_string("2"), - }), - ], - ) - ), - }] + description: "Converts ssv formatted string to table but not treating the first row as column names", + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "column0" => Value::test_string("FOO"), + "column1" => Value::test_string("BAR"), + }), + Value::test_record(record! { + "column0" => Value::test_string("1"), + "column1" => Value::test_string("2"), + }), + ])), + }, + ] } fn run( @@ -408,9 +405,11 @@ mod tests { let trimmed = |s: &str| s.trim() == s; let result = string_to_table(input, false, true, 2); - assert!(result - .iter() - .all(|row| row.iter().all(|(a, b)| trimmed(a) && trimmed(b)))); + assert!( + result + .iter() + .all(|row| row.iter().all(|(a, b)| trimmed(a) && trimmed(b))) + ); } #[test] diff --git a/crates/nu-command/src/formats/from/tsv.rs b/crates/nu-command/src/formats/from/tsv.rs index 39fae9c010..3354a790a1 100644 --- a/crates/nu-command/src/formats/from/tsv.rs +++ b/crates/nu-command/src/formats/from/tsv.rs @@ -1,4 +1,4 @@ -use super::delimited::{from_delimited_data, trim_from_str, DelimitedReaderConfig}; +use super::delimited::{DelimitedReaderConfig, from_delimited_data, trim_from_str}; use nu_engine::command_prelude::*; #[derive(Clone)] @@ -69,27 +69,23 @@ impl Command for FromTsv { Example { description: "Convert tab-separated data to a table", example: "\"ColA\tColB\n1\t2\" | from tsv", - result: Some(Value::test_list ( - vec![Value::test_record(record! { - "ColA" => Value::test_int(1), - "ColB" => Value::test_int(2), - })], - )) + result: Some(Value::test_list(vec![Value::test_record(record! { + "ColA" => Value::test_int(1), + "ColB" => Value::test_int(2), + })])), }, Example { description: "Convert comma-separated data to a table, allowing variable number of columns per row and ignoring headers", example: "\"value 1\nvalue 2\tdescription 2\" | from tsv --flexible --noheaders", - result: Some(Value::test_list ( - vec![ - Value::test_record(record! { - "column0" => Value::test_string("value 1"), - }), - Value::test_record(record! { - "column0" => Value::test_string("value 2"), - "column1" => Value::test_string("description 2"), - }), - ], - )) + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "column0" => Value::test_string("value 1"), + }), + Value::test_record(record! { + "column0" => Value::test_string("value 2"), + "column1" => Value::test_string("description 2"), + }), + ])), }, Example { description: "Create a tsv file with header columns and open it", diff --git a/crates/nu-command/src/formats/from/xlsx.rs b/crates/nu-command/src/formats/from/xlsx.rs index bc486d1f18..ba4451792c 100644 --- a/crates/nu-command/src/formats/from/xlsx.rs +++ b/crates/nu-command/src/formats/from/xlsx.rs @@ -100,7 +100,7 @@ fn collect_binary(input: PipelineData, span: Span) -> Result, ShellError input: "value originates from here".into(), msg_span: span, input_span: x.span(), - }) + }); } None => break, } diff --git a/crates/nu-command/src/formats/from/xml.rs b/crates/nu-command/src/formats/from/xml.rs index 53c00ea0e0..8ad2887f4a 100644 --- a/crates/nu-command/src/formats/from/xml.rs +++ b/crates/nu-command/src/formats/from/xml.rs @@ -230,34 +230,42 @@ fn process_xml_parse_error(source: String, err: roxmltree::Error, span: Span) -> match err { roxmltree::Error::InvalidXmlPrefixUri(pos) => make_xml_error_spanned( "The `xmlns:xml` attribute must have an URI.", - source, pos, + source, + pos, ), roxmltree::Error::UnexpectedXmlUri(pos) => make_xml_error_spanned( "Only the xmlns:xml attribute can have the http://www.w3.org/XML/1998/namespace URI.", - source, pos, + source, + pos, ), roxmltree::Error::UnexpectedXmlnsUri(pos) => make_xml_error_spanned( "The http://www.w3.org/2000/xmlns/ URI must not be declared.", - source, pos, + source, + pos, ), roxmltree::Error::InvalidElementNamePrefix(pos) => { make_xml_error_spanned("xmlns can't be used as an element prefix.", source, pos) } - roxmltree::Error::DuplicatedNamespace(namespace, pos) => { - make_xml_error_spanned(format!("Namespace {namespace} was already defined on this element."), source, pos) - } + roxmltree::Error::DuplicatedNamespace(namespace, pos) => make_xml_error_spanned( + format!("Namespace {namespace} was already defined on this element."), + source, + pos, + ), roxmltree::Error::UnknownNamespace(prefix, pos) => { make_xml_error_spanned(format!("Unknown prefix {}", prefix), source, pos) } - roxmltree::Error::UnexpectedCloseTag(expected, actual, pos) => { - make_xml_error_spanned(format!("Unexpected close tag {actual}, expected {expected}"), source, pos) - } + roxmltree::Error::UnexpectedCloseTag(expected, actual, pos) => make_xml_error_spanned( + format!("Unexpected close tag {actual}, expected {expected}"), + source, + pos, + ), roxmltree::Error::UnexpectedEntityCloseTag(pos) => { make_xml_error_spanned("Entity value starts with a close tag.", source, pos) } roxmltree::Error::UnknownEntityReference(entity, pos) => make_xml_error_spanned( format!("Reference to unknown entity {entity} (was not defined in the DTD)"), - source, pos, + source, + pos, ), roxmltree::Error::MalformedEntityReference(pos) => { make_xml_error_spanned("Malformed entity reference.", source, pos) @@ -268,9 +276,11 @@ fn process_xml_parse_error(source: String, err: roxmltree::Error, span: Span) -> roxmltree::Error::InvalidAttributeValue(pos) => { make_xml_error_spanned("Attribute value cannot have a < character.", source, pos) } - roxmltree::Error::DuplicatedAttribute(attribute, pos) => { - make_xml_error_spanned(format!("Element has a duplicated attribute: {attribute}"), source, pos) - } + roxmltree::Error::DuplicatedAttribute(attribute, pos) => make_xml_error_spanned( + format!("Element has a duplicated attribute: {attribute}"), + source, + pos, + ), roxmltree::Error::NoRootNode => { make_xml_error("The XML document must have at least one element.", span) } @@ -279,52 +289,54 @@ fn process_xml_parse_error(source: String, err: roxmltree::Error, span: Span) -> } roxmltree::Error::DtdDetected => make_xml_error( "XML document with DTD detected.\nDTDs are disabled by default to prevent denial-of-service attacks (use --allow-dtd to parse anyway)", - span + span, + ), + roxmltree::Error::NodesLimitReached => make_xml_error("Node limit was reached.", span), + roxmltree::Error::AttributesLimitReached => make_xml_error("Attribute limit reached", span), + roxmltree::Error::NamespacesLimitReached => make_xml_error("Namespace limit reached", span), + roxmltree::Error::UnexpectedDeclaration(pos) => make_xml_error_spanned( + "An XML document can have only one XML declaration and it must be at the start of the document.", + source, + pos, + ), + roxmltree::Error::InvalidName(pos) => make_xml_error_spanned("Invalid name.", source, pos), + roxmltree::Error::NonXmlChar(_, pos) => make_xml_error_spanned( + "Non-XML character found. Valid characters are: ", + source, + pos, + ), + roxmltree::Error::InvalidChar(expected, actual, pos) => make_xml_error_spanned( + format!( + "Unexpected character {}, expected {}", + actual as char, expected as char + ), + source, + pos, + ), + roxmltree::Error::InvalidChar2(expected, actual, pos) => make_xml_error_spanned( + format!( + "Unexpected character {}, expected {}", + actual as char, expected + ), + source, + pos, ), - roxmltree::Error::NodesLimitReached => { - make_xml_error("Node limit was reached.", span) - } - roxmltree::Error::AttributesLimitReached => { - make_xml_error("Attribute limit reached", span) - } - roxmltree::Error::NamespacesLimitReached => { - make_xml_error("Namespace limit reached", span) - } - roxmltree::Error::UnexpectedDeclaration(pos) => { - make_xml_error_spanned("An XML document can have only one XML declaration and it must be at the start of the document.", source, pos) - } - roxmltree::Error::InvalidName(pos) => { - make_xml_error_spanned("Invalid name.", source, pos) - } - roxmltree::Error::NonXmlChar(_, pos) => { - make_xml_error_spanned("Non-XML character found. Valid characters are: ", source, pos) - } - roxmltree::Error::InvalidChar(expected, actual, pos) => { - make_xml_error_spanned( - format!("Unexpected character {}, expected {}", actual as char, expected as char), - source, - pos - ) - } - roxmltree::Error::InvalidChar2(expected, actual, pos) => { - make_xml_error_spanned( - format!("Unexpected character {}, expected {}", actual as char, expected), - source, - pos - ) - } roxmltree::Error::InvalidString(_, pos) => { make_xml_error_spanned("Invalid/unexpected string in XML.", source, pos) } roxmltree::Error::InvalidExternalID(pos) => { make_xml_error_spanned("Invalid ExternalID in the DTD.", source, pos) } - roxmltree::Error::InvalidComment(pos) => { - make_xml_error_spanned("A comment cannot contain `--` or end with `-`.", source, pos) - } - roxmltree::Error::InvalidCharacterData(pos) => { - make_xml_error_spanned("Character Data node contains an invalid data. Currently, only `]]>` is not allowed.", source, pos) - } + roxmltree::Error::InvalidComment(pos) => make_xml_error_spanned( + "A comment cannot contain `--` or end with `-`.", + source, + pos, + ), + roxmltree::Error::InvalidCharacterData(pos) => make_xml_error_spanned( + "Character Data node contains an invalid data. Currently, only `]]>` is not allowed.", + source, + pos, + ), roxmltree::Error::UnknownToken(pos) => { make_xml_error_spanned("Unknown token in XML.", source, pos) } @@ -361,8 +373,8 @@ mod tests { use super::*; - use indexmap::indexmap; use indexmap::IndexMap; + use indexmap::indexmap; use nu_cmd_lang::eval_pipeline_without_terminal_expression; fn string(input: impl Into) -> Value { diff --git a/crates/nu-command/src/formats/to/delimited.rs b/crates/nu-command/src/formats/to/delimited.rs index 4054935098..b8303cb0a8 100644 --- a/crates/nu-command/src/formats/to/delimited.rs +++ b/crates/nu-command/src/formats/to/delimited.rs @@ -1,8 +1,8 @@ use csv::WriterBuilder; use nu_cmd_base::formats::to::delimited::merge_descriptors; use nu_protocol::{ - shell_error::io::IoError, ByteStream, ByteStreamType, Config, PipelineData, ShellError, - Signals, Span, Spanned, Value, + ByteStream, ByteStreamType, Config, PipelineData, ShellError, Signals, Span, Spanned, Value, + shell_error::io::IoError, }; use std::{iter, sync::Arc}; @@ -110,10 +110,10 @@ pub fn to_delimited_data( PipelineData::Value(Value::List { .. } | Value::Record { .. }, _) => (), PipelineData::Value(Value::Error { error, .. }, _) => return Err(*error), PipelineData::Value(other, _) => { - return Err(make_unsupported_input_error(other.get_type(), head, span)) + return Err(make_unsupported_input_error(other.get_type(), head, span)); } PipelineData::ByteStream(..) => { - return Err(make_unsupported_input_error("byte stream", head, span)) + return Err(make_unsupported_input_error("byte stream", head, span)); } PipelineData::ListStream(..) => (), PipelineData::Empty => (), diff --git a/crates/nu-command/src/formats/to/json.rs b/crates/nu-command/src/formats/to/json.rs index 55d5d80b7a..17918f63e7 100644 --- a/crates/nu-command/src/formats/to/json.rs +++ b/crates/nu-command/src/formats/to/json.rs @@ -1,5 +1,5 @@ use nu_engine::command_prelude::*; -use nu_protocol::{ast::PathMember, PipelineMetadata}; +use nu_protocol::{PipelineMetadata, ast::PathMember}; #[derive(Clone)] pub struct ToJson; @@ -90,20 +90,19 @@ impl Command for ToJson { fn examples(&self) -> Vec { vec![ Example { - description: - "Outputs a JSON string, with default indentation, representing the contents of this table", + description: "Outputs a JSON string, with default indentation, representing the contents of this table", example: "[a b c] | to json", result: Some(Value::test_string("[\n \"a\",\n \"b\",\n \"c\"\n]")), }, Example { - description: - "Outputs a JSON string, with 4-space indentation, representing the contents of this table", + description: "Outputs a JSON string, with 4-space indentation, representing the contents of this table", example: "[Joe Bob Sam] | to json --indent 4", - result: Some(Value::test_string("[\n \"Joe\",\n \"Bob\",\n \"Sam\"\n]")), + result: Some(Value::test_string( + "[\n \"Joe\",\n \"Bob\",\n \"Sam\"\n]", + )), }, Example { - description: - "Outputs an unformatted JSON string representing the contents of this table", + description: "Outputs an unformatted JSON string representing the contents of this table", example: "[1 2 3] | to json -r", result: Some(Value::test_string("[1,2,3]")), }, diff --git a/crates/nu-command/src/formats/to/md.rs b/crates/nu-command/src/formats/to/md.rs index def4060257..ed29f12964 100644 --- a/crates/nu-command/src/formats/to/md.rs +++ b/crates/nu-command/src/formats/to/md.rs @@ -355,7 +355,7 @@ mod tests { use super::*; use nu_cmd_lang::eval_pipeline_without_terminal_expression; - use nu_protocol::{record, Config, IntoPipelineData, Value}; + use nu_protocol::{Config, IntoPipelineData, Value, record}; fn one(string: &str) -> String { string diff --git a/crates/nu-command/src/formats/to/msgpack.rs b/crates/nu-command/src/formats/to/msgpack.rs index 3040d26c2a..7f072a87a3 100644 --- a/crates/nu-command/src/formats/to/msgpack.rs +++ b/crates/nu-command/src/formats/to/msgpack.rs @@ -5,7 +5,7 @@ use std::io; use byteorder::{BigEndian, WriteBytesExt}; use nu_engine::command_prelude::*; -use nu_protocol::{ast::PathMember, shell_error::io::IoError, Signals, Spanned}; +use nu_protocol::{Signals, Spanned, ast::PathMember, shell_error::io::IoError}; use rmp::encode as mp; /// Max recursion depth diff --git a/crates/nu-command/src/formats/to/nuon.rs b/crates/nu-command/src/formats/to/nuon.rs index a5e1464065..90fc14fe99 100644 --- a/crates/nu-command/src/formats/to/nuon.rs +++ b/crates/nu-command/src/formats/to/nuon.rs @@ -80,7 +80,7 @@ impl Command for ToNuon { Example { description: "Outputs a NUON string representing the contents of this list, compact by default", example: "[1 2 3] | to nuon", - result: Some(Value::test_string("[1, 2, 3]")) + result: Some(Value::test_string("[1, 2, 3]")), }, Example { description: "Outputs a NUON array of ints, with pretty indentation", @@ -90,18 +90,22 @@ impl Command for ToNuon { Example { description: "Overwrite any set option with --raw", example: "[1 2 3] | to nuon --indent 2 --raw", - result: Some(Value::test_string("[1,2,3]")) + result: Some(Value::test_string("[1,2,3]")), }, Example { description: "A more complex record with multiple data types", example: "{date: 2000-01-01, data: [1 [2 3] 4.56]} | to nuon --indent 2", - result: Some(Value::test_string("{\n date: 2000-01-01T00:00:00+00:00,\n data: [\n 1,\n [\n 2,\n 3\n ],\n 4.56\n ]\n}")) + result: Some(Value::test_string( + "{\n date: 2000-01-01T00:00:00+00:00,\n data: [\n 1,\n [\n 2,\n 3\n ],\n 4.56\n ]\n}", + )), }, Example { description: "A more complex record with --raw", example: "{date: 2000-01-01, data: [1 [2 3] 4.56]} | to nuon --raw", - result: Some(Value::test_string("{date:2000-01-01T00:00:00+00:00,data:[1,[2,3],4.56]}")) - } + result: Some(Value::test_string( + "{date:2000-01-01T00:00:00+00:00,data:[1,[2,3],4.56]}", + )), + }, ] } } diff --git a/crates/nu-command/src/formats/to/text.rs b/crates/nu-command/src/formats/to/text.rs index 393de80ac3..ad15377188 100644 --- a/crates/nu-command/src/formats/to/text.rs +++ b/crates/nu-command/src/formats/to/text.rs @@ -1,7 +1,7 @@ use chrono::Datelike; use chrono_humanize::HumanTime; use nu_engine::command_prelude::*; -use nu_protocol::{format_duration, shell_error::io::IoError, ByteStream, PipelineMetadata}; +use nu_protocol::{ByteStream, PipelineMetadata, format_duration, shell_error::io::IoError}; use std::io::Write; const LINE_ENDING: &str = if cfg!(target_os = "windows") { diff --git a/crates/nu-command/src/formats/to/toml.rs b/crates/nu-command/src/formats/to/toml.rs index 11630e4522..e3fb97240e 100644 --- a/crates/nu-command/src/formats/to/toml.rs +++ b/crates/nu-command/src/formats/to/toml.rs @@ -1,6 +1,6 @@ use chrono::{DateTime, Datelike, FixedOffset, Timelike}; use nu_engine::command_prelude::*; -use nu_protocol::{ast::PathMember, PipelineMetadata}; +use nu_protocol::{PipelineMetadata, ast::PathMember}; #[derive(Clone)] pub struct ToToml; diff --git a/crates/nu-command/src/formats/to/xml.rs b/crates/nu-command/src/formats/to/xml.rs index 4476f654c2..f64da04314 100644 --- a/crates/nu-command/src/formats/to/xml.rs +++ b/crates/nu-command/src/formats/to/xml.rs @@ -75,17 +75,13 @@ Additionally any field which is: empty record, empty list or null, can be omitte Example { description: "Produce less escaping sequences in resulting xml", example: r#"{tag: note attributes: {a: "'qwe'\\"} content: ["\"'"]} | to xml --partial-escape"#, - result: Some(Value::test_string( - r#""'"# - )) + result: Some(Value::test_string(r#""'"#)), }, Example { description: "Save space using self-closed tags", example: r#"{tag: root content: [[tag]; [a] [b] [c]]} | to xml --self-closed"#, - result: Some(Value::test_string( - r#""# - )) - } + result: Some(Value::test_string(r#""#)), + }, ] } @@ -169,7 +165,7 @@ impl Job { let mut iter = bytes.iter().enumerate(); let mut pos = 0; while let Some((new_pos, byte)) = - iter.find(|(_, &ch)| matches!(ch, b'<' | b'>' | b'&' | b'"')) + iter.find(|(_, ch)| matches!(ch, b'<' | b'>' | b'&' | b'"')) { escaped.extend_from_slice(&bytes[pos..new_pos]); match byte { @@ -210,14 +206,14 @@ impl Job { if let Value::Record { val: record, .. } = &entry { if let Some(bad_column) = Self::find_invalid_column(record) { return Err(ShellError::CantConvert { - to_type: "XML".into(), - from_type: "record".into(), - span: entry_span, - help: Some(format!( - "Invalid column \"{}\" in xml entry. Only \"{}\", \"{}\" and \"{}\" are permitted", - bad_column, COLUMN_TAG_NAME, COLUMN_ATTRS_NAME, COLUMN_CONTENT_NAME - )), - }); + to_type: "XML".into(), + from_type: "record".into(), + span: entry_span, + help: Some(format!( + "Invalid column \"{}\" in xml entry. Only \"{}\", \"{}\" and \"{}\" are permitted", + bad_column, COLUMN_TAG_NAME, COLUMN_ATTRS_NAME, COLUMN_CONTENT_NAME + )), + }); } // If key is not found it is assumed to be nothing. This way // user can write a tag like {tag: a content: [...]} instead diff --git a/crates/nu-command/src/generators/cal.rs b/crates/nu-command/src/generators/cal.rs index 30430955b1..3ba7283bd2 100644 --- a/crates/nu-command/src/generators/cal.rs +++ b/crates/nu-command/src/generators/cal.rs @@ -291,7 +291,7 @@ fn add_month_to_table( return Err(ShellError::UnknownOperator { op_token: "Issue parsing command, invalid command".to_string(), span: tag, - }) + }); } }, }; diff --git a/crates/nu-command/src/generators/generate.rs b/crates/nu-command/src/generators/generate.rs index 05a34dcbeb..f81f78acfd 100644 --- a/crates/nu-command/src/generators/generate.rs +++ b/crates/nu-command/src/generators/generate.rs @@ -1,4 +1,4 @@ -use nu_engine::{command_prelude::*, ClosureEval}; +use nu_engine::{ClosureEval, command_prelude::*}; use nu_protocol::engine::Closure; #[derive(Clone)] @@ -65,21 +65,17 @@ In this case, generation also stops when the input stream stops."# )), }, Example { - example: - "generate {|fib| {out: $fib.0, next: [$fib.1, ($fib.0 + $fib.1)]} } [0, 1]", + example: "generate {|fib| {out: $fib.0, next: [$fib.1, ($fib.0 + $fib.1)]} } [0, 1]", description: "Generate a continuous stream of Fibonacci numbers", result: None, }, Example { - example: - "generate {|fib=[0, 1]| {out: $fib.0, next: [$fib.1, ($fib.0 + $fib.1)]} }", - description: - "Generate a continuous stream of Fibonacci numbers, using default parameters", + example: "generate {|fib=[0, 1]| {out: $fib.0, next: [$fib.1, ($fib.0 + $fib.1)]} }", + description: "Generate a continuous stream of Fibonacci numbers, using default parameters", result: None, }, Example { - example: - "1..5 | generate {|e, sum=0| let sum = $e + $sum; {out: $sum, next: $sum} }", + example: "1..5 | generate {|e, sum=0| let sum = $e + $sum; {out: $sum, next: $sum} }", description: "Generate a running sum of the inputs", result: Some(Value::test_list(vec![ Value::test_int(1), diff --git a/crates/nu-command/src/generators/seq_date.rs b/crates/nu-command/src/generators/seq_date.rs index ae91b8ad0c..9772a2fcb4 100644 --- a/crates/nu-command/src/generators/seq_date.rs +++ b/crates/nu-command/src/generators/seq_date.rs @@ -75,15 +75,13 @@ impl Command for SeqDate { result: None, }, Example { - description: - "Return the previous 10 days, starting today, in the MM/DD/YYYY format", + description: "Return the previous 10 days, starting today, in the MM/DD/YYYY format", example: "seq date --days 10 -o '%m/%d/%Y' --reverse", result: None, }, Example { description: "Return the first 10 days in January, 2020", - example: - "seq date --begin-date '2020-01-01' --end-date '2020-01-10' --increment 1day", + example: "seq date --begin-date '2020-01-01' --end-date '2020-01-10' --increment 1day", result: Some(Value::list( vec![ Value::test_string("2020-01-01"), @@ -102,8 +100,7 @@ impl Command for SeqDate { }, Example { description: "Return the first 10 days in January, 2020 using --days flag", - example: - "seq date --begin-date '2020-01-01' --days 10 --increment 1day", + example: "seq date --begin-date '2020-01-01' --days 10 --increment 1day", result: Some(Value::list( vec![ Value::test_string("2020-01-01"), @@ -122,8 +119,7 @@ impl Command for SeqDate { }, Example { description: "Return the first five 5-minute periods starting January 1, 2020", - example: - "seq date --begin-date '2020-01-01' --periods 5 --increment 5min --output-format '%Y-%m-%d %H:%M:%S'", + example: "seq date --begin-date '2020-01-01' --periods 5 --increment 5min --output-format '%Y-%m-%d %H:%M:%S'", result: Some(Value::list( vec![ Value::test_string("2020-01-01 00:00:00"), @@ -137,8 +133,7 @@ impl Command for SeqDate { }, Example { description: "print every fifth day between January 1st 2020 and January 31st 2020", - example: - "seq date --begin-date '2020-01-01' --end-date '2020-01-31' --increment 5day", + example: "seq date --begin-date '2020-01-01' --end-date '2020-01-31' --increment 5day", result: Some(Value::list( vec![ Value::test_string("2020-01-01"), @@ -154,8 +149,7 @@ impl Command for SeqDate { }, Example { description: "increment defaults to days if no duration is supplied", - example: - "seq date --begin-date '2020-01-01' --end-date '2020-01-31' --increment 5", + example: "seq date --begin-date '2020-01-01' --end-date '2020-01-31' --increment 5", result: Some(Value::list( vec![ Value::test_string("2020-01-01"), @@ -171,8 +165,7 @@ impl Command for SeqDate { }, Example { description: "print every six hours starting January 1st, 2020 until January 3rd, 2020", - example: - "seq date --begin-date '2020-01-01' --end-date '2020-01-03' --increment 6hr --output-format '%Y-%m-%d %H:%M:%S'", + example: "seq date --begin-date '2020-01-01' --end-date '2020-01-03' --increment 6hr --output-format '%Y-%m-%d %H:%M:%S'", result: Some(Value::list( vec![ Value::test_string("2020-01-01 00:00:00"), @@ -357,7 +350,7 @@ pub fn run_seq_dates( span: Some(call_span), help: None, inner: vec![], - }) + }); } }, _ => today, @@ -373,7 +366,7 @@ pub fn run_seq_dates( span: Some(call_span), help: None, inner: vec![], - }) + }); } }, _ => today, diff --git a/crates/nu-command/src/hash/generic_digest.rs b/crates/nu-command/src/hash/generic_digest.rs index 9da805d2c3..8378ccccdd 100644 --- a/crates/nu-command/src/hash/generic_digest.rs +++ b/crates/nu-command/src/hash/generic_digest.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; use std::{io::Write, marker::PhantomData}; diff --git a/crates/nu-command/src/help/help_.rs b/crates/nu-command/src/help/help_.rs index 3cdd27a672..a1e0c81120 100644 --- a/crates/nu-command/src/help/help_.rs +++ b/crates/nu-command/src/help/help_.rs @@ -1,5 +1,5 @@ use crate::help::{help_aliases, help_commands, help_modules}; -use fancy_regex::{escape, Regex}; +use fancy_regex::{Regex, escape}; use nu_ansi_term::Style; use nu_engine::command_prelude::*; use nu_utils::IgnoreCaseExt; diff --git a/crates/nu-command/src/math/avg.rs b/crates/nu-command/src/math/avg.rs index 68e2de0a15..d68d98c340 100644 --- a/crates/nu-command/src/math/avg.rs +++ b/crates/nu-command/src/math/avg.rs @@ -1,5 +1,5 @@ use crate::math::{ - reducers::{reducer_for, Reduce}, + reducers::{Reduce, reducer_for}, utils::run_with_function, }; use nu_engine::command_prelude::*; diff --git a/crates/nu-command/src/math/max.rs b/crates/nu-command/src/math/max.rs index 1cbd5e555e..cdf10ced58 100644 --- a/crates/nu-command/src/math/max.rs +++ b/crates/nu-command/src/math/max.rs @@ -1,5 +1,5 @@ use crate::math::{ - reducers::{reducer_for, Reduce}, + reducers::{Reduce, reducer_for}, utils::run_with_function, }; use nu_engine::command_prelude::*; diff --git a/crates/nu-command/src/math/min.rs b/crates/nu-command/src/math/min.rs index 85d1de68f1..48f5317ddd 100644 --- a/crates/nu-command/src/math/min.rs +++ b/crates/nu-command/src/math/min.rs @@ -1,5 +1,5 @@ use crate::math::{ - reducers::{reducer_for, Reduce}, + reducers::{Reduce, reducer_for}, utils::run_with_function, }; use nu_engine::command_prelude::*; diff --git a/crates/nu-command/src/math/product.rs b/crates/nu-command/src/math/product.rs index c4560601aa..5d6363e8fb 100644 --- a/crates/nu-command/src/math/product.rs +++ b/crates/nu-command/src/math/product.rs @@ -1,5 +1,5 @@ use crate::math::{ - reducers::{reducer_for, Reduce}, + reducers::{Reduce, reducer_for}, utils::run_with_function, }; use nu_engine::command_prelude::*; diff --git a/crates/nu-command/src/math/reducers.rs b/crates/nu-command/src/math/reducers.rs index b076ca7567..d1d4a3cb1d 100644 --- a/crates/nu-command/src/math/reducers.rs +++ b/crates/nu-command/src/math/reducers.rs @@ -91,8 +91,11 @@ pub fn sum(data: Vec, span: Span, head: Span) -> Result return Err(*error.clone()), other => { return Err(ShellError::UnsupportedInput { - msg: format!("Attempted to compute the sum of a value '{}' that cannot be summed with a type of `{}`.", - other.coerce_string()?, other.get_type()), + msg: format!( + "Attempted to compute the sum of a value '{}' that cannot be summed with a type of `{}`.", + other.coerce_string()?, + other.get_type() + ), input: "value originates from here".into(), msg_span: head, input_span: other.span(), @@ -130,8 +133,11 @@ pub fn product(data: Vec, span: Span, head: Span) -> Result return Err(*error.clone()), other => { return Err(ShellError::UnsupportedInput { - msg: format!("Attempted to compute the product of a value '{}' that cannot be multiplied with a type of `{}`.", - other.coerce_string()?, other.get_type()), + msg: format!( + "Attempted to compute the product of a value '{}' that cannot be multiplied with a type of `{}`.", + other.coerce_string()?, + other.get_type() + ), input: "value originates from here".into(), msg_span: head, input_span: other.span(), diff --git a/crates/nu-command/src/math/sum.rs b/crates/nu-command/src/math/sum.rs index 8cae85c3a8..c518e1316e 100644 --- a/crates/nu-command/src/math/sum.rs +++ b/crates/nu-command/src/math/sum.rs @@ -1,5 +1,5 @@ use crate::math::{ - reducers::{reducer_for, Reduce}, + reducers::{Reduce, reducer_for}, utils::run_with_function, }; use nu_engine::command_prelude::*; diff --git a/crates/nu-command/src/math/utils.rs b/crates/nu-command/src/math/utils.rs index 9041f23ffa..da60bed9cf 100644 --- a/crates/nu-command/src/math/utils.rs +++ b/crates/nu-command/src/math/utils.rs @@ -1,7 +1,7 @@ use core::slice; use indexmap::IndexMap; use nu_protocol::{ - engine::Call, IntoPipelineData, PipelineData, Range, ShellError, Signals, Span, Value, + IntoPipelineData, PipelineData, Range, ShellError, Signals, Span, Value, engine::Call, }; pub fn run_with_function( diff --git a/crates/nu-command/src/math/variance.rs b/crates/nu-command/src/math/variance.rs index 92712872f5..9dde7e920d 100644 --- a/crates/nu-command/src/math/variance.rs +++ b/crates/nu-command/src/math/variance.rs @@ -116,8 +116,11 @@ fn sum_of_squares(values: &[Value], span: Span) -> Result { Value::Int { .. } | Value::Float { .. } => Ok(value), Value::Error { error, .. } => Err(*error.clone()), other => Err(ShellError::UnsupportedInput { - msg: format!("Attempted to compute the sum of squares of a non-int, non-float value '{}' with a type of `{}`.", - other.coerce_string()?, other.get_type()), + msg: format!( + "Attempted to compute the sum of squares of a non-int, non-float value '{}' with a type of `{}`.", + other.coerce_string()?, + other.get_type() + ), input: "value originates from here".into(), msg_span: span, input_span: value.span(), diff --git a/crates/nu-command/src/misc/source.rs b/crates/nu-command/src/misc/source.rs index d507345f6e..c098fee9b0 100644 --- a/crates/nu-command/src/misc/source.rs +++ b/crates/nu-command/src/misc/source.rs @@ -1,6 +1,6 @@ use nu_engine::{command_prelude::*, get_eval_block_with_early_return}; use nu_path::canonicalize_with; -use nu_protocol::{engine::CommandType, shell_error::io::IoError, BlockId}; +use nu_protocol::{BlockId, engine::CommandType, shell_error::io::IoError}; /// Source a file for environment variables. #[derive(Clone)] @@ -121,7 +121,7 @@ impl Command for Source { description: "Source can be used with const variables.", example: r#"const file = if $nu.is-interactive { "interactive.nu" } else { null }; source $file"#, result: None, - } + }, ] } } diff --git a/crates/nu-command/src/network/http/client.rs b/crates/nu-command/src/network/http/client.rs index c4fe4f9486..d5281812bd 100644 --- a/crates/nu-command/src/network/http/client.rs +++ b/crates/nu-command/src/network/http/client.rs @@ -1,12 +1,11 @@ use crate::formats::value_to_json_value; use base64::{ - alphabet, - engine::{general_purpose::PAD, GeneralPurpose}, - Engine, + Engine, alphabet, + engine::{GeneralPurpose, general_purpose::PAD}, }; use multipart_rs::MultipartWriter; use nu_engine::command_prelude::*; -use nu_protocol::{shell_error::io::IoError, ByteStream, LabeledError, Signals}; +use nu_protocol::{ByteStream, LabeledError, Signals, shell_error::io::IoError}; use serde_json::Value as JsonValue; use std::{ collections::HashMap, @@ -414,7 +413,7 @@ fn send_multipart_request( err_message: format!("Accepted types: [record]. Check: {HTTP_DOCS}"), span: body.span(), }, - )) + )); } }; send_cancellable_request(request_url, Box::new(request_fn), span, signals) @@ -671,7 +670,12 @@ fn handle_response_error(span: Span, requested_url: &str, response_err: Error) - span, }; match t.kind() { - ErrorKind::ConnectionFailed => ShellError::NetworkFailure { msg: format!("Cannot make request to {requested_url}, there was an error establishing a connection.",), span }, + ErrorKind::ConnectionFailed => ShellError::NetworkFailure { + msg: format!( + "Cannot make request to {requested_url}, there was an error establishing a connection.", + ), + span, + }, ErrorKind::Io => 'io: { let Some(source) = t.source() else { break 'io generic_network_failure(); @@ -683,7 +687,7 @@ fn handle_response_error(span: Span, requested_url: &str, response_err: Error) - ShellError::Io(IoError::new(io_error.kind(), span, None)) } - _ => generic_network_failure() + _ => generic_network_failure(), } } } diff --git a/crates/nu-command/src/network/http/delete.rs b/crates/nu-command/src/network/http/delete.rs index 97bd681608..f58045df9f 100644 --- a/crates/nu-command/src/network/http/delete.rs +++ b/crates/nu-command/src/network/http/delete.rs @@ -1,7 +1,7 @@ use crate::network::http::client::{ - check_response_redirection, http_client, http_parse_redirect_mode, http_parse_url, - request_add_authorization_header, request_add_custom_headers, request_handle_response, - request_set_timeout, send_request, HttpBody, RequestFlags, + HttpBody, RequestFlags, check_response_redirection, http_client, http_parse_redirect_mode, + http_parse_url, request_add_authorization_header, request_add_custom_headers, + request_handle_response, request_set_timeout, send_request, }; use nu_engine::command_prelude::*; @@ -133,8 +133,7 @@ impl Command for HttpDelete { }, Example { description: "http delete from example.com, with JSON body", - example: - "http delete --content-type application/json --data { field: value } https://www.example.com", + example: "http delete --content-type application/json --data { field: value } https://www.example.com", result: None, }, Example { diff --git a/crates/nu-command/src/network/http/get.rs b/crates/nu-command/src/network/http/get.rs index ddc04f1f9f..b8fc181f7e 100644 --- a/crates/nu-command/src/network/http/get.rs +++ b/crates/nu-command/src/network/http/get.rs @@ -1,7 +1,7 @@ use crate::network::http::client::{ - check_response_redirection, http_client, http_parse_redirect_mode, http_parse_url, - request_add_authorization_header, request_add_custom_headers, request_handle_response, - request_set_timeout, send_request, RequestFlags, + RequestFlags, check_response_redirection, http_client, http_parse_redirect_mode, + http_parse_url, request_add_authorization_header, request_add_custom_headers, + request_handle_response, request_set_timeout, send_request, }; use nu_engine::command_prelude::*; diff --git a/crates/nu-command/src/network/http/head.rs b/crates/nu-command/src/network/http/head.rs index be94529420..17993fd3fd 100644 --- a/crates/nu-command/src/network/http/head.rs +++ b/crates/nu-command/src/network/http/head.rs @@ -98,14 +98,12 @@ impl Command for HttpHead { }, Example { description: "Get headers from example.com, with custom header using a record", - example: - "http head --headers {my-header-key: my-header-value} https://www.example.com", + example: "http head --headers {my-header-key: my-header-value} https://www.example.com", result: None, }, Example { description: "Get headers from example.com, with custom header using a list", - example: - "http head --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com", + example: "http head --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com", result: None, }, ] diff --git a/crates/nu-command/src/network/http/options.rs b/crates/nu-command/src/network/http/options.rs index 396faee15a..ab68e54460 100644 --- a/crates/nu-command/src/network/http/options.rs +++ b/crates/nu-command/src/network/http/options.rs @@ -1,6 +1,6 @@ use crate::network::http::client::{ - http_client, http_parse_url, request_add_authorization_header, request_add_custom_headers, - request_handle_response, request_set_timeout, send_request, RedirectMode, RequestFlags, + RedirectMode, RequestFlags, http_client, http_parse_url, request_add_authorization_header, + request_add_custom_headers, request_handle_response, request_set_timeout, send_request, }; use nu_engine::command_prelude::*; diff --git a/crates/nu-command/src/network/http/patch.rs b/crates/nu-command/src/network/http/patch.rs index eb0064e522..2a2c573eb2 100644 --- a/crates/nu-command/src/network/http/patch.rs +++ b/crates/nu-command/src/network/http/patch.rs @@ -1,7 +1,7 @@ use crate::network::http::client::{ - check_response_redirection, http_client, http_parse_redirect_mode, http_parse_url, - request_add_authorization_header, request_add_custom_headers, request_handle_response, - request_set_timeout, send_request, HttpBody, RequestFlags, + HttpBody, RequestFlags, check_response_redirection, http_client, http_parse_redirect_mode, + http_parse_url, request_add_authorization_header, request_add_custom_headers, + request_handle_response, request_set_timeout, send_request, }; use nu_engine::command_prelude::*; @@ -109,20 +109,17 @@ impl Command for HttpPatch { }, Example { description: "Patch content to example.com, with username and password", - example: - "http patch --user myuser --password mypass https://www.example.com 'body'", + example: "http patch --user myuser --password mypass https://www.example.com 'body'", result: None, }, Example { description: "Patch content to example.com, with custom header using a record", - example: - "http patch --headers {my-header-key: my-header-value} https://www.example.com", + example: "http patch --headers {my-header-key: my-header-value} https://www.example.com", result: None, }, Example { description: "Patch content to example.com, with custom header using a list", - example: - "http patch --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com", + example: "http patch --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com", result: None, }, Example { diff --git a/crates/nu-command/src/network/http/post.rs b/crates/nu-command/src/network/http/post.rs index 41b316c65d..03fa0bf984 100644 --- a/crates/nu-command/src/network/http/post.rs +++ b/crates/nu-command/src/network/http/post.rs @@ -1,7 +1,7 @@ use crate::network::http::client::{ - check_response_redirection, http_client, http_parse_redirect_mode, http_parse_url, - request_add_authorization_header, request_add_custom_headers, request_handle_response, - request_set_timeout, send_request, HttpBody, RequestFlags, + HttpBody, RequestFlags, check_response_redirection, http_client, http_parse_redirect_mode, + http_parse_url, request_add_authorization_header, request_add_custom_headers, + request_handle_response, request_set_timeout, send_request, }; use nu_engine::command_prelude::*; diff --git a/crates/nu-command/src/network/http/put.rs b/crates/nu-command/src/network/http/put.rs index 53fb975f4a..b651bb6185 100644 --- a/crates/nu-command/src/network/http/put.rs +++ b/crates/nu-command/src/network/http/put.rs @@ -1,7 +1,7 @@ use crate::network::http::client::{ - check_response_redirection, http_client, http_parse_redirect_mode, http_parse_url, - request_add_authorization_header, request_add_custom_headers, request_handle_response, - request_set_timeout, send_request, HttpBody, RequestFlags, + HttpBody, RequestFlags, check_response_redirection, http_client, http_parse_redirect_mode, + http_parse_url, request_add_authorization_header, request_add_custom_headers, + request_handle_response, request_set_timeout, send_request, }; use nu_engine::command_prelude::*; diff --git a/crates/nu-command/src/network/url/decode.rs b/crates/nu-command/src/network/url/decode.rs index 312116f254..2ed01aa9a2 100644 --- a/crates/nu-command/src/network/url/decode.rs +++ b/crates/nu-command/src/network/url/decode.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CellPathOnlyArgs}; +use nu_cmd_base::input_handler::{CellPathOnlyArgs, operate}; use nu_engine::command_prelude::*; use percent_encoding::percent_decode_str; diff --git a/crates/nu-command/src/network/url/encode.rs b/crates/nu-command/src/network/url/encode.rs index f0064f94d5..8e1c42982f 100644 --- a/crates/nu-command/src/network/url/encode.rs +++ b/crates/nu-command/src/network/url/encode.rs @@ -1,7 +1,7 @@ -use nu_cmd_base::input_handler::{operate, CellPathOnlyArgs}; +use nu_cmd_base::input_handler::{CellPathOnlyArgs, operate}; use nu_engine::command_prelude::*; -use percent_encoding::{utf8_percent_encode, AsciiSet, NON_ALPHANUMERIC}; +use percent_encoding::{AsciiSet, NON_ALPHANUMERIC, utf8_percent_encode}; #[derive(Clone)] pub struct UrlEncode; @@ -67,18 +67,20 @@ impl Command for UrlEncode { description: "Encode multiple urls with escape characters in list", example: "['https://example.com/foo bar' 'https://example.com/a>b' '中文字/eng/12 34'] | url encode", result: Some(Value::list( - vec![ + vec![ Value::test_string("https://example.com/foo%20bar"), Value::test_string("https://example.com/a%3Eb"), Value::test_string("%E4%B8%AD%E6%96%87%E5%AD%97/eng/12%2034"), ], - Span::test_data(), + Span::test_data(), )), }, Example { description: "Encode all non alphanumeric chars with all flag", example: "'https://example.com/foo bar' | url encode --all", - result: Some(Value::test_string("https%3A%2F%2Fexample%2Ecom%2Ffoo%20bar")), + result: Some(Value::test_string( + "https%3A%2F%2Fexample%2Ecom%2Ffoo%20bar", + )), }, ] } diff --git a/crates/nu-command/src/network/url/join.rs b/crates/nu-command/src/network/url/join.rs index d6a8c65648..9c42b43e18 100644 --- a/crates/nu-command/src/network/url/join.rs +++ b/crates/nu-command/src/network/url/join.rs @@ -202,7 +202,7 @@ impl UrlComponents { return Err(ShellError::IncompatibleParametersSingle { msg: String::from("Key params has to be a record or a table"), span: other.span(), - }) + }); } }; diff --git a/crates/nu-command/src/network/url/query.rs b/crates/nu-command/src/network/url/query.rs index 8fb0d2d181..66a418bf26 100644 --- a/crates/nu-command/src/network/url/query.rs +++ b/crates/nu-command/src/network/url/query.rs @@ -10,7 +10,7 @@ pub fn record_to_query_string( let mut row_vec = vec![]; for (k, v) in record { match v { - Value::List { ref vals, .. } => { + Value::List { vals, .. } => { for v_item in vals { row_vec.push(( k.as_str(), diff --git a/crates/nu-command/src/network/url/split_query.rs b/crates/nu-command/src/network/url/split_query.rs index f400e921b4..475756c5aa 100644 --- a/crates/nu-command/src/network/url/split_query.rs +++ b/crates/nu-command/src/network/url/split_query.rs @@ -33,25 +33,25 @@ impl Command for UrlSplitQuery { description: "Outputs a table representing the contents of this query string", example: r#""mode=normal&userid=31415" | url split-query"#, result: Some(Value::test_list(vec![ - Value::test_record(record!{ + Value::test_record(record! { "key" => Value::test_string("mode"), "value" => Value::test_string("normal"), }), - Value::test_record(record!{ + Value::test_record(record! { "key" => Value::test_string("userid"), "value" => Value::test_string("31415"), - }) + }), ])), }, Example { description: "Outputs a table representing the contents of this query string, url-decoding the values", example: r#""a=AT%26T&b=AT+T" | url split-query"#, result: Some(Value::test_list(vec![ - Value::test_record(record!{ + Value::test_record(record! { "key" => Value::test_string("a"), "value" => Value::test_string("AT&T"), }), - Value::test_record(record!{ + Value::test_record(record! { "key" => Value::test_string("b"), "value" => Value::test_string("AT T"), }), @@ -61,15 +61,15 @@ impl Command for UrlSplitQuery { description: "Outputs a table representing the contents of this query string", example: r#""a=one&a=two&b=three" | url split-query"#, result: Some(Value::test_list(vec![ - Value::test_record(record!{ + Value::test_record(record! { "key" => Value::test_string("a"), "value" => Value::test_string("one"), }), - Value::test_record(record!{ + Value::test_record(record! { "key" => Value::test_string("a"), "value" => Value::test_string("two"), }), - Value::test_record(record!{ + Value::test_record(record! { "key" => Value::test_string("b"), "value" => Value::test_string("three"), }), diff --git a/crates/nu-command/src/network/version_check.rs b/crates/nu-command/src/network/version_check.rs index 3f1944dfc2..a61319c4a4 100644 --- a/crates/nu-command/src/network/version_check.rs +++ b/crates/nu-command/src/network/version_check.rs @@ -1,8 +1,9 @@ use nu_engine::command_prelude::*; use serde::Deserialize; use update_informer::{ + Check, Package, Registry, Result as UpdateResult, http_client::{GenericHttpClient, HttpClient}, - registry, Check, Package, Registry, Result as UpdateResult, + registry, }; #[derive(Clone)] diff --git a/crates/nu-command/src/path/dirname.rs b/crates/nu-command/src/path/dirname.rs index f64449d504..74a63abdaa 100644 --- a/crates/nu-command/src/path/dirname.rs +++ b/crates/nu-command/src/path/dirname.rs @@ -118,8 +118,7 @@ impl Command for PathDirname { }, Example { description: "Replace the part that would be returned with a custom path", - example: - "'C:\\Users\\joe\\code\\test.txt' | path dirname --num-levels 2 --replace C:\\Users\\viking", + example: "'C:\\Users\\joe\\code\\test.txt' | path dirname --num-levels 2 --replace C:\\Users\\viking", result: Some(Value::test_string("C:\\Users\\viking\\code\\test.txt")), }, ] @@ -148,8 +147,7 @@ impl Command for PathDirname { }, Example { description: "Replace the part that would be returned with a custom path", - example: - "'/home/joe/code/test.txt' | path dirname --num-levels 2 --replace /home/viking", + example: "'/home/joe/code/test.txt' | path dirname --num-levels 2 --replace /home/viking", result: Some(Value::test_string("/home/viking/code/test.txt")), }, ] diff --git a/crates/nu-command/src/path/join.rs b/crates/nu-command/src/path/join.rs index 7244d21101..cbf67eeab2 100644 --- a/crates/nu-command/src/path/join.rs +++ b/crates/nu-command/src/path/join.rs @@ -92,8 +92,7 @@ the output of 'path parse' and 'path split' subcommands."# result: Some(Value::test_string(r"C:\Users\viking\..\folder")), }, Example { - description: - "Use absolute paths, e.g. '/' will bring you to the top level directory", + description: "Use absolute paths, e.g. '/' will bring you to the top level directory", example: r"'C:\Users\viking' | path join / folder", result: Some(Value::test_string(r"C:/folder")), }, @@ -137,8 +136,7 @@ the output of 'path parse' and 'path split' subcommands."# result: Some(Value::test_string(r"/home/viking/../folder")), }, Example { - description: - "Use absolute paths, e.g. '/' will bring you to the top level directory", + description: "Use absolute paths, e.g. '/' will bring you to the top level directory", example: r"'/home/viking' | path join / folder", result: Some(Value::test_string(r"/folder")), }, @@ -250,9 +248,14 @@ fn merge_record(record: &Record, head: Span, span: Span) -> Result nu_style.attr = Some(v.coerce_into_string()?), _ => { return Err(ShellError::IncompatibleParametersSingle { - msg: format!("unknown ANSI format key: expected one of ['fg', 'bg', 'attr'], found '{k}'"), + msg: format!( + "unknown ANSI format key: expected one of ['fg', 'bg', 'attr'], found '{k}'" + ), span, - }) + }); } } } diff --git a/crates/nu-command/src/platform/ansi/strip.rs b/crates/nu-command/src/platform/ansi/strip.rs index 67eb894e96..5329a97ac6 100644 --- a/crates/nu-command/src/platform/ansi/strip.rs +++ b/crates/nu-command/src/platform/ansi/strip.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; use nu_protocol::Config; @@ -83,8 +83,8 @@ fn action(input: &Value, args: &Arguments, _span: Span) -> Value { #[cfg(test)] mod tests { - use super::{action, AnsiStrip, Arguments}; - use nu_protocol::{engine::EngineState, Span, Value}; + use super::{AnsiStrip, Arguments, action}; + use nu_protocol::{Span, Value, engine::EngineState}; #[test] fn examples_work_as_expected() { diff --git a/crates/nu-command/src/platform/clear.rs b/crates/nu-command/src/platform/clear.rs index 38bb659df6..0374dd0664 100644 --- a/crates/nu-command/src/platform/clear.rs +++ b/crates/nu-command/src/platform/clear.rs @@ -1,7 +1,7 @@ use crossterm::{ + QueueableCommand, cursor::MoveTo, terminal::{Clear as ClearCommand, ClearType}, - QueueableCommand, }; use nu_engine::command_prelude::*; use nu_protocol::shell_error::io::IoError; diff --git a/crates/nu-command/src/platform/dir_info.rs b/crates/nu-command/src/platform/dir_info.rs index 2ff0587bb2..51e19f4315 100644 --- a/crates/nu-command/src/platform/dir_info.rs +++ b/crates/nu-command/src/platform/dir_info.rs @@ -1,6 +1,6 @@ use filesize::file_real_size_fast; use nu_glob::Pattern; -use nu_protocol::{record, shell_error::io::IoError, ShellError, Signals, Span, Value}; +use nu_protocol::{ShellError, Signals, Span, Value, record, shell_error::io::IoError}; use std::path::PathBuf; #[derive(Debug, Clone)] diff --git a/crates/nu-command/src/platform/input/list.rs b/crates/nu-command/src/platform/input/list.rs index df605f4a27..0c48f06659 100644 --- a/crates/nu-command/src/platform/input/list.rs +++ b/crates/nu-command/src/platform/input/list.rs @@ -1,4 +1,4 @@ -use dialoguer::{console::Term, FuzzySelect, MultiSelect, Select}; +use dialoguer::{FuzzySelect, MultiSelect, Select, console::Term}; use nu_engine::command_prelude::*; use nu_protocol::shell_error::io::IoError; @@ -105,7 +105,7 @@ impl Command for InputList { return Err(ShellError::TypeMismatch { err_message: "expected a list, a table, or a range".to_string(), span: head, - }) + }); } }; diff --git a/crates/nu-command/src/platform/ulimit.rs b/crates/nu-command/src/platform/ulimit.rs index 1b6be2a4fb..bdf3518a3b 100644 --- a/crates/nu-command/src/platform/ulimit.rs +++ b/crates/nu-command/src/platform/ulimit.rs @@ -1,4 +1,4 @@ -use nix::sys::resource::{rlim_t, Resource, RLIM_INFINITY}; +use nix::sys::resource::{RLIM_INFINITY, Resource, rlim_t}; use nu_engine::command_prelude::*; use std::sync::LazyLock; @@ -470,11 +470,7 @@ fn parse_limit( if val == "unlimited" { Ok(RLIM_INFINITY) } else if val == "soft" { - if soft { - Ok(hard_limit) - } else { - Ok(soft_limit) - } + if soft { Ok(hard_limit) } else { Ok(soft_limit) } } else if val == "hard" { Ok(hard_limit) } else { diff --git a/crates/nu-command/src/platform/whoami.rs b/crates/nu-command/src/platform/whoami.rs index 81253070b0..6e37d97065 100644 --- a/crates/nu-command/src/platform/whoami.rs +++ b/crates/nu-command/src/platform/whoami.rs @@ -39,7 +39,7 @@ impl Command for Whoami { span: Some(call.head), help: None, inner: vec![], - }) + }); } }; diff --git a/crates/nu-command/src/progress_bar.rs b/crates/nu-command/src/progress_bar.rs index b700c1e2d9..ef3fb3b2fc 100644 --- a/crates/nu-command/src/progress_bar.rs +++ b/crates/nu-command/src/progress_bar.rs @@ -1,51 +1,53 @@ -use indicatif::{ProgressBar, ProgressState, ProgressStyle}; -use std::fmt; - -// This module includes the progress bar used to show the progress when using the command `save` -// Eventually it would be nice to find a better place for it. - -pub struct NuProgressBar { - pub pb: ProgressBar, -} - -impl NuProgressBar { - pub fn new(total_bytes: Option) -> NuProgressBar { - // Let's create the progress bar template. - let template = match total_bytes { - Some(_) => { - // We will use a progress bar if we know the total bytes of the stream - ProgressStyle::with_template("{spinner:.green} [{elapsed_precise}] [{bar:30.cyan/blue}] [{bytes}/{total_bytes}] {binary_bytes_per_sec} ({eta}) {wide_msg}") - } - _ => { - // But if we don't know the total then we just show the stats progress - ProgressStyle::with_template( - "{spinner:.green} [{elapsed_precise}] {bytes} {binary_bytes_per_sec} {wide_msg}", - ) - } - }; - - let total_bytes = total_bytes.unwrap_or_default(); - - let new_progress_bar = ProgressBar::new(total_bytes); - new_progress_bar.set_style( - template - .unwrap_or_else(|_| ProgressStyle::default_bar()) - .with_key("eta", |state: &ProgressState, w: &mut dyn fmt::Write| { - let _ = fmt::write(w, format_args!("{:.1}s", state.eta().as_secs_f64())); - }) - .progress_chars("#>-"), - ); - - NuProgressBar { - pb: new_progress_bar, - } - } - - pub fn update_bar(&mut self, bytes_processed: u64) { - self.pb.set_position(bytes_processed); - } - - pub fn abandoned_msg(&self, msg: String) { - self.pb.abandon_with_message(msg); - } -} +use indicatif::{ProgressBar, ProgressState, ProgressStyle}; +use std::fmt; + +// This module includes the progress bar used to show the progress when using the command `save` +// Eventually it would be nice to find a better place for it. + +pub struct NuProgressBar { + pub pb: ProgressBar, +} + +impl NuProgressBar { + pub fn new(total_bytes: Option) -> NuProgressBar { + // Let's create the progress bar template. + let template = match total_bytes { + Some(_) => { + // We will use a progress bar if we know the total bytes of the stream + ProgressStyle::with_template( + "{spinner:.green} [{elapsed_precise}] [{bar:30.cyan/blue}] [{bytes}/{total_bytes}] {binary_bytes_per_sec} ({eta}) {wide_msg}", + ) + } + _ => { + // But if we don't know the total then we just show the stats progress + ProgressStyle::with_template( + "{spinner:.green} [{elapsed_precise}] {bytes} {binary_bytes_per_sec} {wide_msg}", + ) + } + }; + + let total_bytes = total_bytes.unwrap_or_default(); + + let new_progress_bar = ProgressBar::new(total_bytes); + new_progress_bar.set_style( + template + .unwrap_or_else(|_| ProgressStyle::default_bar()) + .with_key("eta", |state: &ProgressState, w: &mut dyn fmt::Write| { + let _ = fmt::write(w, format_args!("{:.1}s", state.eta().as_secs_f64())); + }) + .progress_chars("#>-"), + ); + + NuProgressBar { + pb: new_progress_bar, + } + } + + pub fn update_bar(&mut self, bytes_processed: u64) { + self.pb.set_position(bytes_processed); + } + + pub fn abandoned_msg(&self, msg: String) { + self.pb.abandon_with_message(msg); + } +} diff --git a/crates/nu-command/src/random/binary.rs b/crates/nu-command/src/random/binary.rs index 663affbc12..2509d28346 100644 --- a/crates/nu-command/src/random/binary.rs +++ b/crates/nu-command/src/random/binary.rs @@ -1,4 +1,4 @@ -use super::byte_stream::{random_byte_stream, RandomDistribution}; +use super::byte_stream::{RandomDistribution, random_byte_stream}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-command/src/random/byte_stream.rs b/crates/nu-command/src/random/byte_stream.rs index 26d2482e6a..ea6d183452 100644 --- a/crates/nu-command/src/random/byte_stream.rs +++ b/crates/nu-command/src/random/byte_stream.rs @@ -1,8 +1,9 @@ use nu_engine::command_prelude::*; use nu_protocol::Signals; use rand::{ + Rng, distr::{Alphanumeric, StandardUniform}, - rng, Rng, + rng, }; pub(super) enum RandomDistribution { diff --git a/crates/nu-command/src/random/chars.rs b/crates/nu-command/src/random/chars.rs index ad9d8ac2ac..9ee12181ef 100644 --- a/crates/nu-command/src/random/chars.rs +++ b/crates/nu-command/src/random/chars.rs @@ -1,4 +1,4 @@ -use super::byte_stream::{random_byte_stream, RandomDistribution}; +use super::byte_stream::{RandomDistribution, random_byte_stream}; use nu_engine::command_prelude::*; const DEFAULT_CHARS_LENGTH: usize = 25; diff --git a/crates/nu-command/src/sort_utils.rs b/crates/nu-command/src/sort_utils.rs index 0511e7cddf..9052e1fd84 100644 --- a/crates/nu-command/src/sort_utils.rs +++ b/crates/nu-command/src/sort_utils.rs @@ -1,5 +1,5 @@ use nu_engine::ClosureEval; -use nu_protocol::{ast::CellPath, PipelineData, Record, ShellError, Span, Value}; +use nu_protocol::{PipelineData, Record, ShellError, Span, Value, ast::CellPath}; use nu_utils::IgnoreCaseExt; use std::cmp::Ordering; diff --git a/crates/nu-command/src/stor/create.rs b/crates/nu-command/src/stor/create.rs index 37cc57ce6c..b95020a8d2 100644 --- a/crates/nu-command/src/stor/create.rs +++ b/crates/nu-command/src/stor/create.rs @@ -1,4 +1,4 @@ -use crate::database::{SQLiteDatabase, MEMORY_DB}; +use crate::database::{MEMORY_DB, SQLiteDatabase}; use nu_engine::command_prelude::*; #[derive(Clone)] @@ -191,10 +191,12 @@ mod test { let result = process(table_name, span, &db, Some(columns)); assert!(result.is_err()); - assert!(result - .unwrap_err() - .to_string() - .contains("requires at table name")); + assert!( + result + .unwrap_err() + .to_string() + .contains("requires at table name") + ); } #[test] @@ -209,10 +211,12 @@ mod test { let result = process(table_name, span, &db, None); assert!(result.is_err()); - assert!(result - .unwrap_err() - .to_string() - .contains("requires at least one column")); + assert!( + result + .unwrap_err() + .to_string() + .contains("requires at least one column") + ); } #[test] diff --git a/crates/nu-command/src/stor/delete.rs b/crates/nu-command/src/stor/delete.rs index 0630245a4d..12443addd5 100644 --- a/crates/nu-command/src/stor/delete.rs +++ b/crates/nu-command/src/stor/delete.rs @@ -1,4 +1,4 @@ -use crate::database::{SQLiteDatabase, MEMORY_DB}; +use crate::database::{MEMORY_DB, SQLiteDatabase}; use nu_engine::command_prelude::*; use nu_protocol::Signals; @@ -45,8 +45,7 @@ impl Command for StorDelete { result: None, }, Example { - description: - "Delete some rows from the in-memory sqlite database with a where clause", + description: "Delete some rows from the in-memory sqlite database with a where clause", example: "stor delete --table-name nudb --where-clause \"int1 == 5\"", result: None, }, diff --git a/crates/nu-command/src/stor/export.rs b/crates/nu-command/src/stor/export.rs index ab7081c318..c35acf00d7 100644 --- a/crates/nu-command/src/stor/export.rs +++ b/crates/nu-command/src/stor/export.rs @@ -1,4 +1,4 @@ -use crate::database::{SQLiteDatabase, MEMORY_DB}; +use crate::database::{MEMORY_DB, SQLiteDatabase}; use nu_engine::command_prelude::*; use nu_protocol::Signals; @@ -54,7 +54,7 @@ impl Command for StorExport { return Err(ShellError::MissingParameter { param_name: "please supply a file name with the --file-name parameter".into(), span, - }) + }); } }; diff --git a/crates/nu-command/src/stor/import.rs b/crates/nu-command/src/stor/import.rs index 8f5e99afd6..ffed820055 100644 --- a/crates/nu-command/src/stor/import.rs +++ b/crates/nu-command/src/stor/import.rs @@ -1,4 +1,4 @@ -use crate::database::{SQLiteDatabase, MEMORY_DB}; +use crate::database::{MEMORY_DB, SQLiteDatabase}; use nu_engine::command_prelude::*; use nu_protocol::Signals; @@ -54,7 +54,7 @@ impl Command for StorImport { return Err(ShellError::MissingParameter { param_name: "please supply a file name with the --file-name parameter".into(), span, - }) + }); } }; diff --git a/crates/nu-command/src/stor/insert.rs b/crates/nu-command/src/stor/insert.rs index 1d0f5ae6c0..faa5c37e54 100644 --- a/crates/nu-command/src/stor/insert.rs +++ b/crates/nu-command/src/stor/insert.rs @@ -1,4 +1,4 @@ -use crate::database::{values_to_sql, SQLiteDatabase, MEMORY_DB}; +use crate::database::{MEMORY_DB, SQLiteDatabase, values_to_sql}; use nu_engine::command_prelude::*; use nu_protocol::Signals; use rusqlite::params_from_iter; @@ -46,7 +46,8 @@ impl Command for StorInsert { } fn examples(&self) -> Vec { - vec![Example { + vec![ + Example { description: "Insert data in the in-memory sqlite database using a data-record of column-name and column-value pairs", example: "stor insert --table-name nudb --data-record {bool1: true, int1: 5, float1: 1.1, str1: fdncred, datetime1: 2023-04-17}", result: None, @@ -120,7 +121,7 @@ fn handle( return Err(ShellError::MissingParameter { param_name: "requires a table or a record".into(), span, - }) + }); } PipelineData::ListStream(stream, ..) => stream.into_iter().collect::>(), PipelineData::Value(Value::List { vals, .. }, ..) => vals, @@ -131,7 +132,7 @@ fn handle( wrong_type: "".into(), dst_span: span, src_span: span, - }) + }); } }; diff --git a/crates/nu-command/src/stor/open.rs b/crates/nu-command/src/stor/open.rs index b200d8e86e..5a894df7e6 100644 --- a/crates/nu-command/src/stor/open.rs +++ b/crates/nu-command/src/stor/open.rs @@ -1,4 +1,4 @@ -use crate::database::{SQLiteDatabase, MEMORY_DB}; +use crate::database::{MEMORY_DB, SQLiteDatabase}; use nu_engine::command_prelude::*; use nu_protocol::Signals; diff --git a/crates/nu-command/src/stor/reset.rs b/crates/nu-command/src/stor/reset.rs index 381f2faf63..e7114fa69a 100644 --- a/crates/nu-command/src/stor/reset.rs +++ b/crates/nu-command/src/stor/reset.rs @@ -1,4 +1,4 @@ -use crate::database::{SQLiteDatabase, MEMORY_DB}; +use crate::database::{MEMORY_DB, SQLiteDatabase}; use nu_engine::command_prelude::*; use nu_protocol::Signals; diff --git a/crates/nu-command/src/stor/update.rs b/crates/nu-command/src/stor/update.rs index 98652bae2a..13797a7993 100644 --- a/crates/nu-command/src/stor/update.rs +++ b/crates/nu-command/src/stor/update.rs @@ -1,4 +1,4 @@ -use crate::database::{values_to_sql, SQLiteDatabase, MEMORY_DB}; +use crate::database::{MEMORY_DB, SQLiteDatabase, values_to_sql}; use nu_engine::command_prelude::*; use nu_protocol::Signals; use rusqlite::params_from_iter; @@ -52,21 +52,21 @@ impl Command for StorUpdate { fn examples(&self) -> Vec { vec![ - Example { - description: "Update the in-memory sqlite database", - example: "stor update --table-name nudb --update-record {str1: nushell datetime1: 2020-04-17}", - result: None, - }, - Example { - description: "Update the in-memory sqlite database with a where clause", - example: "stor update --table-name nudb --update-record {str1: nushell datetime1: 2020-04-17} --where-clause \"bool1 = 1\"", - result: None, - }, - Example { - description: "Update the in-memory sqlite database through pipeline input", - example: "{str1: nushell datetime1: 2020-04-17} | stor update --table-name nudb", - result: None, - }, + Example { + description: "Update the in-memory sqlite database", + example: "stor update --table-name nudb --update-record {str1: nushell datetime1: 2020-04-17}", + result: None, + }, + Example { + description: "Update the in-memory sqlite database with a where clause", + example: "stor update --table-name nudb --update-record {str1: nushell datetime1: 2020-04-17} --where-clause \"bool1 = 1\"", + result: None, + }, + Example { + description: "Update the in-memory sqlite database through pipeline input", + example: "{str1: nushell datetime1: 2020-04-17} | stor update --table-name nudb", + result: None, + }, ] } diff --git a/crates/nu-command/src/strings/char_.rs b/crates/nu-command/src/strings/char_.rs index 6a0fe3d57a..bcc35a45c9 100644 --- a/crates/nu-command/src/strings/char_.rs +++ b/crates/nu-command/src/strings/char_.rs @@ -1,4 +1,4 @@ -use indexmap::{indexmap, IndexMap}; +use indexmap::{IndexMap, indexmap}; use nu_engine::command_prelude::*; use nu_protocol::Signals; diff --git a/crates/nu-command/src/strings/detect_columns.rs b/crates/nu-command/src/strings/detect_columns.rs index 23858d9e49..78cd9ec1fe 100644 --- a/crates/nu-command/src/strings/detect_columns.rs +++ b/crates/nu-command/src/strings/detect_columns.rs @@ -72,20 +72,17 @@ none 8150224 4 8150220 1% /mnt/c' | detect columns --gue }, Example { description: "", - example: - "$'c1 c2 c3 c4 c5(char nl)a b c d e' | detect columns --combine-columns 0..1 ", + example: "$'c1 c2 c3 c4 c5(char nl)a b c d e' | detect columns --combine-columns 0..1 ", result: None, }, Example { description: "Splits a multi-line string into columns with headers detected", - example: - "$'c1 c2 c3 c4 c5(char nl)a b c d e' | detect columns --combine-columns -2..-1 ", + example: "$'c1 c2 c3 c4 c5(char nl)a b c d e' | detect columns --combine-columns -2..-1 ", result: None, }, Example { description: "Splits a multi-line string into columns with headers detected", - example: - "$'c1 c2 c3 c4 c5(char nl)a b c d e' | detect columns --combine-columns 2.. ", + example: "$'c1 c2 c3 c4 c5(char nl)a b c d e' | detect columns --combine-columns 2.. ", result: None, }, Example { diff --git a/crates/nu-command/src/strings/format/date.rs b/crates/nu-command/src/strings/format/date.rs index 5c6fb61d83..ba30c3663a 100644 --- a/crates/nu-command/src/strings/format/date.rs +++ b/crates/nu-command/src/strings/format/date.rs @@ -2,7 +2,7 @@ use crate::{generate_strftime_list, parse_date_from_string}; use chrono::{DateTime, Datelike, Locale, TimeZone}; use nu_engine::command_prelude::*; -use nu_utils::locale::{get_system_locale_string, LOCALE_OVERRIDE_ENV_VAR}; +use nu_utils::locale::{LOCALE_OVERRIDE_ENV_VAR, get_system_locale_string}; use std::fmt::{Display, Write}; #[derive(Clone)] @@ -53,8 +53,7 @@ impl Command for FormatDate { )), }, Example { - description: - "Format a given date-time as a string using the default format (RFC 2822).", + description: "Format a given date-time as a string using the default format (RFC 2822).", example: r#""2021-10-22 20:00:12 +01:00" | format date"#, result: Some(Value::string( "Fri, 22 Oct 2021 20:00:12 +0100".to_string(), diff --git a/crates/nu-command/src/strings/format/duration.rs b/crates/nu-command/src/strings/format/duration.rs index c713f64a6f..1a96d07097 100644 --- a/crates/nu-command/src/strings/format/duration.rs +++ b/crates/nu-command/src/strings/format/duration.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; struct Arguments { diff --git a/crates/nu-command/src/strings/format/filesize.rs b/crates/nu-command/src/strings/format/filesize.rs index f5128031d6..abd701e108 100644 --- a/crates/nu-command/src/strings/format/filesize.rs +++ b/crates/nu-command/src/strings/format/filesize.rs @@ -1,6 +1,6 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; -use nu_protocol::{engine::StateWorkingSet, FilesizeFormatter, FilesizeUnit}; +use nu_protocol::{FilesizeFormatter, FilesizeUnit, engine::StateWorkingSet}; struct Arguments { unit: FilesizeUnit, diff --git a/crates/nu-command/src/strings/guess_width.rs b/crates/nu-command/src/strings/guess_width.rs index 0af33866cd..3f8c535e1f 100644 --- a/crates/nu-command/src/strings/guess_width.rs +++ b/crates/nu-command/src/strings/guess_width.rs @@ -650,8 +650,16 @@ nu_plugin_from_sse = '0.4.0' # Nushell plugin to convert a HTTP serve ]; let want = vec![ - vec!["2022-12-21T09:50:16+0000", "WARN", "A warning that should be ignored is usually at this level and should be actionable."], - vec!["2022-12-21T09:50:17+0000", "INFO", "This is less important than debug log and is often used to provide context in the current task."], + vec![ + "2022-12-21T09:50:16+0000", + "WARN", + "A warning that should be ignored is usually at this level and should be actionable.", + ], + vec![ + "2022-12-21T09:50:17+0000", + "INFO", + "This is less important than debug log and is often used to provide context in the current task.", + ], ]; let header = 0; diff --git a/crates/nu-command/src/strings/mod.rs b/crates/nu-command/src/strings/mod.rs index 08f50e537d..06bb6f5e84 100644 --- a/crates/nu-command/src/strings/mod.rs +++ b/crates/nu-command/src/strings/mod.rs @@ -22,8 +22,8 @@ pub use str_::*; use nu_engine::CallExt; use nu_protocol::{ - engine::{Call, EngineState, Stack, StateWorkingSet}, ShellError, + engine::{Call, EngineState, Stack, StateWorkingSet}, }; // For handling the grapheme_cluster related flags on some commands. diff --git a/crates/nu-command/src/strings/parse.rs b/crates/nu-command/src/strings/parse.rs index 23026e5812..c8e52c8e87 100644 --- a/crates/nu-command/src/strings/parse.rs +++ b/crates/nu-command/src/strings/parse.rs @@ -1,6 +1,6 @@ use fancy_regex::{Captures, Regex}; use nu_engine::command_prelude::*; -use nu_protocol::{engine::StateWorkingSet, ListStream, Signals}; +use nu_protocol::{ListStream, Signals, engine::StateWorkingSet}; use std::collections::VecDeque; #[derive(Clone)] @@ -40,65 +40,54 @@ impl Command for Parse { Example { description: "Parse a string into two named columns", example: "\"hi there\" | parse \"{foo} {bar}\"", - result: Some(Value::test_list( - vec![Value::test_record(record! { - "foo" => Value::test_string("hi"), - "bar" => Value::test_string("there"), - })])), + result: Some(Value::test_list(vec![Value::test_record(record! { + "foo" => Value::test_string("hi"), + "bar" => Value::test_string("there"), + })])), }, Example { description: "This is how the first example is interpreted in the source code", example: "\"hi there\" | parse --regex '(?s)\\A(?P.*?) (?P.*?)\\z'", - result: Some(Value::test_list( - vec![Value::test_record(record! { - "foo" => Value::test_string("hi"), - "bar" => Value::test_string("there"), - })])), + result: Some(Value::test_list(vec![Value::test_record(record! { + "foo" => Value::test_string("hi"), + "bar" => Value::test_string("there"), + })])), }, Example { description: "Parse a string using fancy-regex named capture group pattern", example: "\"foo bar.\" | parse --regex '\\s*(?\\w+)(?=\\.)'", - result: Some(Value::test_list( - vec![Value::test_record(record! { - "name" => Value::test_string("bar"), - })], - )), + result: Some(Value::test_list(vec![Value::test_record(record! { + "name" => Value::test_string("bar"), + })])), }, Example { description: "Parse a string using fancy-regex capture group pattern", example: "\"foo! bar.\" | parse --regex '(\\w+)(?=\\.)|(\\w+)(?=!)'", - result: Some(Value::test_list( - vec![ - Value::test_record(record! { - "capture0" => Value::test_string(""), - "capture1" => Value::test_string("foo"), - }), - Value::test_record(record! { - "capture0" => Value::test_string("bar"), - "capture1" => Value::test_string(""), - }), - ], - )), + result: Some(Value::test_list(vec![ + Value::test_record(record! { + "capture0" => Value::test_string(""), + "capture1" => Value::test_string("foo"), + }), + Value::test_record(record! { + "capture0" => Value::test_string("bar"), + "capture1" => Value::test_string(""), + }), + ])), }, Example { description: "Parse a string using fancy-regex look behind pattern", - example: - "\" @another(foo bar) \" | parse --regex '\\s*(?<=[() ])(@\\w+)(\\([^)]*\\))?\\s*'", - result: Some(Value::test_list( - vec![Value::test_record(record! { - "capture0" => Value::test_string("@another"), - "capture1" => Value::test_string("(foo bar)"), - })], - )), + example: "\" @another(foo bar) \" | parse --regex '\\s*(?<=[() ])(@\\w+)(\\([^)]*\\))?\\s*'", + result: Some(Value::test_list(vec![Value::test_record(record! { + "capture0" => Value::test_string("@another"), + "capture1" => Value::test_string("(foo bar)"), + })])), }, Example { description: "Parse a string using fancy-regex look ahead atomic group pattern", example: "\"abcd\" | parse --regex '^a(bc(?=d)|b)cd$'", - result: Some(Value::test_list( - vec![Value::test_record(record! { - "capture0" => Value::test_string("b"), - })], - )), + result: Some(Value::test_list(vec![Value::test_record(record! { + "capture0" => Value::test_string("b"), + })])), }, ] } diff --git a/crates/nu-command/src/strings/split/column.rs b/crates/nu-command/src/strings/split/column.rs index a197aa8e2e..1e841f77a3 100644 --- a/crates/nu-command/src/strings/split/column.rs +++ b/crates/nu-command/src/strings/split/column.rs @@ -1,4 +1,4 @@ -use fancy_regex::{escape, Regex}; +use fancy_regex::{Regex, escape}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-command/src/strings/split/list.rs b/crates/nu-command/src/strings/split/list.rs index cf7cd5ef2a..303737ae0a 100644 --- a/crates/nu-command/src/strings/split/list.rs +++ b/crates/nu-command/src/strings/split/list.rs @@ -1,5 +1,5 @@ use fancy_regex::Regex; -use nu_engine::{command_prelude::*, ClosureEval}; +use nu_engine::{ClosureEval, command_prelude::*}; use nu_protocol::{FromValue, Signals}; #[derive(Clone)] diff --git a/crates/nu-command/src/strings/split/row.rs b/crates/nu-command/src/strings/split/row.rs index c1fbf12df2..eb22115231 100644 --- a/crates/nu-command/src/strings/split/row.rs +++ b/crates/nu-command/src/strings/split/row.rs @@ -1,4 +1,4 @@ -use fancy_regex::{escape, Regex}; +use fancy_regex::{Regex, escape}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-command/src/strings/split/words.rs b/crates/nu-command/src/strings/split/words.rs index 7a3a525ca7..0850803510 100644 --- a/crates/nu-command/src/strings/split/words.rs +++ b/crates/nu-command/src/strings/split/words.rs @@ -75,8 +75,7 @@ impl Command for SplitWords { )), }, Example { - description: - "Split the string's words, of at least 3 characters, into separate rows", + description: "Split the string's words, of at least 3 characters, into separate rows", example: "'hello to the world' | split words --min-word-length 3", result: Some(Value::list( vec![ @@ -88,8 +87,7 @@ impl Command for SplitWords { )), }, Example { - description: - "A real-world example of splitting words", + description: "A real-world example of splitting words", example: "http get https://www.gutenberg.org/files/11/11-0.txt | str downcase | split words --min-word-length 2 | uniq --count | sort-by count --reverse | first 10", result: None, }, diff --git a/crates/nu-command/src/strings/str_/case/mod.rs b/crates/nu-command/src/strings/str_/case/mod.rs index 5fed0ad2e6..ba04c4a7eb 100644 --- a/crates/nu-command/src/strings/str_/case/mod.rs +++ b/crates/nu-command/src/strings/str_/case/mod.rs @@ -8,7 +8,7 @@ pub use downcase::StrDowncase; pub use str_::Str; pub use upcase::StrUpcase; -use nu_cmd_base::input_handler::{operate as general_operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate as general_operate}; use nu_engine::command_prelude::*; struct Arguments String + Send + Sync + 'static> { diff --git a/crates/nu-command/src/strings/str_/case/upcase.rs b/crates/nu-command/src/strings/str_/case/upcase.rs index 3eb554cef0..82cf81f412 100644 --- a/crates/nu-command/src/strings/str_/case/upcase.rs +++ b/crates/nu-command/src/strings/str_/case/upcase.rs @@ -116,7 +116,7 @@ fn action(input: &Value, head: Span) -> Value { #[cfg(test)] mod tests { use super::*; - use super::{action, StrUpcase}; + use super::{StrUpcase, action}; #[test] fn test_examples() { diff --git a/crates/nu-command/src/strings/str_/contains.rs b/crates/nu-command/src/strings/str_/contains.rs index 5e500f95fb..86e3eaa5a2 100644 --- a/crates/nu-command/src/strings/str_/contains.rs +++ b/crates/nu-command/src/strings/str_/contains.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; use nu_utils::IgnoreCaseExt; diff --git a/crates/nu-command/src/strings/str_/distance.rs b/crates/nu-command/src/strings/str_/distance.rs index e6a286b551..18a2d5b22b 100644 --- a/crates/nu-command/src/strings/str_/distance.rs +++ b/crates/nu-command/src/strings/str_/distance.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; use nu_protocol::{engine::StateWorkingSet, levenshtein_distance}; @@ -93,30 +93,29 @@ impl Command for StrDistance { } fn examples(&self) -> Vec { - vec![Example { - description: "get the edit distance between two strings", - example: "'nushell' | str distance 'nutshell'", - result: Some(Value::test_int(1)), - }, - Example { - description: "Compute edit distance between strings in table and another string, using cell paths", - example: "[{a: 'nutshell' b: 'numetal'}] | str distance 'nushell' 'a' 'b'", - result: Some(Value::test_list ( - vec![ - Value::test_record(record! { - "a" => Value::test_int(1), - "b" => Value::test_int(4), - })])), - }, - Example { - description: "Compute edit distance between strings in record and another string, using cell paths", - example: "{a: 'nutshell' b: 'numetal'} | str distance 'nushell' a b", - result: Some( - Value::test_record(record! { - "a" => Value::test_int(1), - "b" => Value::test_int(4), - })), - }] + vec![ + Example { + description: "get the edit distance between two strings", + example: "'nushell' | str distance 'nutshell'", + result: Some(Value::test_int(1)), + }, + Example { + description: "Compute edit distance between strings in table and another string, using cell paths", + example: "[{a: 'nutshell' b: 'numetal'}] | str distance 'nushell' 'a' 'b'", + result: Some(Value::test_list(vec![Value::test_record(record! { + "a" => Value::test_int(1), + "b" => Value::test_int(4), + })])), + }, + Example { + description: "Compute edit distance between strings in record and another string, using cell paths", + example: "{a: 'nutshell' b: 'numetal'} | str distance 'nushell' a b", + result: Some(Value::test_record(record! { + "a" => Value::test_int(1), + "b" => Value::test_int(4), + })), + }, + ] } } diff --git a/crates/nu-command/src/strings/str_/ends_with.rs b/crates/nu-command/src/strings/str_/ends_with.rs index b23a11dca8..661530a163 100644 --- a/crates/nu-command/src/strings/str_/ends_with.rs +++ b/crates/nu-command/src/strings/str_/ends_with.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; use nu_utils::IgnoreCaseExt; diff --git a/crates/nu-command/src/strings/str_/expand.rs b/crates/nu-command/src/strings/str_/expand.rs index 377ed8e757..8b0cc10dca 100644 --- a/crates/nu-command/src/strings/str_/expand.rs +++ b/crates/nu-command/src/strings/str_/expand.rs @@ -43,24 +43,19 @@ impl Command for StrExpand { vec![ Value::test_string("3"), Value::test_string("4"), - Value::test_string("5") + Value::test_string("5"), ], - Span::test_data() + Span::test_data(), )), }, - Example { description: "Ignore the next character after the backslash ('\\')", example: "'A{B\\,,C}' | str expand", result: Some(Value::list( - vec![ - Value::test_string("AB,"), - Value::test_string("AC"), - ], - Span::test_data() + vec![Value::test_string("AB,"), Value::test_string("AC")], + Span::test_data(), )), }, - Example { description: "Commas that are not inside any braces need to be skipped.", example: "'Welcome\\, {home,mon ami}!' | str expand", @@ -69,22 +64,17 @@ impl Command for StrExpand { Value::test_string("Welcome, home!"), Value::test_string("Welcome, mon ami!"), ], - Span::test_data() + Span::test_data(), )), }, - Example { description: "Use double backslashes to add a backslash.", example: "'A{B\\\\,C}' | str expand", result: Some(Value::list( - vec![ - Value::test_string("AB\\"), - Value::test_string("AC"), - ], - Span::test_data() + vec![Value::test_string("AB\\"), Value::test_string("AC")], + Span::test_data(), )), }, - Example { description: "Export comma separated values inside braces (`{}`) to a string list.", example: "\"{apple,banana,cherry}\" | str expand", @@ -92,12 +82,11 @@ impl Command for StrExpand { vec![ Value::test_string("apple"), Value::test_string("banana"), - Value::test_string("cherry") + Value::test_string("cherry"), ], - Span::test_data() + Span::test_data(), )), }, - Example { description: "If the piped data is path, you may want to use --path flag, or else manually replace the backslashes with double backslashes.", example: "'C:\\{Users,Windows}' | str expand --path", @@ -106,10 +95,9 @@ impl Command for StrExpand { Value::test_string("C:\\Users"), Value::test_string("C:\\Windows"), ], - Span::test_data() + Span::test_data(), )), }, - Example { description: "Brace expressions can be used one after another.", example: "\"A{b,c}D{e,f}G\" | str expand", @@ -120,10 +108,9 @@ impl Command for StrExpand { Value::test_string("AcDeG"), Value::test_string("AcDfG"), ], - Span::test_data() + Span::test_data(), )), }, - Example { description: "Collection may include an empty item. It can be put at the start of the list.", example: "\"A{,B,C}\" | str expand", @@ -133,10 +120,9 @@ impl Command for StrExpand { Value::test_string("AB"), Value::test_string("AC"), ], - Span::test_data() + Span::test_data(), )), }, - Example { description: "Empty item can be at the end of the collection.", example: "\"A{B,C,}\" | str expand", @@ -146,10 +132,9 @@ impl Command for StrExpand { Value::test_string("AC"), Value::test_string("A"), ], - Span::test_data() + Span::test_data(), )), }, - Example { description: "Empty item can be in the middle of the collection.", example: "\"A{B,,C}\" | str expand", @@ -159,10 +144,9 @@ impl Command for StrExpand { Value::test_string("A"), Value::test_string("AC"), ], - Span::test_data() + Span::test_data(), )), }, - Example { description: "Also, it is possible to use one inside another. Here is a real-world example, that creates files:", example: "\"A{B{1,3},C{2,5}}D\" | str expand", @@ -173,10 +157,9 @@ impl Command for StrExpand { Value::test_string("AC2D"), Value::test_string("AC5D"), ], - Span::test_data() + Span::test_data(), )), }, - Example { description: "Supports zero padding in numeric ranges.", example: "\"A{08..10}B{11..013}C\" | str expand", @@ -192,9 +175,9 @@ impl Command for StrExpand { Value::test_string("A10B012C"), Value::test_string("A10B013C"), ], - Span::test_data() + Span::test_data(), )), - } + }, ] } @@ -261,8 +244,8 @@ fn run( fn str_expand(contents: &str, span: Span, value_span: Span) -> Value { use bracoxide::{ expand, - parser::{parse, ParsingError}, - tokenizer::{tokenize, TokenizationError}, + parser::{ParsingError, parse}, + tokenizer::{TokenizationError, tokenize}, }; match tokenize(contents) { Ok(tokens) => { diff --git a/crates/nu-command/src/strings/str_/index_of.rs b/crates/nu-command/src/strings/str_/index_of.rs index da98248582..a61bf52fc0 100644 --- a/crates/nu-command/src/strings/str_/index_of.rs +++ b/crates/nu-command/src/strings/str_/index_of.rs @@ -1,9 +1,9 @@ use std::ops::Bound; use crate::{grapheme_flags, grapheme_flags_const}; -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; -use nu_protocol::{engine::StateWorkingSet, IntRange}; +use nu_protocol::{IntRange, engine::StateWorkingSet}; use unicode_segmentation::UnicodeSegmentation; struct Arguments { @@ -159,7 +159,7 @@ impl Command for StrIndexOf { fn action( input: &Value, Arguments { - ref substring, + substring, range, end, graphemes, @@ -194,7 +194,7 @@ fn action( span: range_span, }, head, - ) + ); } }; (s, start) @@ -216,7 +216,7 @@ fn action( // is used to get the grapheme index alongside it. s.grapheme_indices(true) .enumerate() - .find(|e| e.1 .0 >= result) + .find(|e| e.1.0 >= result) .expect("No grapheme index for substring") .0 } else { @@ -246,7 +246,7 @@ mod tests { use nu_protocol::ast::RangeInclusion; use super::*; - use super::{action, Arguments, StrIndexOf}; + use super::{Arguments, StrIndexOf, action}; #[test] fn test_examples() { diff --git a/crates/nu-command/src/strings/str_/join.rs b/crates/nu-command/src/strings/str_/join.rs index 12b2858e1e..0583d0ab0d 100644 --- a/crates/nu-command/src/strings/str_/join.rs +++ b/crates/nu-command/src/strings/str_/join.rs @@ -1,6 +1,6 @@ use chrono::Datelike; use nu_engine::command_prelude::*; -use nu_protocol::{shell_error::io::IoError, Signals}; +use nu_protocol::{Signals, shell_error::io::IoError}; use std::io::Write; diff --git a/crates/nu-command/src/strings/str_/length.rs b/crates/nu-command/src/strings/str_/length.rs index f5eedd29ae..edd0cc35c2 100644 --- a/crates/nu-command/src/strings/str_/length.rs +++ b/crates/nu-command/src/strings/str_/length.rs @@ -1,5 +1,5 @@ use crate::{grapheme_flags, grapheme_flags_const}; -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; use unicode_segmentation::UnicodeSegmentation; diff --git a/crates/nu-command/src/strings/str_/replace.rs b/crates/nu-command/src/strings/str_/replace.rs index 50ba95cdd4..9540b3dd44 100644 --- a/crates/nu-command/src/strings/str_/replace.rs +++ b/crates/nu-command/src/strings/str_/replace.rs @@ -1,5 +1,5 @@ use fancy_regex::{NoExpand, Regex}; -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; struct Arguments { @@ -167,25 +167,21 @@ impl Command for StrReplace { }, Example { description: "Find and replace all occurrences of found string in table using regular expression", - example: - "[[ColA ColB ColC]; [abc abc ads]] | str replace --all --regex 'b' 'z' ColA ColC", - result: Some(Value::test_list ( - vec![Value::test_record(record! { - "ColA" => Value::test_string("azc"), - "ColB" => Value::test_string("abc"), - "ColC" => Value::test_string("ads"), - })], - )), + example: "[[ColA ColB ColC]; [abc abc ads]] | str replace --all --regex 'b' 'z' ColA ColC", + result: Some(Value::test_list(vec![Value::test_record(record! { + "ColA" => Value::test_string("azc"), + "ColB" => Value::test_string("abc"), + "ColC" => Value::test_string("ads"), + })])), }, Example { description: "Find and replace all occurrences of found string in record using regular expression", - example: - "{ KeyA: abc, KeyB: abc, KeyC: ads } | str replace --all --regex 'b' 'z' KeyA KeyC", + example: "{ KeyA: abc, KeyB: abc, KeyC: ads } | str replace --all --regex 'b' 'z' KeyA KeyC", result: Some(Value::test_record(record! { - "KeyA" => Value::test_string("azc"), - "KeyB" => Value::test_string("abc"), - "KeyC" => Value::test_string("ads"), - })), + "KeyA" => Value::test_string("azc"), + "KeyB" => Value::test_string("abc"), + "KeyC" => Value::test_string("ads"), + })), }, Example { description: "Find and replace contents without using the replace parameter as a regular expression", @@ -210,9 +206,10 @@ impl Command for StrReplace { Example { description: "Find and replace on individual lines using multiline regular expression", example: r#""non-matching line\n123. one line\n124. another line\n" | str replace --all --multiline '^[0-9]+\. ' ''"#, - result: Some(Value::test_string("non-matching line\none line\nanother line\n")), + result: Some(Value::test_string( + "non-matching line\none line\nanother line\n", + )), }, - ] } } @@ -304,7 +301,7 @@ fn action( #[cfg(test)] mod tests { use super::*; - use super::{action, Arguments, StrReplace}; + use super::{Arguments, StrReplace, action}; fn test_spanned_string(val: &str) -> Spanned { Spanned { diff --git a/crates/nu-command/src/strings/str_/reverse.rs b/crates/nu-command/src/strings/str_/reverse.rs index 158c284200..0a8cb0da09 100644 --- a/crates/nu-command/src/strings/str_/reverse.rs +++ b/crates/nu-command/src/strings/str_/reverse.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CellPathOnlyArgs}; +use nu_cmd_base::input_handler::{CellPathOnlyArgs, operate}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-command/src/strings/str_/starts_with.rs b/crates/nu-command/src/strings/str_/starts_with.rs index 9d708e23da..e07029bfbb 100644 --- a/crates/nu-command/src/strings/str_/starts_with.rs +++ b/crates/nu-command/src/strings/str_/starts_with.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; use nu_utils::IgnoreCaseExt; diff --git a/crates/nu-command/src/strings/str_/substring.rs b/crates/nu-command/src/strings/str_/substring.rs index 6fbcb05358..d2467d6900 100644 --- a/crates/nu-command/src/strings/str_/substring.rs +++ b/crates/nu-command/src/strings/str_/substring.rs @@ -1,9 +1,9 @@ use std::ops::Bound; use crate::{grapheme_flags, grapheme_flags_const}; -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; -use nu_protocol::{engine::StateWorkingSet, IntRange}; +use nu_protocol::{IntRange, engine::StateWorkingSet}; use unicode_segmentation::UnicodeSegmentation; #[derive(Clone)] @@ -116,8 +116,7 @@ impl Command for StrSubstring { fn examples(&self) -> Vec { vec![ Example { - description: - "Get a substring \"nushell\" from the text \"good nushell\" using a range", + description: "Get a substring \"nushell\" from the text \"good nushell\" using a range", example: " 'good nushell' | str substring 5..11", result: Some(Value::test_string("nushell")), }, @@ -188,7 +187,7 @@ fn action(input: &Value, args: &Arguments, head: Span) -> Value { mod tests { use nu_protocol::IntRange; - use super::{action, Arguments, Span, StrSubstring, Value}; + use super::{Arguments, Span, StrSubstring, Value, action}; #[test] fn test_examples() { diff --git a/crates/nu-command/src/strings/str_/trim/trim_.rs b/crates/nu-command/src/strings/str_/trim/trim_.rs index 014a9bb469..f9e4fe2974 100644 --- a/crates/nu-command/src/strings/str_/trim/trim_.rs +++ b/crates/nu-command/src/strings/str_/trim/trim_.rs @@ -1,4 +1,4 @@ -use nu_cmd_base::input_handler::{operate, CmdArgument}; +use nu_cmd_base::input_handler::{CmdArgument, operate}; use nu_engine::command_prelude::*; #[derive(Clone)] diff --git a/crates/nu-command/src/system/complete.rs b/crates/nu-command/src/system/complete.rs index 21b33ac656..27b3579483 100644 --- a/crates/nu-command/src/system/complete.rs +++ b/crates/nu-command/src/system/complete.rs @@ -85,8 +85,7 @@ impl Command for Complete { fn examples(&self) -> Vec { vec![Example { - description: - "Run the external command to completion, capturing stdout, stderr, and exit_code", + description: "Run the external command to completion, capturing stdout, stderr, and exit_code", example: "^external arg1 | complete", result: None, }] diff --git a/crates/nu-command/src/system/mod.rs b/crates/nu-command/src/system/mod.rs index 57a314d383..06062418e7 100644 --- a/crates/nu-command/src/system/mod.rs +++ b/crates/nu-command/src/system/mod.rs @@ -33,7 +33,7 @@ pub use nu_check::NuCheck; pub use ps::Ps; #[cfg(windows)] pub use registry_query::RegistryQuery; -pub use run_external::{command_not_found, eval_external_arguments, which, External}; +pub use run_external::{External, command_not_found, eval_external_arguments, which}; pub use sys::*; pub use uname::UName; pub use which_::Which; diff --git a/crates/nu-command/src/system/nu_check.rs b/crates/nu-command/src/system/nu_check.rs index 8280232c1a..01c36a6945 100644 --- a/crates/nu-command/src/system/nu_check.rs +++ b/crates/nu-command/src/system/nu_check.rs @@ -101,7 +101,7 @@ impl Command for NuCheck { ErrorKind::FileNotFound, path_span, PathBuf::from(path_str.item), - ))) + ))); } Err(err) => return Err(err), }; diff --git a/crates/nu-command/src/system/registry_query.rs b/crates/nu-command/src/system/registry_query.rs index cadb3aac29..f71209d884 100644 --- a/crates/nu-command/src/system/registry_query.rs +++ b/crates/nu-command/src/system/registry_query.rs @@ -1,8 +1,8 @@ use nu_engine::command_prelude::*; use nu_protocol::shell_error::io::IoError; -use windows::{core::PCWSTR, Win32::System::Environment::ExpandEnvironmentStringsW}; -use winreg::{enums::*, types::FromRegValue, RegKey}; +use windows::{Win32::System::Environment::ExpandEnvironmentStringsW, core::PCWSTR}; +use winreg::{RegKey, enums::*, types::FromRegValue}; #[derive(Clone)] pub struct RegistryQuery; @@ -184,7 +184,7 @@ fn get_reg_hive( msg: "Entered unreachable code".into(), label: "Unknown registry hive".into(), span: call.head, - }) + }); } }; Ok(RegKey::predef(hkey)) diff --git a/crates/nu-command/src/system/run_external.rs b/crates/nu-command/src/system/run_external.rs index 180238f3f2..526c5ccdd3 100644 --- a/crates/nu-command/src/system/run_external.rs +++ b/crates/nu-command/src/system/run_external.rs @@ -1,13 +1,12 @@ use nu_cmd_base::hook::eval_hook; use nu_engine::{command_prelude::*, env_to_strings}; -use nu_path::{dots::expand_ndots_safe, expand_tilde, AbsolutePath}; +use nu_path::{AbsolutePath, dots::expand_ndots_safe, expand_tilde}; use nu_protocol::{ - did_you_mean, + ByteStream, NuGlob, OutDest, Signals, UseAnsiColoring, did_you_mean, process::{ChildProcess, PostWaitCallback}, shell_error::io::IoError, - ByteStream, NuGlob, OutDest, Signals, UseAnsiColoring, }; -use nu_system::{kill_by_pid, ForegroundChild}; +use nu_system::{ForegroundChild, kill_by_pid}; use nu_utils::IgnoreCaseExt; use pathdiff::diff_paths; #[cfg(windows)] @@ -605,7 +604,9 @@ pub fn command_not_found( } else { return ShellError::ExternalCommand { label: format!("Command `{name}` not found"), - help: format!("A command with that name exists in module `{module}`. Try importing it with `use`"), + help: format!( + "A command with that name exists in module `{module}`. Try importing it with `use`" + ), span, }; } @@ -647,7 +648,9 @@ pub fn command_not_found( if cwd.join(name).is_file() { return ShellError::ExternalCommand { label: format!("Command `{name}` not found"), - help: format!("`{name}` refers to a file that is not executable. Did you forget to set execute permissions?"), + help: format!( + "`{name}` refers to a file that is not executable. Did you forget to set execute permissions?" + ), span, }; } diff --git a/crates/nu-command/src/system/sys/cpu.rs b/crates/nu-command/src/system/sys/cpu.rs index 09e6c836be..a3bb3691e1 100644 --- a/crates/nu-command/src/system/sys/cpu.rs +++ b/crates/nu-command/src/system/sys/cpu.rs @@ -1,6 +1,6 @@ use super::trim_cstyle_null; use nu_engine::command_prelude::*; -use sysinfo::{CpuRefreshKind, System, MINIMUM_CPU_UPDATE_INTERVAL}; +use sysinfo::{CpuRefreshKind, MINIMUM_CPU_UPDATE_INTERVAL, System}; #[derive(Clone)] pub struct SysCpu; diff --git a/crates/nu-command/src/system/uname.rs b/crates/nu-command/src/system/uname.rs index 47a40b2ec8..30d36cc12e 100644 --- a/crates/nu-command/src/system/uname.rs +++ b/crates/nu-command/src/system/uname.rs @@ -1,5 +1,5 @@ use nu_engine::command_prelude::*; -use nu_protocol::{record, Value}; +use nu_protocol::{Value, record}; #[derive(Clone)] pub struct UName; diff --git a/crates/nu-command/src/viewers/table.rs b/crates/nu-command/src/viewers/table.rs index 5ce583a850..698de056e4 100644 --- a/crates/nu-command/src/viewers/table.rs +++ b/crates/nu-command/src/viewers/table.rs @@ -8,17 +8,17 @@ use lscolors::{LsColors, Style}; use url::Url; use web_time::Instant; -use nu_color_config::{color_from_hex, StyleComputer, TextStyle}; +use nu_color_config::{StyleComputer, TextStyle, color_from_hex}; use nu_engine::{command_prelude::*, env_to_string}; use nu_path::form::Absolute; use nu_pretty_hex::HexConfig; use nu_protocol::{ - shell_error::io::IoError, ByteStream, Config, DataSource, ListStream, PipelineMetadata, - Signals, TableMode, ValueIterator, + ByteStream, Config, DataSource, ListStream, PipelineMetadata, Signals, TableMode, + ValueIterator, shell_error::io::IoError, }; use nu_table::{ - common::configure_table, CollapsedTable, ExpandedTable, JustTable, NuTable, StringResult, - TableOpts, TableOutput, + CollapsedTable, ExpandedTable, JustTable, NuTable, StringResult, TableOpts, TableOutput, + common::configure_table, }; use nu_utils::{get_ls_colors, terminal_size}; @@ -195,8 +195,7 @@ impl Command for Table { result: None, }, Example { - description: - "Set the starting number of the #/index column to 100 for a single run", + description: "Set the starting number of the #/index column to 100 for a single run", example: r#"[[a b]; [1 2] [2 [4 4]]] | table -i 100"#, result: None, }, diff --git a/crates/nu-command/tests/commands/assignment/concat.rs b/crates/nu-command/tests/commands/assignment/concat.rs index 73a39571fa..0c17958b4d 100644 --- a/crates/nu-command/tests/commands/assignment/concat.rs +++ b/crates/nu-command/tests/commands/assignment/concat.rs @@ -62,9 +62,11 @@ fn concat_assign_type_mismatch() { $a ++= 'str' "#); - assert!(actual - .err - .contains("nu::parser::operator_incompatible_types")); + assert!( + actual + .err + .contains("nu::parser::operator_incompatible_types") + ); } #[test] @@ -74,7 +76,9 @@ fn concat_assign_runtime_type_mismatch() { $a ++= if true { 'str' } "#); - assert!(actual - .err - .contains("nu::shell::operator_incompatible_types")); + assert!( + actual + .err + .contains("nu::shell::operator_incompatible_types") + ); } diff --git a/crates/nu-command/tests/commands/cd.rs b/crates/nu-command/tests/commands/cd.rs index 2ad25f5aa6..b401fc95b6 100644 --- a/crates/nu-command/tests/commands/cd.rs +++ b/crates/nu-command/tests/commands/cd.rs @@ -262,11 +262,12 @@ fn test_change_windows_drive() { subst Z: /d "# ); - assert!(dirs - .test() - .join("test_folder") - .join("test_file.txt") - .exists()); + assert!( + dirs.test() + .join("test_folder") + .join("test_file.txt") + .exists() + ); }) } diff --git a/crates/nu-command/tests/commands/chunks.rs b/crates/nu-command/tests/commands/chunks.rs index eb0c580f15..e774ac5d90 100644 --- a/crates/nu-command/tests/commands/chunks.rs +++ b/crates/nu-command/tests/commands/chunks.rs @@ -32,7 +32,9 @@ fn list_stream() { #[test] fn table_stream() { - let actual = nu!("([[foo bar]; [0 1] [2 3] [4 5]] | every 1 | chunks 2) == ([[foo bar]; [0 1] [2 3] [4 5]] | chunks 2)"); + let actual = nu!( + "([[foo bar]; [0 1] [2 3] [4 5]] | every 1 | chunks 2) == ([[foo bar]; [0 1] [2 3] [4 5]] | chunks 2)" + ); assert_eq!(actual.out, "true"); } diff --git a/crates/nu-command/tests/commands/complete.rs b/crates/nu-command/tests/commands/complete.rs index 5426d4e8bb..b1f4753d7a 100644 --- a/crates/nu-command/tests/commands/complete.rs +++ b/crates/nu-command/tests/commands/complete.rs @@ -95,7 +95,9 @@ fn capture_error_with_both_stdout_stderr_messages_not_hang_nushell() { #[test] fn combined_pipe_redirection() { - let actual = nu!("$env.FOO = 'hello'; $env.BAR = 'world'; nu --testbin echo_env_mixed out-err FOO BAR o+e>| complete | get stdout"); + let actual = nu!( + "$env.FOO = 'hello'; $env.BAR = 'world'; nu --testbin echo_env_mixed out-err FOO BAR o+e>| complete | get stdout" + ); assert_eq!(actual.out, "helloworld"); } diff --git a/crates/nu-command/tests/commands/database/into_sqlite.rs b/crates/nu-command/tests/commands/database/into_sqlite.rs index b236faa898..4f2017045a 100644 --- a/crates/nu-command/tests/commands/database/into_sqlite.rs +++ b/crates/nu-command/tests/commands/database/into_sqlite.rs @@ -1,17 +1,17 @@ use chrono::{DateTime, FixedOffset}; use nu_path::AbsolutePathBuf; -use nu_protocol::{ast::PathMember, engine::EngineState, record, Span, Value}; +use nu_protocol::{Span, Value, ast::PathMember, engine::EngineState, record}; use nu_test_support::{ - fs::{line_ending, Stub}, + fs::{Stub, line_ending}, nu, pipeline, playground::{Dirs, Playground}, }; use rand::{ + Rng, SeedableRng, distr::{Alphanumeric, SampleString, StandardUniform}, prelude::Distribution, random_range, rngs::StdRng, - Rng, SeedableRng, }; use std::io::Write; diff --git a/crates/nu-command/tests/commands/debug/timeit.rs b/crates/nu-command/tests/commands/debug/timeit.rs index 509f5bc4e7..f57f691519 100644 --- a/crates/nu-command/tests/commands/debug/timeit.rs +++ b/crates/nu-command/tests/commands/debug/timeit.rs @@ -8,7 +8,9 @@ fn timeit_show_stdout() { #[test] fn timeit_show_stderr() { - let actual = nu!(" with-env {FOO: bar, FOO2: baz} { let t = timeit { nu --testbin echo_env_mixed out-err FOO FOO2 } }"); + let actual = nu!( + " with-env {FOO: bar, FOO2: baz} { let t = timeit { nu --testbin echo_env_mixed out-err FOO FOO2 } }" + ); assert!(actual.out.contains("bar")); assert!(actual.err.contains("baz")); } diff --git a/crates/nu-command/tests/commands/def.rs b/crates/nu-command/tests/commands/def.rs index 0705c0085f..7e62e3e55f 100644 --- a/crates/nu-command/tests/commands/def.rs +++ b/crates/nu-command/tests/commands/def.rs @@ -218,9 +218,11 @@ fn def_wrapped_from_module() { spam my-echo foo -b -as -9 --abc -- -Dxmy=AKOO - bar "#); - assert!(actual - .out - .contains("foo -b -as -9 --abc -- -Dxmy=AKOO - bar")); + assert!( + actual + .out + .contains("foo -b -as -9 --abc -- -Dxmy=AKOO - bar") + ); } #[test] diff --git a/crates/nu-command/tests/commands/du.rs b/crates/nu-command/tests/commands/du.rs index 5289a1cc95..4f3cc6e9bf 100644 --- a/crates/nu-command/tests/commands/du.rs +++ b/crates/nu-command/tests/commands/du.rs @@ -10,9 +10,11 @@ fn test_du_flag_min_size() { du -m -1 "# )); - assert!(actual - .err - .contains("Negative value passed when positive one is required")); + assert!( + actual + .err + .contains("Negative value passed when positive one is required") + ); let actual = nu!( cwd: "tests/fixtures/formats", pipeline( @@ -31,9 +33,11 @@ fn test_du_flag_max_depth() { du -d -2 "# )); - assert!(actual - .err - .contains("Negative value passed when positive one is required")); + assert!( + actual + .err + .contains("Negative value passed when positive one is required") + ); let actual = nu!( cwd: "tests/fixtures/formats", pipeline( diff --git a/crates/nu-command/tests/commands/error_make.rs b/crates/nu-command/tests/commands/error_make.rs index f5714c88ac..c3e14c7176 100644 --- a/crates/nu-command/tests/commands/error_make.rs +++ b/crates/nu-command/tests/commands/error_make.rs @@ -4,9 +4,11 @@ use nu_test_support::nu; fn error_label_works() { let actual = nu!("error make {msg:foo label:{text:unseen}}"); - assert!(actual - .err - .contains("label at line 1, columns 1 to 10: unseen")); + assert!( + actual + .err + .contains("label at line 1, columns 1 to 10: unseen") + ); } #[test] @@ -29,9 +31,11 @@ fn error_start_bigger_than_end_should_fail() { "); assert!(!actual.err.contains("invalid error format")); - assert!(!actual - .err - .contains("`$.label.start` should be smaller than `$.label.end`")); + assert!( + !actual + .err + .contains("`$.label.start` should be smaller than `$.label.end`") + ); } #[test] diff --git a/crates/nu-command/tests/commands/export_def.rs b/crates/nu-command/tests/commands/export_def.rs index 5b6edcc8a6..3f57610c6c 100644 --- a/crates/nu-command/tests/commands/export_def.rs +++ b/crates/nu-command/tests/commands/export_def.rs @@ -4,7 +4,9 @@ use nu_test_support::nu; fn export_subcommands_help() { let actual = nu!("export def -h"); - assert!(actual - .out - .contains("Define a custom command and export it from a module")); + assert!( + actual + .out + .contains("Define a custom command and export it from a module") + ); } diff --git a/crates/nu-command/tests/commands/find.rs b/crates/nu-command/tests/commands/find.rs index 37ba13ac3e..9aab5d945b 100644 --- a/crates/nu-command/tests/commands/find.rs +++ b/crates/nu-command/tests/commands/find.rs @@ -17,7 +17,10 @@ fn find_with_list_search_with_char() { let actual = nu!("[moe larry curly] | find l | to json -r"); let actual_no_highlight = nu!("[moe larry curly] | find --no-highlight l | to json -r"); - assert_eq!(actual.out, "[\"\\u001b[37m\\u001b[0m\\u001b[41;37ml\\u001b[0m\\u001b[37marry\\u001b[0m\",\"\\u001b[37mcur\\u001b[0m\\u001b[41;37ml\\u001b[0m\\u001b[37my\\u001b[0m\"]"); + assert_eq!( + actual.out, + "[\"\\u001b[37m\\u001b[0m\\u001b[41;37ml\\u001b[0m\\u001b[37marry\\u001b[0m\",\"\\u001b[37mcur\\u001b[0m\\u001b[41;37ml\\u001b[0m\\u001b[37my\\u001b[0m\"]" + ); assert_eq!(actual_no_highlight.out, "[\"larry\",\"curly\"]"); } @@ -25,8 +28,9 @@ fn find_with_list_search_with_char() { fn find_with_bytestream_search_with_char() { let actual = nu!("\"ABC\" | save foo.txt; let res = open foo.txt | find abc; rm foo.txt; $res | get 0"); - let actual_no_highlight = - nu!("\"ABC\" | save foo.txt; let res = open foo.txt | find --no-highlight abc; rm foo.txt; $res | get 0"); + let actual_no_highlight = nu!( + "\"ABC\" | save foo.txt; let res = open foo.txt | find --no-highlight abc; rm foo.txt; $res | get 0" + ); assert_eq!( actual.out, @@ -88,7 +92,10 @@ fn find_with_filepath_search_with_multiple_patterns() { r#"["amigos.txt","arepas.clu","los.txt","tres.txt"] | find --no-highlight arep ami | to json -r"# ); - assert_eq!(actual.out, "[\"\\u001b[37m\\u001b[0m\\u001b[41;37mami\\u001b[0m\\u001b[37mgos.txt\\u001b[0m\",\"\\u001b[37m\\u001b[0m\\u001b[41;37marep\\u001b[0m\\u001b[37mas.clu\\u001b[0m\"]"); + assert_eq!( + actual.out, + "[\"\\u001b[37m\\u001b[0m\\u001b[41;37mami\\u001b[0m\\u001b[37mgos.txt\\u001b[0m\",\"\\u001b[37m\\u001b[0m\\u001b[41;37marep\\u001b[0m\\u001b[37mas.clu\\u001b[0m\"]" + ); assert_eq!(actual_no_highlight.out, "[\"amigos.txt\",\"arepas.clu\"]"); } @@ -158,8 +165,12 @@ fn inverted_find_in_table_keeps_row_if_none_of_the_selected_columns_matches() { #[test] fn find_in_table_keeps_row_with_single_matched_and_keeps_other_columns() { - let actual = nu!("[[name nickname Age]; [Maurice moe 23] [Laurence larry 67] [William will 18]] | find Maurice"); - let actual_no_highlight = nu!("[[name nickname Age]; [Maurice moe 23] [Laurence larry 67] [William will 18]] | find --no-highlight Maurice"); + let actual = nu!( + "[[name nickname Age]; [Maurice moe 23] [Laurence larry 67] [William will 18]] | find Maurice" + ); + let actual_no_highlight = nu!( + "[[name nickname Age]; [Maurice moe 23] [Laurence larry 67] [William will 18]] | find --no-highlight Maurice" + ); println!("{:?}", actual.out); assert!(actual.out.contains("moe")); @@ -174,8 +185,12 @@ fn find_in_table_keeps_row_with_single_matched_and_keeps_other_columns() { #[test] fn find_in_table_keeps_row_with_multiple_matched_and_keeps_other_columns() { - let actual = nu!("[[name nickname Age]; [Maurice moe 23] [Laurence larry 67] [William will 18] [William bill 60]] | find moe William"); - let actual_no_highlight = nu!("[[name nickname Age]; [Maurice moe 23] [Laurence larry 67] [William will 18] [William bill 60]] | find --no-highlight moe William"); + let actual = nu!( + "[[name nickname Age]; [Maurice moe 23] [Laurence larry 67] [William will 18] [William bill 60]] | find moe William" + ); + let actual_no_highlight = nu!( + "[[name nickname Age]; [Maurice moe 23] [Laurence larry 67] [William will 18] [William bill 60]] | find --no-highlight moe William" + ); println!("{:?}", actual.out); assert!(actual.out.contains("moe")); diff --git a/crates/nu-command/tests/commands/headers.rs b/crates/nu-command/tests/commands/headers.rs index aa4ab32964..4696172da7 100644 --- a/crates/nu-command/tests/commands/headers.rs +++ b/crates/nu-command/tests/commands/headers.rs @@ -51,9 +51,11 @@ fn headers_invalid_column_type_empty_record() { | headers" )); - assert!(actual - .err - .contains("needs compatible type: Null, String, Bool, Float, Int")); + assert!( + actual + .err + .contains("needs compatible type: Null, String, Bool, Float, Int") + ); } #[test] @@ -64,9 +66,11 @@ fn headers_invalid_column_type_record() { | headers" )); - assert!(actual - .err - .contains("needs compatible type: Null, String, Bool, Float, Int")); + assert!( + actual + .err + .contains("needs compatible type: Null, String, Bool, Float, Int") + ); } #[test] @@ -77,9 +81,11 @@ fn headers_invalid_column_type_array() { | headers" )); - assert!(actual - .err - .contains("needs compatible type: Null, String, Bool, Float, Int")); + assert!( + actual + .err + .contains("needs compatible type: Null, String, Bool, Float, Int") + ); } #[test] @@ -90,9 +96,11 @@ fn headers_invalid_column_type_range() { | headers" )); - assert!(actual - .err - .contains("needs compatible type: Null, String, Bool, Float, Int")); + assert!( + actual + .err + .contains("needs compatible type: Null, String, Bool, Float, Int") + ); } #[test] @@ -103,9 +111,11 @@ fn headers_invalid_column_type_duration() { | headers" )); - assert!(actual - .err - .contains("needs compatible type: Null, String, Bool, Float, Int")); + assert!( + actual + .err + .contains("needs compatible type: Null, String, Bool, Float, Int") + ); } #[test] @@ -116,7 +126,9 @@ fn headers_invalid_column_type_binary() { | headers"# )); - assert!(actual - .err - .contains("needs compatible type: Null, String, Bool, Float, Int")); + assert!( + actual + .err + .contains("needs compatible type: Null, String, Bool, Float, Int") + ); } diff --git a/crates/nu-command/tests/commands/insert.rs b/crates/nu-command/tests/commands/insert.rs index c77fb6c867..ae016dd38b 100644 --- a/crates/nu-command/tests/commands/insert.rs +++ b/crates/nu-command/tests/commands/insert.rs @@ -31,9 +31,11 @@ fn insert_the_column_conflict() { "# )); - assert!(actual - .err - .contains("column 'pretty_assertions' already exists")); + assert!( + actual + .err + .contains("column 'pretty_assertions' already exists") + ); } #[test] @@ -61,9 +63,11 @@ fn insert_at_end_of_list() { fn insert_past_end_of_list() { let actual = nu!("[1, 2, 3] | insert 5 abc"); - assert!(actual - .err - .contains("can't insert at index (the next available index is 3)")); + assert!( + actual + .err + .contains("can't insert at index (the next available index is 3)") + ); } #[test] @@ -84,9 +88,11 @@ fn insert_at_end_of_list_stream() { fn insert_past_end_of_list_stream() { let actual = nu!("[1, 2, 3] | every 1 | insert 5 abc"); - assert!(actual - .err - .contains("can't insert at index (the next available index is 3)")); + assert!( + actual + .err + .contains("can't insert at index (the next available index is 3)") + ); } #[test] diff --git a/crates/nu-command/tests/commands/into_datetime.rs b/crates/nu-command/tests/commands/into_datetime.rs index 7dc17497a2..152ede8534 100644 --- a/crates/nu-command/tests/commands/into_datetime.rs +++ b/crates/nu-command/tests/commands/into_datetime.rs @@ -63,9 +63,11 @@ fn into_datetime_table_column() { fn into_datetime_from_record_fails_with_wrong_type() { let actual = nu!(r#"{year: '2023'} | into datetime"#); - assert!(actual - .err - .contains("nu::shell::only_supports_this_input_type")); + assert!( + actual + .err + .contains("nu::shell::only_supports_this_input_type") + ); } #[test] diff --git a/crates/nu-command/tests/commands/into_duration.rs b/crates/nu-command/tests/commands/into_duration.rs index 7d5ef91ae9..8bf88d023b 100644 --- a/crates/nu-command/tests/commands/into_duration.rs +++ b/crates/nu-command/tests/commands/into_duration.rs @@ -72,9 +72,11 @@ fn into_duration_table_column() { fn into_duration_from_record_fails_with_wrong_type() { let actual = nu!(r#"{week: '10'} | into duration"#); - assert!(actual - .err - .contains("nu::shell::only_supports_this_input_type")); + assert!( + actual + .err + .contains("nu::shell::only_supports_this_input_type") + ); } #[test] diff --git a/crates/nu-command/tests/commands/join.rs b/crates/nu-command/tests/commands/join.rs index 4483debce7..5b1ce8b0fd 100644 --- a/crates/nu-command/tests/commands/join.rs +++ b/crates/nu-command/tests/commands/join.rs @@ -384,7 +384,10 @@ fn do_cases_where_result_differs_between_join_types_with_different_join_keys(joi ] { for (join_type_, expected) in join_types { if join_type_ == join_type { - let expr = format!("{} | join {} {} {} {} | to nuon", left, right, join_type, left_on, right_on); + let expr = format!( + "{} | join {} {} {} {} | to nuon", + left, right, join_type, left_on, right_on + ); let actual = nu!(expr).out; assert_eq!(actual, expected); diff --git a/crates/nu-command/tests/commands/let_.rs b/crates/nu-command/tests/commands/let_.rs index d81fb9401c..d24981048b 100644 --- a/crates/nu-command/tests/commands/let_.rs +++ b/crates/nu-command/tests/commands/let_.rs @@ -5,9 +5,11 @@ use rstest::rstest; #[case("let in = 3")] #[case("let in: int = 3")] fn let_name_builtin_var(#[case] assignment: &str) { - assert!(nu!(assignment) - .err - .contains("'in' is the name of a builtin Nushell variable")); + assert!( + nu!(assignment) + .err + .contains("'in' is the name of a builtin Nushell variable") + ); } #[test] diff --git a/crates/nu-command/tests/commands/ls.rs b/crates/nu-command/tests/commands/ls.rs index 736a504935..a8d602b53b 100644 --- a/crates/nu-command/tests/commands/ls.rs +++ b/crates/nu-command/tests/commands/ls.rs @@ -664,9 +664,11 @@ fn list_ignores_ansi() { fn list_unknown_flag() { let actual = nu!("ls -r"); - assert!(actual - .err - .contains("Available flags: --help(-h), --all(-a),")); + assert!( + actual + .err + .contains("Available flags: --help(-h), --all(-a),") + ); } #[test] diff --git a/crates/nu-command/tests/commands/move_/umv.rs b/crates/nu-command/tests/commands/move_/umv.rs index 82a2091c13..74efaf8018 100644 --- a/crates/nu-command/tests/commands/move_/umv.rs +++ b/crates/nu-command/tests/commands/move_/umv.rs @@ -1,4 +1,4 @@ -use nu_test_support::fs::{files_exist_at, Stub::EmptyFile, Stub::FileWithContent}; +use nu_test_support::fs::{Stub::EmptyFile, Stub::FileWithContent, files_exist_at}; use nu_test_support::nu; use nu_test_support::playground::Playground; use rstest::rstest; @@ -249,9 +249,11 @@ fn errors_if_multiple_sources_but_destination_not_a_directory() { "mv file?.txt not_a_dir" ); - assert!(actual - .err - .contains("Can only move multiple sources if destination is a directory")); + assert!( + actual + .err + .contains("Can only move multiple sources if destination is a directory") + ); }) } @@ -546,13 +548,15 @@ fn mv_with_no_target() { cwd: dirs.test(), "mv a", ); - assert!(actual.err.contains( - format!( - "Missing destination path operand after {}", - dirs.test().join("a").display() + assert!( + actual.err.contains( + format!( + "Missing destination path operand after {}", + dirs.test().join("a").display() + ) + .as_str() ) - .as_str() - )); + ); }) } diff --git a/crates/nu-command/tests/commands/mut_.rs b/crates/nu-command/tests/commands/mut_.rs index 7c55110f5f..5007948ec5 100644 --- a/crates/nu-command/tests/commands/mut_.rs +++ b/crates/nu-command/tests/commands/mut_.rs @@ -12,18 +12,22 @@ fn mut_variable() { #[case("mut in = 3")] #[case("mut in: int = 3")] fn mut_name_builtin_var(#[case] assignment: &str) { - assert!(nu!(assignment) - .err - .contains("'in' is the name of a builtin Nushell variable")); + assert!( + nu!(assignment) + .err + .contains("'in' is the name of a builtin Nushell variable") + ); } #[test] fn mut_name_builtin_var_with_dollar() { let actual = nu!("mut $env = 3"); - assert!(actual - .err - .contains("'env' is the name of a builtin Nushell variable")) + assert!( + actual + .err + .contains("'env' is the name of a builtin Nushell variable") + ) } #[test] @@ -152,9 +156,11 @@ fn def_should_not_mutate_mut() { #[test] fn assign_to_non_mut_variable_raises_parse_error() { let actual = nu!("let x = 3; $x = 4"); - assert!(actual - .err - .contains("parser::assignment_requires_mutable_variable")); + assert!( + actual + .err + .contains("parser::assignment_requires_mutable_variable") + ); let actual = nu!("mut x = 3; x = 5"); assert!(actual.err.contains("parser::assignment_requires_variable")); diff --git a/crates/nu-command/tests/commands/network/http/patch.rs b/crates/nu-command/tests/commands/network/http/patch.rs index 6b1ed54d38..3544d821ce 100644 --- a/crates/nu-command/tests/commands/network/http/patch.rs +++ b/crates/nu-command/tests/commands/network/http/patch.rs @@ -76,9 +76,11 @@ fn http_patch_failed_due_to_missing_body() { .as_str() )); - assert!(actual - .err - .contains("Data must be provided either through pipeline or positional argument")) + assert!( + actual + .err + .contains("Data must be provided either through pipeline or positional argument") + ) } #[test] diff --git a/crates/nu-command/tests/commands/network/http/post.rs b/crates/nu-command/tests/commands/network/http/post.rs index f90efba278..29a82e1a3b 100644 --- a/crates/nu-command/tests/commands/network/http/post.rs +++ b/crates/nu-command/tests/commands/network/http/post.rs @@ -75,9 +75,11 @@ fn http_post_failed_due_to_missing_body() { .as_str() )); - assert!(actual - .err - .contains("Data must be provided either through pipeline or positional argument")) + assert!( + actual + .err + .contains("Data must be provided either through pipeline or positional argument") + ) } #[test] diff --git a/crates/nu-command/tests/commands/network/http/put.rs b/crates/nu-command/tests/commands/network/http/put.rs index b66330a18b..ec4002a864 100644 --- a/crates/nu-command/tests/commands/network/http/put.rs +++ b/crates/nu-command/tests/commands/network/http/put.rs @@ -76,9 +76,11 @@ fn http_put_failed_due_to_missing_body() { .as_str() )); - assert!(actual - .err - .contains("Data must be provided either through pipeline or positional argument")) + assert!( + actual + .err + .contains("Data must be provided either through pipeline or positional argument") + ) } #[test] diff --git a/crates/nu-command/tests/commands/open.rs b/crates/nu-command/tests/commands/open.rs index 04eda64c98..4ea8bd89cf 100644 --- a/crates/nu-command/tests/commands/open.rs +++ b/crates/nu-command/tests/commands/open.rs @@ -252,11 +252,13 @@ fn errors_if_file_not_found() { // provided error message assert!(actual.err.contains("nu::shell::io::file_not_found")); - assert!(actual.err.contains( - &PathBuf::from_iter(["tests", "fixtures", "formats", "i_dont_exist.txt"]) - .display() - .to_string() - )); + assert!( + actual.err.contains( + &PathBuf::from_iter(["tests", "fixtures", "formats", "i_dont_exist.txt"]) + .display() + .to_string() + ) + ); } #[test] diff --git a/crates/nu-command/tests/commands/parse.rs b/crates/nu-command/tests/commands/parse.rs index 7f98eed83d..a5dafa4a38 100644 --- a/crates/nu-command/tests/commands/parse.rs +++ b/crates/nu-command/tests/commands/parse.rs @@ -94,9 +94,11 @@ mod simple { "# )); - assert!(actual - .err - .contains("Found opening `{` without an associated closing `}`")); + assert!( + actual + .err + .contains("Found opening `{` without an associated closing `}`") + ); }) } } @@ -184,9 +186,11 @@ mod regex { "# )); - assert!(actual - .err - .contains("Opening parenthesis without closing parenthesis")); + assert!( + actual + .err + .contains("Opening parenthesis without closing parenthesis") + ); }) } diff --git a/crates/nu-command/tests/commands/redirection.rs b/crates/nu-command/tests/commands/redirection.rs index c263f27d83..adbc052c0a 100644 --- a/crates/nu-command/tests/commands/redirection.rs +++ b/crates/nu-command/tests/commands/redirection.rs @@ -1,4 +1,4 @@ -use nu_test_support::fs::{file_contents, Stub::FileWithContent}; +use nu_test_support::fs::{Stub::FileWithContent, file_contents}; use nu_test_support::nu; use nu_test_support::playground::Playground; @@ -468,9 +468,9 @@ fn pipe_redirection_in_let_and_mut( #[case] redir: &str, #[case] output: &str, ) { - let actual = nu!( - format!("$env.BAZ = 'foo'; {keyword} v = nu --testbin echo_env_mixed out-err BAZ BAZ {redir} str length; $v") - ); + let actual = nu!(format!( + "$env.BAZ = 'foo'; {keyword} v = nu --testbin echo_env_mixed out-err BAZ BAZ {redir} str length; $v" + )); assert_eq!(actual.out, output); } diff --git a/crates/nu-command/tests/commands/reduce.rs b/crates/nu-command/tests/commands/reduce.rs index 8c290dfcda..8af204cf90 100644 --- a/crates/nu-command/tests/commands/reduce.rs +++ b/crates/nu-command/tests/commands/reduce.rs @@ -107,9 +107,11 @@ fn error_reduce_fold_type_mismatch() { "echo a b c | reduce --fold 0 { |it, acc| $acc + $it }" )); - assert!(actual - .err - .contains("nu::shell::operator_incompatible_types")); + assert!( + actual + .err + .contains("nu::shell::operator_incompatible_types") + ); } #[test] diff --git a/crates/nu-command/tests/commands/reject.rs b/crates/nu-command/tests/commands/reject.rs index 47c5e86452..7db053e27c 100644 --- a/crates/nu-command/tests/commands/reject.rs +++ b/crates/nu-command/tests/commands/reject.rs @@ -129,7 +129,9 @@ fn reject_optional_row() { #[test] fn reject_columns_with_list_spread() { - let actual = nu!("let arg = [type size]; [[name type size];[Cargo.toml file 10mb] [Cargo.lock file 10mb] [src dir 100mb]] | reject ...$arg | to nuon"); + let actual = nu!( + "let arg = [type size]; [[name type size];[Cargo.toml file 10mb] [Cargo.lock file 10mb] [src dir 100mb]] | reject ...$arg | to nuon" + ); assert_eq!( actual.out, r#"[[name]; ["Cargo.toml"], ["Cargo.lock"], [src]]"# @@ -138,7 +140,9 @@ fn reject_columns_with_list_spread() { #[test] fn reject_rows_with_list_spread() { - let actual = nu!("let arg = [2 0]; [[name type size];[Cargo.toml file 10mb] [Cargo.lock file 10mb] [src dir 100mb]] | reject ...$arg | to nuon"); + let actual = nu!( + "let arg = [2 0]; [[name type size];[Cargo.toml file 10mb] [Cargo.lock file 10mb] [src dir 100mb]] | reject ...$arg | to nuon" + ); assert_eq!( actual.out, r#"[[name, type, size]; ["Cargo.lock", file, 10000000b]]"# @@ -147,7 +151,9 @@ fn reject_rows_with_list_spread() { #[test] fn reject_mixed_with_list_spread() { - let actual = nu!("let arg = [type 2]; [[name type size];[Cargp.toml file 10mb] [ Cargo.lock file 10mb] [src dir 100mb]] | reject ...$arg | to nuon"); + let actual = nu!( + "let arg = [type 2]; [[name type size];[Cargp.toml file 10mb] [ Cargo.lock file 10mb] [src dir 100mb]] | reject ...$arg | to nuon" + ); assert_eq!( actual.out, r#"[[name, size]; ["Cargp.toml", 10000000b], ["Cargo.lock", 10000000b]]"# diff --git a/crates/nu-command/tests/commands/rm.rs b/crates/nu-command/tests/commands/rm.rs index ca3b367a34..44e8c8b40f 100644 --- a/crates/nu-command/tests/commands/rm.rs +++ b/crates/nu-command/tests/commands/rm.rs @@ -1,6 +1,6 @@ #[cfg(not(windows))] use nu_path::AbsolutePath; -use nu_test_support::fs::{files_exist_at, Stub::EmptyFile}; +use nu_test_support::fs::{Stub::EmptyFile, files_exist_at}; use nu_test_support::nu; use nu_test_support::playground::Playground; use rstest::rstest; diff --git a/crates/nu-command/tests/commands/rotate.rs b/crates/nu-command/tests/commands/rotate.rs index 5394134d14..a01fd0ee02 100644 --- a/crates/nu-command/tests/commands/rotate.rs +++ b/crates/nu-command/tests/commands/rotate.rs @@ -93,7 +93,9 @@ fn clockwise() { #[test] fn different_cols_vals_err() { let actual = nu!("[[[one], [two, three]]] | first | rotate"); - assert!(actual - .err - .contains("Attempted to create a record from different number of columns and values")) + assert!( + actual + .err + .contains("Attempted to create a record from different number of columns and values") + ) } diff --git a/crates/nu-command/tests/commands/save.rs b/crates/nu-command/tests/commands/save.rs index e37985eb38..6253b64d74 100644 --- a/crates/nu-command/tests/commands/save.rs +++ b/crates/nu-command/tests/commands/save.rs @@ -1,4 +1,4 @@ -use nu_test_support::fs::{file_contents, Stub}; +use nu_test_support::fs::{Stub, file_contents}; use nu_test_support::playground::Playground; use nu_test_support::{nu, pipeline}; use std::io::Write; @@ -96,9 +96,11 @@ fn save_stderr_and_stdout_to_same_file() { do -c {nu -n -c 'nu --testbin echo_env FOO; nu --testbin echo_env_stderr BAZ'} | save -r save_test_5/new-file.txt --stderr save_test_5/new-file.txt "#, ); - assert!(actual - .err - .contains("can't save both input and stderr input to the same file")); + assert!( + actual + .err + .contains("can't save both input and stderr input to the same file") + ); }) } @@ -340,9 +342,11 @@ fn save_same_file_with_extension() { ) ); - assert!(actual - .err - .contains("pipeline input and output are the same file")); + assert!( + actual + .err + .contains("pipeline input and output are the same file") + ); }) } @@ -361,9 +365,11 @@ fn save_same_file_with_extension_pipeline() { ) ); - assert!(actual - .err - .contains("pipeline input and output are the same file")); + assert!( + actual + .err + .contains("pipeline input and output are the same file") + ); }) } @@ -381,9 +387,11 @@ fn save_same_file_without_extension() { ) ); - assert!(actual - .err - .contains("pipeline input and output are the same file")); + assert!( + actual + .err + .contains("pipeline input and output are the same file") + ); }) } @@ -402,9 +410,11 @@ fn save_same_file_without_extension_pipeline() { ) ); - assert!(actual - .err - .contains("pipeline input and output are the same file")); + assert!( + actual + .err + .contains("pipeline input and output are the same file") + ); }) } diff --git a/crates/nu-command/tests/commands/seq_char.rs b/crates/nu-command/tests/commands/seq_char.rs index b59f45d39d..b249eb36bf 100644 --- a/crates/nu-command/tests/commands/seq_char.rs +++ b/crates/nu-command/tests/commands/seq_char.rs @@ -4,18 +4,22 @@ use nu_test_support::nu; fn fails_when_first_arg_is_multiple_chars() { let actual = nu!("seq char aa z"); - assert!(actual - .err - .contains("input should be a single ASCII character")); + assert!( + actual + .err + .contains("input should be a single ASCII character") + ); } #[test] fn fails_when_second_arg_is_multiple_chars() { let actual = nu!("seq char a zz"); - assert!(actual - .err - .contains("input should be a single ASCII character")); + assert!( + actual + .err + .contains("input should be a single ASCII character") + ); } #[test] @@ -36,18 +40,22 @@ fn generates_sequence_from_e_to_a() { fn fails_when_non_ascii_character_is_used_in_first_arg() { let actual = nu!("seq char ñ z"); - assert!(actual - .err - .contains("input should be a single ASCII character")); + assert!( + actual + .err + .contains("input should be a single ASCII character") + ); } #[test] fn fails_when_non_ascii_character_is_used_in_second_arg() { let actual = nu!("seq char a ñ"); - assert!(actual - .err - .contains("input should be a single ASCII character")); + assert!( + actual + .err + .contains("input should be a single ASCII character") + ); } #[test] diff --git a/crates/nu-command/tests/commands/seq_date.rs b/crates/nu-command/tests/commands/seq_date.rs index f9f6ca818f..bcd7402ee5 100644 --- a/crates/nu-command/tests/commands/seq_date.rs +++ b/crates/nu-command/tests/commands/seq_date.rs @@ -11,7 +11,9 @@ fn fails_on_datetime_input() { fn fails_when_increment_not_integer_or_duration() { let actual = nu!("seq date --begin-date 2020-01-01 --increment 1.1"); - assert!(actual - .err - .contains("expected one of a list of accepted shapes: [Duration, Int]")) + assert!( + actual + .err + .contains("expected one of a list of accepted shapes: [Duration, Int]") + ) } diff --git a/crates/nu-command/tests/commands/source_env.rs b/crates/nu-command/tests/commands/source_env.rs index f9cc3fbc1c..a293c6ed92 100644 --- a/crates/nu-command/tests/commands/source_env.rs +++ b/crates/nu-command/tests/commands/source_env.rs @@ -283,17 +283,21 @@ fn source_env_is_scoped() { let actual = nu!(cwd: dirs.test(), &inp.join("; ")); - assert!(actual - .err - .contains("Command `no-name-similar-to-this` not found")); + assert!( + actual + .err + .contains("Command `no-name-similar-to-this` not found") + ); let inp = &[r#"source-env spam.nu"#, r#"nor-similar-to-this"#]; let actual = nu!(cwd: dirs.test(), &inp.join("; ")); - assert!(actual - .err - .contains("Command `nor-similar-to-this` not found")); + assert!( + actual + .err + .contains("Command `nor-similar-to-this` not found") + ); }) } diff --git a/crates/nu-command/tests/commands/table.rs b/crates/nu-command/tests/commands/table.rs index 33fd351985..80edb72e9a 100644 --- a/crates/nu-command/tests/commands/table.rs +++ b/crates/nu-command/tests/commands/table.rs @@ -521,7 +521,10 @@ fn external_with_too_much_stdout_should_not_hang_nu() { #[test] fn table_pagging_row_offset_overlap() { let actual = nu!("0..1000"); - assert_eq!(actual.out, "╭─────┬─────╮│ 0 │ 0 ││ 1 │ 1 ││ 2 │ 2 ││ 3 │ 3 ││ 4 │ 4 ││ 5 │ 5 ││ 6 │ 6 ││ 7 │ 7 ││ 8 │ 8 ││ 9 │ 9 ││ 10 │ 10 ││ 11 │ 11 ││ 12 │ 12 ││ 13 │ 13 ││ 14 │ 14 ││ 15 │ 15 ││ 16 │ 16 ││ 17 │ 17 ││ 18 │ 18 ││ 19 │ 19 ││ 20 │ 20 ││ 21 │ 21 ││ 22 │ 22 ││ 23 │ 23 ││ 24 │ 24 ││ 25 │ 25 ││ 26 │ 26 ││ 27 │ 27 ││ 28 │ 28 ││ 29 │ 29 ││ 30 │ 30 ││ 31 │ 31 ││ 32 │ 32 ││ 33 │ 33 ││ 34 │ 34 ││ 35 │ 35 ││ 36 │ 36 ││ 37 │ 37 ││ 38 │ 38 ││ 39 │ 39 ││ 40 │ 40 ││ 41 │ 41 ││ 42 │ 42 ││ 43 │ 43 ││ 44 │ 44 ││ 45 │ 45 ││ 46 │ 46 ││ 47 │ 47 ││ 48 │ 48 ││ 49 │ 49 ││ 50 │ 50 ││ 51 │ 51 ││ 52 │ 52 ││ 53 │ 53 ││ 54 │ 54 ││ 55 │ 55 ││ 56 │ 56 ││ 57 │ 57 ││ 58 │ 58 ││ 59 │ 59 ││ 60 │ 60 ││ 61 │ 61 ││ 62 │ 62 ││ 63 │ 63 ││ 64 │ 64 ││ 65 │ 65 ││ 66 │ 66 ││ 67 │ 67 ││ 68 │ 68 ││ 69 │ 69 ││ 70 │ 70 ││ 71 │ 71 ││ 72 │ 72 ││ 73 │ 73 ││ 74 │ 74 ││ 75 │ 75 ││ 76 │ 76 ││ 77 │ 77 ││ 78 │ 78 ││ 79 │ 79 ││ 80 │ 80 ││ 81 │ 81 ││ 82 │ 82 ││ 83 │ 83 ││ 84 │ 84 ││ 85 │ 85 ││ 86 │ 86 ││ 87 │ 87 ││ 88 │ 88 ││ 89 │ 89 ││ 90 │ 90 ││ 91 │ 91 ││ 92 │ 92 ││ 93 │ 93 ││ 94 │ 94 ││ 95 │ 95 ││ 96 │ 96 ││ 97 │ 97 ││ 98 │ 98 ││ 99 │ 99 ││ 100 │ 100 ││ 101 │ 101 ││ 102 │ 102 ││ 103 │ 103 ││ 104 │ 104 ││ 105 │ 105 ││ 106 │ 106 ││ 107 │ 107 ││ 108 │ 108 ││ 109 │ 109 ││ 110 │ 110 ││ 111 │ 111 ││ 112 │ 112 ││ 113 │ 113 ││ 114 │ 114 ││ 115 │ 115 ││ 116 │ 116 ││ 117 │ 117 ││ 118 │ 118 ││ 119 │ 119 ││ 120 │ 120 ││ 121 │ 121 ││ 122 │ 122 ││ 123 │ 123 ││ 124 │ 124 ││ 125 │ 125 ││ 126 │ 126 ││ 127 │ 127 ││ 128 │ 128 ││ 129 │ 129 ││ 130 │ 130 ││ 131 │ 131 ││ 132 │ 132 ││ 133 │ 133 ││ 134 │ 134 ││ 135 │ 135 ││ 136 │ 136 ││ 137 │ 137 ││ 138 │ 138 ││ 139 │ 139 ││ 140 │ 140 ││ 141 │ 141 ││ 142 │ 142 ││ 143 │ 143 ││ 144 │ 144 ││ 145 │ 145 ││ 146 │ 146 ││ 147 │ 147 ││ 148 │ 148 ││ 149 │ 149 ││ 150 │ 150 ││ 151 │ 151 ││ 152 │ 152 ││ 153 │ 153 ││ 154 │ 154 ││ 155 │ 155 ││ 156 │ 156 ││ 157 │ 157 ││ 158 │ 158 ││ 159 │ 159 ││ 160 │ 160 ││ 161 │ 161 ││ 162 │ 162 ││ 163 │ 163 ││ 164 │ 164 ││ 165 │ 165 ││ 166 │ 166 ││ 167 │ 167 ││ 168 │ 168 ││ 169 │ 169 ││ 170 │ 170 ││ 171 │ 171 ││ 172 │ 172 ││ 173 │ 173 ││ 174 │ 174 ││ 175 │ 175 ││ 176 │ 176 ││ 177 │ 177 ││ 178 │ 178 ││ 179 │ 179 ││ 180 │ 180 ││ 181 │ 181 ││ 182 │ 182 ││ 183 │ 183 ││ 184 │ 184 ││ 185 │ 185 ││ 186 │ 186 ││ 187 │ 187 ││ 188 │ 188 ││ 189 │ 189 ││ 190 │ 190 ││ 191 │ 191 ││ 192 │ 192 ││ 193 │ 193 ││ 194 │ 194 ││ 195 │ 195 ││ 196 │ 196 ││ 197 │ 197 ││ 198 │ 198 ││ 199 │ 199 ││ 200 │ 200 ││ 201 │ 201 ││ 202 │ 202 ││ 203 │ 203 ││ 204 │ 204 ││ 205 │ 205 ││ 206 │ 206 ││ 207 │ 207 ││ 208 │ 208 ││ 209 │ 209 ││ 210 │ 210 ││ 211 │ 211 ││ 212 │ 212 ││ 213 │ 213 ││ 214 │ 214 ││ 215 │ 215 ││ 216 │ 216 ││ 217 │ 217 ││ 218 │ 218 ││ 219 │ 219 ││ 220 │ 220 ││ 221 │ 221 ││ 222 │ 222 ││ 223 │ 223 ││ 224 │ 224 ││ 225 │ 225 ││ 226 │ 226 ││ 227 │ 227 ││ 228 │ 228 ││ 229 │ 229 ││ 230 │ 230 ││ 231 │ 231 ││ 232 │ 232 ││ 233 │ 233 ││ 234 │ 234 ││ 235 │ 235 ││ 236 │ 236 ││ 237 │ 237 ││ 238 │ 238 ││ 239 │ 239 ││ 240 │ 240 ││ 241 │ 241 ││ 242 │ 242 ││ 243 │ 243 ││ 244 │ 244 ││ 245 │ 245 ││ 246 │ 246 ││ 247 │ 247 ││ 248 │ 248 ││ 249 │ 249 ││ 250 │ 250 ││ 251 │ 251 ││ 252 │ 252 ││ 253 │ 253 ││ 254 │ 254 ││ 255 │ 255 ││ 256 │ 256 ││ 257 │ 257 ││ 258 │ 258 ││ 259 │ 259 ││ 260 │ 260 ││ 261 │ 261 ││ 262 │ 262 ││ 263 │ 263 ││ 264 │ 264 ││ 265 │ 265 ││ 266 │ 266 ││ 267 │ 267 ││ 268 │ 268 ││ 269 │ 269 ││ 270 │ 270 ││ 271 │ 271 ││ 272 │ 272 ││ 273 │ 273 ││ 274 │ 274 ││ 275 │ 275 ││ 276 │ 276 ││ 277 │ 277 ││ 278 │ 278 ││ 279 │ 279 ││ 280 │ 280 ││ 281 │ 281 ││ 282 │ 282 ││ 283 │ 283 ││ 284 │ 284 ││ 285 │ 285 ││ 286 │ 286 ││ 287 │ 287 ││ 288 │ 288 ││ 289 │ 289 ││ 290 │ 290 ││ 291 │ 291 ││ 292 │ 292 ││ 293 │ 293 ││ 294 │ 294 ││ 295 │ 295 ││ 296 │ 296 ││ 297 │ 297 ││ 298 │ 298 ││ 299 │ 299 ││ 300 │ 300 ││ 301 │ 301 ││ 302 │ 302 ││ 303 │ 303 ││ 304 │ 304 ││ 305 │ 305 ││ 306 │ 306 ││ 307 │ 307 ││ 308 │ 308 ││ 309 │ 309 ││ 310 │ 310 ││ 311 │ 311 ││ 312 │ 312 ││ 313 │ 313 ││ 314 │ 314 ││ 315 │ 315 ││ 316 │ 316 ││ 317 │ 317 ││ 318 │ 318 ││ 319 │ 319 ││ 320 │ 320 ││ 321 │ 321 ││ 322 │ 322 ││ 323 │ 323 ││ 324 │ 324 ││ 325 │ 325 ││ 326 │ 326 ││ 327 │ 327 ││ 328 │ 328 ││ 329 │ 329 ││ 330 │ 330 ││ 331 │ 331 ││ 332 │ 332 ││ 333 │ 333 ││ 334 │ 334 ││ 335 │ 335 ││ 336 │ 336 ││ 337 │ 337 ││ 338 │ 338 ││ 339 │ 339 ││ 340 │ 340 ││ 341 │ 341 ││ 342 │ 342 ││ 343 │ 343 ││ 344 │ 344 ││ 345 │ 345 ││ 346 │ 346 ││ 347 │ 347 ││ 348 │ 348 ││ 349 │ 349 ││ 350 │ 350 ││ 351 │ 351 ││ 352 │ 352 ││ 353 │ 353 ││ 354 │ 354 ││ 355 │ 355 ││ 356 │ 356 ││ 357 │ 357 ││ 358 │ 358 ││ 359 │ 359 ││ 360 │ 360 ││ 361 │ 361 ││ 362 │ 362 ││ 363 │ 363 ││ 364 │ 364 ││ 365 │ 365 ││ 366 │ 366 ││ 367 │ 367 ││ 368 │ 368 ││ 369 │ 369 ││ 370 │ 370 ││ 371 │ 371 ││ 372 │ 372 ││ 373 │ 373 ││ 374 │ 374 ││ 375 │ 375 ││ 376 │ 376 ││ 377 │ 377 ││ 378 │ 378 ││ 379 │ 379 ││ 380 │ 380 ││ 381 │ 381 ││ 382 │ 382 ││ 383 │ 383 ││ 384 │ 384 ││ 385 │ 385 ││ 386 │ 386 ││ 387 │ 387 ││ 388 │ 388 ││ 389 │ 389 ││ 390 │ 390 ││ 391 │ 391 ││ 392 │ 392 ││ 393 │ 393 ││ 394 │ 394 ││ 395 │ 395 ││ 396 │ 396 ││ 397 │ 397 ││ 398 │ 398 ││ 399 │ 399 ││ 400 │ 400 ││ 401 │ 401 ││ 402 │ 402 ││ 403 │ 403 ││ 404 │ 404 ││ 405 │ 405 ││ 406 │ 406 ││ 407 │ 407 ││ 408 │ 408 ││ 409 │ 409 ││ 410 │ 410 ││ 411 │ 411 ││ 412 │ 412 ││ 413 │ 413 ││ 414 │ 414 ││ 415 │ 415 ││ 416 │ 416 ││ 417 │ 417 ││ 418 │ 418 ││ 419 │ 419 ││ 420 │ 420 ││ 421 │ 421 ││ 422 │ 422 ││ 423 │ 423 ││ 424 │ 424 ││ 425 │ 425 ││ 426 │ 426 ││ 427 │ 427 ││ 428 │ 428 ││ 429 │ 429 ││ 430 │ 430 ││ 431 │ 431 ││ 432 │ 432 ││ 433 │ 433 ││ 434 │ 434 ││ 435 │ 435 ││ 436 │ 436 ││ 437 │ 437 ││ 438 │ 438 ││ 439 │ 439 ││ 440 │ 440 ││ 441 │ 441 ││ 442 │ 442 ││ 443 │ 443 ││ 444 │ 444 ││ 445 │ 445 ││ 446 │ 446 ││ 447 │ 447 ││ 448 │ 448 ││ 449 │ 449 ││ 450 │ 450 ││ 451 │ 451 ││ 452 │ 452 ││ 453 │ 453 ││ 454 │ 454 ││ 455 │ 455 ││ 456 │ 456 ││ 457 │ 457 ││ 458 │ 458 ││ 459 │ 459 ││ 460 │ 460 ││ 461 │ 461 ││ 462 │ 462 ││ 463 │ 463 ││ 464 │ 464 ││ 465 │ 465 ││ 466 │ 466 ││ 467 │ 467 ││ 468 │ 468 ││ 469 │ 469 ││ 470 │ 470 ││ 471 │ 471 ││ 472 │ 472 ││ 473 │ 473 ││ 474 │ 474 ││ 475 │ 475 ││ 476 │ 476 ││ 477 │ 477 ││ 478 │ 478 ││ 479 │ 479 ││ 480 │ 480 ││ 481 │ 481 ││ 482 │ 482 ││ 483 │ 483 ││ 484 │ 484 ││ 485 │ 485 ││ 486 │ 486 ││ 487 │ 487 ││ 488 │ 488 ││ 489 │ 489 ││ 490 │ 490 ││ 491 │ 491 ││ 492 │ 492 ││ 493 │ 493 ││ 494 │ 494 ││ 495 │ 495 ││ 496 │ 496 ││ 497 │ 497 ││ 498 │ 498 ││ 499 │ 499 ││ 500 │ 500 ││ 501 │ 501 ││ 502 │ 502 ││ 503 │ 503 ││ 504 │ 504 ││ 505 │ 505 ││ 506 │ 506 ││ 507 │ 507 ││ 508 │ 508 ││ 509 │ 509 ││ 510 │ 510 ││ 511 │ 511 ││ 512 │ 512 ││ 513 │ 513 ││ 514 │ 514 ││ 515 │ 515 ││ 516 │ 516 ││ 517 │ 517 ││ 518 │ 518 ││ 519 │ 519 ││ 520 │ 520 ││ 521 │ 521 ││ 522 │ 522 ││ 523 │ 523 ││ 524 │ 524 ││ 525 │ 525 ││ 526 │ 526 ││ 527 │ 527 ││ 528 │ 528 ││ 529 │ 529 ││ 530 │ 530 ││ 531 │ 531 ││ 532 │ 532 ││ 533 │ 533 ││ 534 │ 534 ││ 535 │ 535 ││ 536 │ 536 ││ 537 │ 537 ││ 538 │ 538 ││ 539 │ 539 ││ 540 │ 540 ││ 541 │ 541 ││ 542 │ 542 ││ 543 │ 543 ││ 544 │ 544 ││ 545 │ 545 ││ 546 │ 546 ││ 547 │ 547 ││ 548 │ 548 ││ 549 │ 549 ││ 550 │ 550 ││ 551 │ 551 ││ 552 │ 552 ││ 553 │ 553 ││ 554 │ 554 ││ 555 │ 555 ││ 556 │ 556 ││ 557 │ 557 ││ 558 │ 558 ││ 559 │ 559 ││ 560 │ 560 ││ 561 │ 561 ││ 562 │ 562 ││ 563 │ 563 ││ 564 │ 564 ││ 565 │ 565 ││ 566 │ 566 ││ 567 │ 567 ││ 568 │ 568 ││ 569 │ 569 ││ 570 │ 570 ││ 571 │ 571 ││ 572 │ 572 ││ 573 │ 573 ││ 574 │ 574 ││ 575 │ 575 ││ 576 │ 576 ││ 577 │ 577 ││ 578 │ 578 ││ 579 │ 579 ││ 580 │ 580 ││ 581 │ 581 ││ 582 │ 582 ││ 583 │ 583 ││ 584 │ 584 ││ 585 │ 585 ││ 586 │ 586 ││ 587 │ 587 ││ 588 │ 588 ││ 589 │ 589 ││ 590 │ 590 ││ 591 │ 591 ││ 592 │ 592 ││ 593 │ 593 ││ 594 │ 594 ││ 595 │ 595 ││ 596 │ 596 ││ 597 │ 597 ││ 598 │ 598 ││ 599 │ 599 ││ 600 │ 600 ││ 601 │ 601 ││ 602 │ 602 ││ 603 │ 603 ││ 604 │ 604 ││ 605 │ 605 ││ 606 │ 606 ││ 607 │ 607 ││ 608 │ 608 ││ 609 │ 609 ││ 610 │ 610 ││ 611 │ 611 ││ 612 │ 612 ││ 613 │ 613 ││ 614 │ 614 ││ 615 │ 615 ││ 616 │ 616 ││ 617 │ 617 ││ 618 │ 618 ││ 619 │ 619 ││ 620 │ 620 ││ 621 │ 621 ││ 622 │ 622 ││ 623 │ 623 ││ 624 │ 624 ││ 625 │ 625 ││ 626 │ 626 ││ 627 │ 627 ││ 628 │ 628 ││ 629 │ 629 ││ 630 │ 630 ││ 631 │ 631 ││ 632 │ 632 ││ 633 │ 633 ││ 634 │ 634 ││ 635 │ 635 ││ 636 │ 636 ││ 637 │ 637 ││ 638 │ 638 ││ 639 │ 639 ││ 640 │ 640 ││ 641 │ 641 ││ 642 │ 642 ││ 643 │ 643 ││ 644 │ 644 ││ 645 │ 645 ││ 646 │ 646 ││ 647 │ 647 ││ 648 │ 648 ││ 649 │ 649 ││ 650 │ 650 ││ 651 │ 651 ││ 652 │ 652 ││ 653 │ 653 ││ 654 │ 654 ││ 655 │ 655 ││ 656 │ 656 ││ 657 │ 657 ││ 658 │ 658 ││ 659 │ 659 ││ 660 │ 660 ││ 661 │ 661 ││ 662 │ 662 ││ 663 │ 663 ││ 664 │ 664 ││ 665 │ 665 ││ 666 │ 666 ││ 667 │ 667 ││ 668 │ 668 ││ 669 │ 669 ││ 670 │ 670 ││ 671 │ 671 ││ 672 │ 672 ││ 673 │ 673 ││ 674 │ 674 ││ 675 │ 675 ││ 676 │ 676 ││ 677 │ 677 ││ 678 │ 678 ││ 679 │ 679 ││ 680 │ 680 ││ 681 │ 681 ││ 682 │ 682 ││ 683 │ 683 ││ 684 │ 684 ││ 685 │ 685 ││ 686 │ 686 ││ 687 │ 687 ││ 688 │ 688 ││ 689 │ 689 ││ 690 │ 690 ││ 691 │ 691 ││ 692 │ 692 ││ 693 │ 693 ││ 694 │ 694 ││ 695 │ 695 ││ 696 │ 696 ││ 697 │ 697 ││ 698 │ 698 ││ 699 │ 699 ││ 700 │ 700 ││ 701 │ 701 ││ 702 │ 702 ││ 703 │ 703 ││ 704 │ 704 ││ 705 │ 705 ││ 706 │ 706 ││ 707 │ 707 ││ 708 │ 708 ││ 709 │ 709 ││ 710 │ 710 ││ 711 │ 711 ││ 712 │ 712 ││ 713 │ 713 ││ 714 │ 714 ││ 715 │ 715 ││ 716 │ 716 ││ 717 │ 717 ││ 718 │ 718 ││ 719 │ 719 ││ 720 │ 720 ││ 721 │ 721 ││ 722 │ 722 ││ 723 │ 723 ││ 724 │ 724 ││ 725 │ 725 ││ 726 │ 726 ││ 727 │ 727 ││ 728 │ 728 ││ 729 │ 729 ││ 730 │ 730 ││ 731 │ 731 ││ 732 │ 732 ││ 733 │ 733 ││ 734 │ 734 ││ 735 │ 735 ││ 736 │ 736 ││ 737 │ 737 ││ 738 │ 738 ││ 739 │ 739 ││ 740 │ 740 ││ 741 │ 741 ││ 742 │ 742 ││ 743 │ 743 ││ 744 │ 744 ││ 745 │ 745 ││ 746 │ 746 ││ 747 │ 747 ││ 748 │ 748 ││ 749 │ 749 ││ 750 │ 750 ││ 751 │ 751 ││ 752 │ 752 ││ 753 │ 753 ││ 754 │ 754 ││ 755 │ 755 ││ 756 │ 756 ││ 757 │ 757 ││ 758 │ 758 ││ 759 │ 759 ││ 760 │ 760 ││ 761 │ 761 ││ 762 │ 762 ││ 763 │ 763 ││ 764 │ 764 ││ 765 │ 765 ││ 766 │ 766 ││ 767 │ 767 ││ 768 │ 768 ││ 769 │ 769 ││ 770 │ 770 ││ 771 │ 771 ││ 772 │ 772 ││ 773 │ 773 ││ 774 │ 774 ││ 775 │ 775 ││ 776 │ 776 ││ 777 │ 777 ││ 778 │ 778 ││ 779 │ 779 ││ 780 │ 780 ││ 781 │ 781 ││ 782 │ 782 ││ 783 │ 783 ││ 784 │ 784 ││ 785 │ 785 ││ 786 │ 786 ││ 787 │ 787 ││ 788 │ 788 ││ 789 │ 789 ││ 790 │ 790 ││ 791 │ 791 ││ 792 │ 792 ││ 793 │ 793 ││ 794 │ 794 ││ 795 │ 795 ││ 796 │ 796 ││ 797 │ 797 ││ 798 │ 798 ││ 799 │ 799 ││ 800 │ 800 ││ 801 │ 801 ││ 802 │ 802 ││ 803 │ 803 ││ 804 │ 804 ││ 805 │ 805 ││ 806 │ 806 ││ 807 │ 807 ││ 808 │ 808 ││ 809 │ 809 ││ 810 │ 810 ││ 811 │ 811 ││ 812 │ 812 ││ 813 │ 813 ││ 814 │ 814 ││ 815 │ 815 ││ 816 │ 816 ││ 817 │ 817 ││ 818 │ 818 ││ 819 │ 819 ││ 820 │ 820 ││ 821 │ 821 ││ 822 │ 822 ││ 823 │ 823 ││ 824 │ 824 ││ 825 │ 825 ││ 826 │ 826 ││ 827 │ 827 ││ 828 │ 828 ││ 829 │ 829 ││ 830 │ 830 ││ 831 │ 831 ││ 832 │ 832 ││ 833 │ 833 ││ 834 │ 834 ││ 835 │ 835 ││ 836 │ 836 ││ 837 │ 837 ││ 838 │ 838 ││ 839 │ 839 ││ 840 │ 840 ││ 841 │ 841 ││ 842 │ 842 ││ 843 │ 843 ││ 844 │ 844 ││ 845 │ 845 ││ 846 │ 846 ││ 847 │ 847 ││ 848 │ 848 ││ 849 │ 849 ││ 850 │ 850 ││ 851 │ 851 ││ 852 │ 852 ││ 853 │ 853 ││ 854 │ 854 ││ 855 │ 855 ││ 856 │ 856 ││ 857 │ 857 ││ 858 │ 858 ││ 859 │ 859 ││ 860 │ 860 ││ 861 │ 861 ││ 862 │ 862 ││ 863 │ 863 ││ 864 │ 864 ││ 865 │ 865 ││ 866 │ 866 ││ 867 │ 867 ││ 868 │ 868 ││ 869 │ 869 ││ 870 │ 870 ││ 871 │ 871 ││ 872 │ 872 ││ 873 │ 873 ││ 874 │ 874 ││ 875 │ 875 ││ 876 │ 876 ││ 877 │ 877 ││ 878 │ 878 ││ 879 │ 879 ││ 880 │ 880 ││ 881 │ 881 ││ 882 │ 882 ││ 883 │ 883 ││ 884 │ 884 ││ 885 │ 885 ││ 886 │ 886 ││ 887 │ 887 ││ 888 │ 888 ││ 889 │ 889 ││ 890 │ 890 ││ 891 │ 891 ││ 892 │ 892 ││ 893 │ 893 ││ 894 │ 894 ││ 895 │ 895 ││ 896 │ 896 ││ 897 │ 897 ││ 898 │ 898 ││ 899 │ 899 ││ 900 │ 900 ││ 901 │ 901 ││ 902 │ 902 ││ 903 │ 903 ││ 904 │ 904 ││ 905 │ 905 ││ 906 │ 906 ││ 907 │ 907 ││ 908 │ 908 ││ 909 │ 909 ││ 910 │ 910 ││ 911 │ 911 ││ 912 │ 912 ││ 913 │ 913 ││ 914 │ 914 ││ 915 │ 915 ││ 916 │ 916 ││ 917 │ 917 ││ 918 │ 918 ││ 919 │ 919 ││ 920 │ 920 ││ 921 │ 921 ││ 922 │ 922 ││ 923 │ 923 ││ 924 │ 924 ││ 925 │ 925 ││ 926 │ 926 ││ 927 │ 927 ││ 928 │ 928 ││ 929 │ 929 ││ 930 │ 930 ││ 931 │ 931 ││ 932 │ 932 ││ 933 │ 933 ││ 934 │ 934 ││ 935 │ 935 ││ 936 │ 936 ││ 937 │ 937 ││ 938 │ 938 ││ 939 │ 939 ││ 940 │ 940 ││ 941 │ 941 ││ 942 │ 942 ││ 943 │ 943 ││ 944 │ 944 ││ 945 │ 945 ││ 946 │ 946 ││ 947 │ 947 ││ 948 │ 948 ││ 949 │ 949 ││ 950 │ 950 ││ 951 │ 951 ││ 952 │ 952 ││ 953 │ 953 ││ 954 │ 954 ││ 955 │ 955 ││ 956 │ 956 ││ 957 │ 957 ││ 958 │ 958 ││ 959 │ 959 ││ 960 │ 960 ││ 961 │ 961 ││ 962 │ 962 ││ 963 │ 963 ││ 964 │ 964 ││ 965 │ 965 ││ 966 │ 966 ││ 967 │ 967 ││ 968 │ 968 ││ 969 │ 969 ││ 970 │ 970 ││ 971 │ 971 ││ 972 │ 972 ││ 973 │ 973 ││ 974 │ 974 ││ 975 │ 975 ││ 976 │ 976 ││ 977 │ 977 ││ 978 │ 978 ││ 979 │ 979 ││ 980 │ 980 ││ 981 │ 981 ││ 982 │ 982 ││ 983 │ 983 ││ 984 │ 984 ││ 985 │ 985 ││ 986 │ 986 ││ 987 │ 987 ││ 988 │ 988 ││ 989 │ 989 ││ 990 │ 990 ││ 991 │ 991 ││ 992 │ 992 ││ 993 │ 993 ││ 994 │ 994 ││ 995 │ 995 ││ 996 │ 996 ││ 997 │ 997 ││ 998 │ 998 ││ 999 │ 999 │╰─────┴─────╯╭──────┬──────╮│ 1000 │ 1000 │╰──────┴──────╯"); + assert_eq!( + actual.out, + "╭─────┬─────╮│ 0 │ 0 ││ 1 │ 1 ││ 2 │ 2 ││ 3 │ 3 ││ 4 │ 4 ││ 5 │ 5 ││ 6 │ 6 ││ 7 │ 7 ││ 8 │ 8 ││ 9 │ 9 ││ 10 │ 10 ││ 11 │ 11 ││ 12 │ 12 ││ 13 │ 13 ││ 14 │ 14 ││ 15 │ 15 ││ 16 │ 16 ││ 17 │ 17 ││ 18 │ 18 ││ 19 │ 19 ││ 20 │ 20 ││ 21 │ 21 ││ 22 │ 22 ││ 23 │ 23 ││ 24 │ 24 ││ 25 │ 25 ││ 26 │ 26 ││ 27 │ 27 ││ 28 │ 28 ││ 29 │ 29 ││ 30 │ 30 ││ 31 │ 31 ││ 32 │ 32 ││ 33 │ 33 ││ 34 │ 34 ││ 35 │ 35 ││ 36 │ 36 ││ 37 │ 37 ││ 38 │ 38 ││ 39 │ 39 ││ 40 │ 40 ││ 41 │ 41 ││ 42 │ 42 ││ 43 │ 43 ││ 44 │ 44 ││ 45 │ 45 ││ 46 │ 46 ││ 47 │ 47 ││ 48 │ 48 ││ 49 │ 49 ││ 50 │ 50 ││ 51 │ 51 ││ 52 │ 52 ││ 53 │ 53 ││ 54 │ 54 ││ 55 │ 55 ││ 56 │ 56 ││ 57 │ 57 ││ 58 │ 58 ││ 59 │ 59 ││ 60 │ 60 ││ 61 │ 61 ││ 62 │ 62 ││ 63 │ 63 ││ 64 │ 64 ││ 65 │ 65 ││ 66 │ 66 ││ 67 │ 67 ││ 68 │ 68 ││ 69 │ 69 ││ 70 │ 70 ││ 71 │ 71 ││ 72 │ 72 ││ 73 │ 73 ││ 74 │ 74 ││ 75 │ 75 ││ 76 │ 76 ││ 77 │ 77 ││ 78 │ 78 ││ 79 │ 79 ││ 80 │ 80 ││ 81 │ 81 ││ 82 │ 82 ││ 83 │ 83 ││ 84 │ 84 ││ 85 │ 85 ││ 86 │ 86 ││ 87 │ 87 ││ 88 │ 88 ││ 89 │ 89 ││ 90 │ 90 ││ 91 │ 91 ││ 92 │ 92 ││ 93 │ 93 ││ 94 │ 94 ││ 95 │ 95 ││ 96 │ 96 ││ 97 │ 97 ││ 98 │ 98 ││ 99 │ 99 ││ 100 │ 100 ││ 101 │ 101 ││ 102 │ 102 ││ 103 │ 103 ││ 104 │ 104 ││ 105 │ 105 ││ 106 │ 106 ││ 107 │ 107 ││ 108 │ 108 ││ 109 │ 109 ││ 110 │ 110 ││ 111 │ 111 ││ 112 │ 112 ││ 113 │ 113 ││ 114 │ 114 ││ 115 │ 115 ││ 116 │ 116 ││ 117 │ 117 ││ 118 │ 118 ││ 119 │ 119 ││ 120 │ 120 ││ 121 │ 121 ││ 122 │ 122 ││ 123 │ 123 ││ 124 │ 124 ││ 125 │ 125 ││ 126 │ 126 ││ 127 │ 127 ││ 128 │ 128 ││ 129 │ 129 ││ 130 │ 130 ││ 131 │ 131 ││ 132 │ 132 ││ 133 │ 133 ││ 134 │ 134 ││ 135 │ 135 ││ 136 │ 136 ││ 137 │ 137 ││ 138 │ 138 ││ 139 │ 139 ││ 140 │ 140 ││ 141 │ 141 ││ 142 │ 142 ││ 143 │ 143 ││ 144 │ 144 ││ 145 │ 145 ││ 146 │ 146 ││ 147 │ 147 ││ 148 │ 148 ││ 149 │ 149 ││ 150 │ 150 ││ 151 │ 151 ││ 152 │ 152 ││ 153 │ 153 ││ 154 │ 154 ││ 155 │ 155 ││ 156 │ 156 ││ 157 │ 157 ││ 158 │ 158 ││ 159 │ 159 ││ 160 │ 160 ││ 161 │ 161 ││ 162 │ 162 ││ 163 │ 163 ││ 164 │ 164 ││ 165 │ 165 ││ 166 │ 166 ││ 167 │ 167 ││ 168 │ 168 ││ 169 │ 169 ││ 170 │ 170 ││ 171 │ 171 ││ 172 │ 172 ││ 173 │ 173 ││ 174 │ 174 ││ 175 │ 175 ││ 176 │ 176 ││ 177 │ 177 ││ 178 │ 178 ││ 179 │ 179 ││ 180 │ 180 ││ 181 │ 181 ││ 182 │ 182 ││ 183 │ 183 ││ 184 │ 184 ││ 185 │ 185 ││ 186 │ 186 ││ 187 │ 187 ││ 188 │ 188 ││ 189 │ 189 ││ 190 │ 190 ││ 191 │ 191 ││ 192 │ 192 ││ 193 │ 193 ││ 194 │ 194 ││ 195 │ 195 ││ 196 │ 196 ││ 197 │ 197 ││ 198 │ 198 ││ 199 │ 199 ││ 200 │ 200 ││ 201 │ 201 ││ 202 │ 202 ││ 203 │ 203 ││ 204 │ 204 ││ 205 │ 205 ││ 206 │ 206 ││ 207 │ 207 ││ 208 │ 208 ││ 209 │ 209 ││ 210 │ 210 ││ 211 │ 211 ││ 212 │ 212 ││ 213 │ 213 ││ 214 │ 214 ││ 215 │ 215 ││ 216 │ 216 ││ 217 │ 217 ││ 218 │ 218 ││ 219 │ 219 ││ 220 │ 220 ││ 221 │ 221 ││ 222 │ 222 ││ 223 │ 223 ││ 224 │ 224 ││ 225 │ 225 ││ 226 │ 226 ││ 227 │ 227 ││ 228 │ 228 ││ 229 │ 229 ││ 230 │ 230 ││ 231 │ 231 ││ 232 │ 232 ││ 233 │ 233 ││ 234 │ 234 ││ 235 │ 235 ││ 236 │ 236 ││ 237 │ 237 ││ 238 │ 238 ││ 239 │ 239 ││ 240 │ 240 ││ 241 │ 241 ││ 242 │ 242 ││ 243 │ 243 ││ 244 │ 244 ││ 245 │ 245 ││ 246 │ 246 ││ 247 │ 247 ││ 248 │ 248 ││ 249 │ 249 ││ 250 │ 250 ││ 251 │ 251 ││ 252 │ 252 ││ 253 │ 253 ││ 254 │ 254 ││ 255 │ 255 ││ 256 │ 256 ││ 257 │ 257 ││ 258 │ 258 ││ 259 │ 259 ││ 260 │ 260 ││ 261 │ 261 ││ 262 │ 262 ││ 263 │ 263 ││ 264 │ 264 ││ 265 │ 265 ││ 266 │ 266 ││ 267 │ 267 ││ 268 │ 268 ││ 269 │ 269 ││ 270 │ 270 ││ 271 │ 271 ││ 272 │ 272 ││ 273 │ 273 ││ 274 │ 274 ││ 275 │ 275 ││ 276 │ 276 ││ 277 │ 277 ││ 278 │ 278 ││ 279 │ 279 ││ 280 │ 280 ││ 281 │ 281 ││ 282 │ 282 ││ 283 │ 283 ││ 284 │ 284 ││ 285 │ 285 ││ 286 │ 286 ││ 287 │ 287 ││ 288 │ 288 ││ 289 │ 289 ││ 290 │ 290 ││ 291 │ 291 ││ 292 │ 292 ││ 293 │ 293 ││ 294 │ 294 ││ 295 │ 295 ││ 296 │ 296 ││ 297 │ 297 ││ 298 │ 298 ││ 299 │ 299 ││ 300 │ 300 ││ 301 │ 301 ││ 302 │ 302 ││ 303 │ 303 ││ 304 │ 304 ││ 305 │ 305 ││ 306 │ 306 ││ 307 │ 307 ││ 308 │ 308 ││ 309 │ 309 ││ 310 │ 310 ││ 311 │ 311 ││ 312 │ 312 ││ 313 │ 313 ││ 314 │ 314 ││ 315 │ 315 ││ 316 │ 316 ││ 317 │ 317 ││ 318 │ 318 ││ 319 │ 319 ││ 320 │ 320 ││ 321 │ 321 ││ 322 │ 322 ││ 323 │ 323 ││ 324 │ 324 ││ 325 │ 325 ││ 326 │ 326 ││ 327 │ 327 ││ 328 │ 328 ││ 329 │ 329 ││ 330 │ 330 ││ 331 │ 331 ││ 332 │ 332 ││ 333 │ 333 ││ 334 │ 334 ││ 335 │ 335 ││ 336 │ 336 ││ 337 │ 337 ││ 338 │ 338 ││ 339 │ 339 ││ 340 │ 340 ││ 341 │ 341 ││ 342 │ 342 ││ 343 │ 343 ││ 344 │ 344 ││ 345 │ 345 ││ 346 │ 346 ││ 347 │ 347 ││ 348 │ 348 ││ 349 │ 349 ││ 350 │ 350 ││ 351 │ 351 ││ 352 │ 352 ││ 353 │ 353 ││ 354 │ 354 ││ 355 │ 355 ││ 356 │ 356 ││ 357 │ 357 ││ 358 │ 358 ││ 359 │ 359 ││ 360 │ 360 ││ 361 │ 361 ││ 362 │ 362 ││ 363 │ 363 ││ 364 │ 364 ││ 365 │ 365 ││ 366 │ 366 ││ 367 │ 367 ││ 368 │ 368 ││ 369 │ 369 ││ 370 │ 370 ││ 371 │ 371 ││ 372 │ 372 ││ 373 │ 373 ││ 374 │ 374 ││ 375 │ 375 ││ 376 │ 376 ││ 377 │ 377 ││ 378 │ 378 ││ 379 │ 379 ││ 380 │ 380 ││ 381 │ 381 ││ 382 │ 382 ││ 383 │ 383 ││ 384 │ 384 ││ 385 │ 385 ││ 386 │ 386 ││ 387 │ 387 ││ 388 │ 388 ││ 389 │ 389 ││ 390 │ 390 ││ 391 │ 391 ││ 392 │ 392 ││ 393 │ 393 ││ 394 │ 394 ││ 395 │ 395 ││ 396 │ 396 ││ 397 │ 397 ││ 398 │ 398 ││ 399 │ 399 ││ 400 │ 400 ││ 401 │ 401 ││ 402 │ 402 ││ 403 │ 403 ││ 404 │ 404 ││ 405 │ 405 ││ 406 │ 406 ││ 407 │ 407 ││ 408 │ 408 ││ 409 │ 409 ││ 410 │ 410 ││ 411 │ 411 ││ 412 │ 412 ││ 413 │ 413 ││ 414 │ 414 ││ 415 │ 415 ││ 416 │ 416 ││ 417 │ 417 ││ 418 │ 418 ││ 419 │ 419 ││ 420 │ 420 ││ 421 │ 421 ││ 422 │ 422 ││ 423 │ 423 ││ 424 │ 424 ││ 425 │ 425 ││ 426 │ 426 ││ 427 │ 427 ││ 428 │ 428 ││ 429 │ 429 ││ 430 │ 430 ││ 431 │ 431 ││ 432 │ 432 ││ 433 │ 433 ││ 434 │ 434 ││ 435 │ 435 ││ 436 │ 436 ││ 437 │ 437 ││ 438 │ 438 ││ 439 │ 439 ││ 440 │ 440 ││ 441 │ 441 ││ 442 │ 442 ││ 443 │ 443 ││ 444 │ 444 ││ 445 │ 445 ││ 446 │ 446 ││ 447 │ 447 ││ 448 │ 448 ││ 449 │ 449 ││ 450 │ 450 ││ 451 │ 451 ││ 452 │ 452 ││ 453 │ 453 ││ 454 │ 454 ││ 455 │ 455 ││ 456 │ 456 ││ 457 │ 457 ││ 458 │ 458 ││ 459 │ 459 ││ 460 │ 460 ││ 461 │ 461 ││ 462 │ 462 ││ 463 │ 463 ││ 464 │ 464 ││ 465 │ 465 ││ 466 │ 466 ││ 467 │ 467 ││ 468 │ 468 ││ 469 │ 469 ││ 470 │ 470 ││ 471 │ 471 ││ 472 │ 472 ││ 473 │ 473 ││ 474 │ 474 ││ 475 │ 475 ││ 476 │ 476 ││ 477 │ 477 ││ 478 │ 478 ││ 479 │ 479 ││ 480 │ 480 ││ 481 │ 481 ││ 482 │ 482 ││ 483 │ 483 ││ 484 │ 484 ││ 485 │ 485 ││ 486 │ 486 ││ 487 │ 487 ││ 488 │ 488 ││ 489 │ 489 ││ 490 │ 490 ││ 491 │ 491 ││ 492 │ 492 ││ 493 │ 493 ││ 494 │ 494 ││ 495 │ 495 ││ 496 │ 496 ││ 497 │ 497 ││ 498 │ 498 ││ 499 │ 499 ││ 500 │ 500 ││ 501 │ 501 ││ 502 │ 502 ││ 503 │ 503 ││ 504 │ 504 ││ 505 │ 505 ││ 506 │ 506 ││ 507 │ 507 ││ 508 │ 508 ││ 509 │ 509 ││ 510 │ 510 ││ 511 │ 511 ││ 512 │ 512 ││ 513 │ 513 ││ 514 │ 514 ││ 515 │ 515 ││ 516 │ 516 ││ 517 │ 517 ││ 518 │ 518 ││ 519 │ 519 ││ 520 │ 520 ││ 521 │ 521 ││ 522 │ 522 ││ 523 │ 523 ││ 524 │ 524 ││ 525 │ 525 ││ 526 │ 526 ││ 527 │ 527 ││ 528 │ 528 ││ 529 │ 529 ││ 530 │ 530 ││ 531 │ 531 ││ 532 │ 532 ││ 533 │ 533 ││ 534 │ 534 ││ 535 │ 535 ││ 536 │ 536 ││ 537 │ 537 ││ 538 │ 538 ││ 539 │ 539 ││ 540 │ 540 ││ 541 │ 541 ││ 542 │ 542 ││ 543 │ 543 ││ 544 │ 544 ││ 545 │ 545 ││ 546 │ 546 ││ 547 │ 547 ││ 548 │ 548 ││ 549 │ 549 ││ 550 │ 550 ││ 551 │ 551 ││ 552 │ 552 ││ 553 │ 553 ││ 554 │ 554 ││ 555 │ 555 ││ 556 │ 556 ││ 557 │ 557 ││ 558 │ 558 ││ 559 │ 559 ││ 560 │ 560 ││ 561 │ 561 ││ 562 │ 562 ││ 563 │ 563 ││ 564 │ 564 ││ 565 │ 565 ││ 566 │ 566 ││ 567 │ 567 ││ 568 │ 568 ││ 569 │ 569 ││ 570 │ 570 ││ 571 │ 571 ││ 572 │ 572 ││ 573 │ 573 ││ 574 │ 574 ││ 575 │ 575 ││ 576 │ 576 ││ 577 │ 577 ││ 578 │ 578 ││ 579 │ 579 ││ 580 │ 580 ││ 581 │ 581 ││ 582 │ 582 ││ 583 │ 583 ││ 584 │ 584 ││ 585 │ 585 ││ 586 │ 586 ││ 587 │ 587 ││ 588 │ 588 ││ 589 │ 589 ││ 590 │ 590 ││ 591 │ 591 ││ 592 │ 592 ││ 593 │ 593 ││ 594 │ 594 ││ 595 │ 595 ││ 596 │ 596 ││ 597 │ 597 ││ 598 │ 598 ││ 599 │ 599 ││ 600 │ 600 ││ 601 │ 601 ││ 602 │ 602 ││ 603 │ 603 ││ 604 │ 604 ││ 605 │ 605 ││ 606 │ 606 ││ 607 │ 607 ││ 608 │ 608 ││ 609 │ 609 ││ 610 │ 610 ││ 611 │ 611 ││ 612 │ 612 ││ 613 │ 613 ││ 614 │ 614 ││ 615 │ 615 ││ 616 │ 616 ││ 617 │ 617 ││ 618 │ 618 ││ 619 │ 619 ││ 620 │ 620 ││ 621 │ 621 ││ 622 │ 622 ││ 623 │ 623 ││ 624 │ 624 ││ 625 │ 625 ││ 626 │ 626 ││ 627 │ 627 ││ 628 │ 628 ││ 629 │ 629 ││ 630 │ 630 ││ 631 │ 631 ││ 632 │ 632 ││ 633 │ 633 ││ 634 │ 634 ││ 635 │ 635 ││ 636 │ 636 ││ 637 │ 637 ││ 638 │ 638 ││ 639 │ 639 ││ 640 │ 640 ││ 641 │ 641 ││ 642 │ 642 ││ 643 │ 643 ││ 644 │ 644 ││ 645 │ 645 ││ 646 │ 646 ││ 647 │ 647 ││ 648 │ 648 ││ 649 │ 649 ││ 650 │ 650 ││ 651 │ 651 ││ 652 │ 652 ││ 653 │ 653 ││ 654 │ 654 ││ 655 │ 655 ││ 656 │ 656 ││ 657 │ 657 ││ 658 │ 658 ││ 659 │ 659 ││ 660 │ 660 ││ 661 │ 661 ││ 662 │ 662 ││ 663 │ 663 ││ 664 │ 664 ││ 665 │ 665 ││ 666 │ 666 ││ 667 │ 667 ││ 668 │ 668 ││ 669 │ 669 ││ 670 │ 670 ││ 671 │ 671 ││ 672 │ 672 ││ 673 │ 673 ││ 674 │ 674 ││ 675 │ 675 ││ 676 │ 676 ││ 677 │ 677 ││ 678 │ 678 ││ 679 │ 679 ││ 680 │ 680 ││ 681 │ 681 ││ 682 │ 682 ││ 683 │ 683 ││ 684 │ 684 ││ 685 │ 685 ││ 686 │ 686 ││ 687 │ 687 ││ 688 │ 688 ││ 689 │ 689 ││ 690 │ 690 ││ 691 │ 691 ││ 692 │ 692 ││ 693 │ 693 ││ 694 │ 694 ││ 695 │ 695 ││ 696 │ 696 ││ 697 │ 697 ││ 698 │ 698 ││ 699 │ 699 ││ 700 │ 700 ││ 701 │ 701 ││ 702 │ 702 ││ 703 │ 703 ││ 704 │ 704 ││ 705 │ 705 ││ 706 │ 706 ││ 707 │ 707 ││ 708 │ 708 ││ 709 │ 709 ││ 710 │ 710 ││ 711 │ 711 ││ 712 │ 712 ││ 713 │ 713 ││ 714 │ 714 ││ 715 │ 715 ││ 716 │ 716 ││ 717 │ 717 ││ 718 │ 718 ││ 719 │ 719 ││ 720 │ 720 ││ 721 │ 721 ││ 722 │ 722 ││ 723 │ 723 ││ 724 │ 724 ││ 725 │ 725 ││ 726 │ 726 ││ 727 │ 727 ││ 728 │ 728 ││ 729 │ 729 ││ 730 │ 730 ││ 731 │ 731 ││ 732 │ 732 ││ 733 │ 733 ││ 734 │ 734 ││ 735 │ 735 ││ 736 │ 736 ││ 737 │ 737 ││ 738 │ 738 ││ 739 │ 739 ││ 740 │ 740 ││ 741 │ 741 ││ 742 │ 742 ││ 743 │ 743 ││ 744 │ 744 ││ 745 │ 745 ││ 746 │ 746 ││ 747 │ 747 ││ 748 │ 748 ││ 749 │ 749 ││ 750 │ 750 ││ 751 │ 751 ││ 752 │ 752 ││ 753 │ 753 ││ 754 │ 754 ││ 755 │ 755 ││ 756 │ 756 ││ 757 │ 757 ││ 758 │ 758 ││ 759 │ 759 ││ 760 │ 760 ││ 761 │ 761 ││ 762 │ 762 ││ 763 │ 763 ││ 764 │ 764 ││ 765 │ 765 ││ 766 │ 766 ││ 767 │ 767 ││ 768 │ 768 ││ 769 │ 769 ││ 770 │ 770 ││ 771 │ 771 ││ 772 │ 772 ││ 773 │ 773 ││ 774 │ 774 ││ 775 │ 775 ││ 776 │ 776 ││ 777 │ 777 ││ 778 │ 778 ││ 779 │ 779 ││ 780 │ 780 ││ 781 │ 781 ││ 782 │ 782 ││ 783 │ 783 ││ 784 │ 784 ││ 785 │ 785 ││ 786 │ 786 ││ 787 │ 787 ││ 788 │ 788 ││ 789 │ 789 ││ 790 │ 790 ││ 791 │ 791 ││ 792 │ 792 ││ 793 │ 793 ││ 794 │ 794 ││ 795 │ 795 ││ 796 │ 796 ││ 797 │ 797 ││ 798 │ 798 ││ 799 │ 799 ││ 800 │ 800 ││ 801 │ 801 ││ 802 │ 802 ││ 803 │ 803 ││ 804 │ 804 ││ 805 │ 805 ││ 806 │ 806 ││ 807 │ 807 ││ 808 │ 808 ││ 809 │ 809 ││ 810 │ 810 ││ 811 │ 811 ││ 812 │ 812 ││ 813 │ 813 ││ 814 │ 814 ││ 815 │ 815 ││ 816 │ 816 ││ 817 │ 817 ││ 818 │ 818 ││ 819 │ 819 ││ 820 │ 820 ││ 821 │ 821 ││ 822 │ 822 ││ 823 │ 823 ││ 824 │ 824 ││ 825 │ 825 ││ 826 │ 826 ││ 827 │ 827 ││ 828 │ 828 ││ 829 │ 829 ││ 830 │ 830 ││ 831 │ 831 ││ 832 │ 832 ││ 833 │ 833 ││ 834 │ 834 ││ 835 │ 835 ││ 836 │ 836 ││ 837 │ 837 ││ 838 │ 838 ││ 839 │ 839 ││ 840 │ 840 ││ 841 │ 841 ││ 842 │ 842 ││ 843 │ 843 ││ 844 │ 844 ││ 845 │ 845 ││ 846 │ 846 ││ 847 │ 847 ││ 848 │ 848 ││ 849 │ 849 ││ 850 │ 850 ││ 851 │ 851 ││ 852 │ 852 ││ 853 │ 853 ││ 854 │ 854 ││ 855 │ 855 ││ 856 │ 856 ││ 857 │ 857 ││ 858 │ 858 ││ 859 │ 859 ││ 860 │ 860 ││ 861 │ 861 ││ 862 │ 862 ││ 863 │ 863 ││ 864 │ 864 ││ 865 │ 865 ││ 866 │ 866 ││ 867 │ 867 ││ 868 │ 868 ││ 869 │ 869 ││ 870 │ 870 ││ 871 │ 871 ││ 872 │ 872 ││ 873 │ 873 ││ 874 │ 874 ││ 875 │ 875 ││ 876 │ 876 ││ 877 │ 877 ││ 878 │ 878 ││ 879 │ 879 ││ 880 │ 880 ││ 881 │ 881 ││ 882 │ 882 ││ 883 │ 883 ││ 884 │ 884 ││ 885 │ 885 ││ 886 │ 886 ││ 887 │ 887 ││ 888 │ 888 ││ 889 │ 889 ││ 890 │ 890 ││ 891 │ 891 ││ 892 │ 892 ││ 893 │ 893 ││ 894 │ 894 ││ 895 │ 895 ││ 896 │ 896 ││ 897 │ 897 ││ 898 │ 898 ││ 899 │ 899 ││ 900 │ 900 ││ 901 │ 901 ││ 902 │ 902 ││ 903 │ 903 ││ 904 │ 904 ││ 905 │ 905 ││ 906 │ 906 ││ 907 │ 907 ││ 908 │ 908 ││ 909 │ 909 ││ 910 │ 910 ││ 911 │ 911 ││ 912 │ 912 ││ 913 │ 913 ││ 914 │ 914 ││ 915 │ 915 ││ 916 │ 916 ││ 917 │ 917 ││ 918 │ 918 ││ 919 │ 919 ││ 920 │ 920 ││ 921 │ 921 ││ 922 │ 922 ││ 923 │ 923 ││ 924 │ 924 ││ 925 │ 925 ││ 926 │ 926 ││ 927 │ 927 ││ 928 │ 928 ││ 929 │ 929 ││ 930 │ 930 ││ 931 │ 931 ││ 932 │ 932 ││ 933 │ 933 ││ 934 │ 934 ││ 935 │ 935 ││ 936 │ 936 ││ 937 │ 937 ││ 938 │ 938 ││ 939 │ 939 ││ 940 │ 940 ││ 941 │ 941 ││ 942 │ 942 ││ 943 │ 943 ││ 944 │ 944 ││ 945 │ 945 ││ 946 │ 946 ││ 947 │ 947 ││ 948 │ 948 ││ 949 │ 949 ││ 950 │ 950 ││ 951 │ 951 ││ 952 │ 952 ││ 953 │ 953 ││ 954 │ 954 ││ 955 │ 955 ││ 956 │ 956 ││ 957 │ 957 ││ 958 │ 958 ││ 959 │ 959 ││ 960 │ 960 ││ 961 │ 961 ││ 962 │ 962 ││ 963 │ 963 ││ 964 │ 964 ││ 965 │ 965 ││ 966 │ 966 ││ 967 │ 967 ││ 968 │ 968 ││ 969 │ 969 ││ 970 │ 970 ││ 971 │ 971 ││ 972 │ 972 ││ 973 │ 973 ││ 974 │ 974 ││ 975 │ 975 ││ 976 │ 976 ││ 977 │ 977 ││ 978 │ 978 ││ 979 │ 979 ││ 980 │ 980 ││ 981 │ 981 ││ 982 │ 982 ││ 983 │ 983 ││ 984 │ 984 ││ 985 │ 985 ││ 986 │ 986 ││ 987 │ 987 ││ 988 │ 988 ││ 989 │ 989 ││ 990 │ 990 ││ 991 │ 991 ││ 992 │ 992 ││ 993 │ 993 ││ 994 │ 994 ││ 995 │ 995 ││ 996 │ 996 ││ 997 │ 997 ││ 998 │ 998 ││ 999 │ 999 │╰─────┴─────╯╭──────┬──────╮│ 1000 │ 1000 │╰──────┴──────╯" + ); } #[test] @@ -544,7 +547,7 @@ fn test_expand_big_0() { default-run = "nu" description = "A new type of shell" documentation = "https://www.nushell.sh/book/" - edition = "2021" + edition = "2024" exclude = ["images"] homepage = "https://www.nushell.sh" license = "MIT" @@ -675,7 +678,7 @@ fn test_expand_big_0() { "│ │ │ default-run │ nu │ │", "│ │ │ description │ A new type of shell │ │", "│ │ │ documentation │ https://www.nushell.sh/book/ │ │", - "│ │ │ edition │ 2021 │ │", + "│ │ │ edition │ 2024 │ │", "│ │ │ │ ╭───┬────────╮ │ │", "│ │ │ exclude │ │ 0 │ images │ │ │", "│ │ │ │ ╰───┴────────╯ │ │", @@ -865,7 +868,7 @@ fn test_expand_big_0() { "│ │ │ default-run │ nu │ │", "│ │ │ description │ A new type of shell │ │", "│ │ │ documentation │ https://www.nushell.sh/book/ │ │", - "│ │ │ edition │ 2021 │ │", + "│ │ │ edition │ 2024 │ │", "│ │ │ │ ╭───┬────────╮ │ │", "│ │ │ exclude │ │ 0 │ images │ │ │", "│ │ │ │ ╰───┴────────╯ │ │", @@ -1065,7 +1068,7 @@ fn test_expand_big_0() { "│ │ │ │ shell │ │", "│ │ │ documentation │ https://www.nushe │ │", "│ │ │ │ ll.sh/book/ │ │", - "│ │ │ edition │ 2021 │ │", + "│ │ │ edition │ 2024 │ │", "│ │ │ │ ╭───┬────────╮ │ │", "│ │ │ exclude │ │ 0 │ images │ │ │", "│ │ │ │ ╰───┴────────╯ │ │", @@ -2470,7 +2473,7 @@ fn test_collapse_big_0() { default-run = "nu" description = "A new type of shell" documentation = "https://www.nushell.sh/book/" - edition = "2021" + edition = "2024" exclude = ["images"] homepage = "https://www.nushell.sh" license = "MIT" @@ -2603,7 +2606,7 @@ fn test_collapse_big_0() { "│ ├───────────────┼───────────────────────────────────────────┤", "│ │ documentation │ https://www.nushell.sh/book/ │", "│ ├───────────────┼───────────────────────────────────────────┤", - "│ │ edition │ 2021 │", + "│ │ edition │ 2024 │", "│ ├───────────────┼───────────────────────────────────────────┤", "│ │ exclude │ images │", "│ ├───────────────┼───────────────────────────────────────────┤", @@ -2793,7 +2796,7 @@ fn test_collapse_big_0() { "│ ├───────────────┼──────────────────────────────────────────────────────────────────────────┤", "│ │ documentation │ https://www.nushell.sh/book/ │", "│ ├───────────────┼──────────────────────────────────────────────────────────────────────────┤", - "│ │ edition │ 2021 │", + "│ │ edition │ 2024 │", "│ ├───────────────┼──────────────────────────────────────────────────────────────────────────┤", "│ │ exclude │ images │", "│ ├───────────────┼──────────────────────────────────────────────────────────────────────────┤", @@ -3210,7 +3213,9 @@ fn theme_cmd(theme: &str, footer: bool, then: &str) -> String { with_footer = "$env.config.footer_mode = \"always\"".to_string(); } - format!("$env.config.table.mode = \"{theme}\"; $env.config.table.header_on_separator = true; {with_footer}; {then}") + format!( + "$env.config.table.mode = \"{theme}\"; $env.config.table.header_on_separator = true; {with_footer}; {then}" + ) } #[test] @@ -3266,7 +3271,9 @@ fn table_expand_padding_not_default() { #[test] fn table_expand_padding_zero() { - let actual = nu!("$env.config.table.padding = {left: 0, right: 0}; [[a b, c]; [1 2 3] [4 5 [1 2 3]]] | table --width=80 -e"); + let actual = nu!( + "$env.config.table.padding = {left: 0, right: 0}; [[a b, c]; [1 2 3] [4 5 [1 2 3]]] | table --width=80 -e" + ); assert_eq!( actual.out, "╭─┬─┬─┬─────╮\ @@ -3305,7 +3312,9 @@ fn table_collapse_padding_not_default() { #[test] fn table_collapse_padding_zero() { - let actual = nu!("$env.config.table.padding = {left: 0, right: 0}; [[a b, c]; [1 2 3] [4 5 [1 2 3]]] | table --width=80 -c"); + let actual = nu!( + "$env.config.table.padding = {left: 0, right: 0}; [[a b, c]; [1 2 3] [4 5 [1 2 3]]] | table --width=80 -c" + ); assert_eq!( actual.out, "╭─┬─┬─╮\ @@ -3349,17 +3358,26 @@ fn table_abbreviation() { let actual = nu!( r#"[[a b, c]; [1 2 3] [4 5 [1 2 3]] [1 2 3] [1 2 3] [1 2 3] [1 2 3] [1 2 3]] | table --width=80 -a 100"# ); - assert_eq!(actual.out, "╭───┬───┬───┬────────────────╮│ # │ a │ b │ c │├───┼───┼───┼────────────────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ 4 │ 5 │ [list 3 items] ││ 2 │ 1 │ 2 │ 3 ││ 3 │ 1 │ 2 │ 3 ││ 4 │ 1 │ 2 │ 3 ││ 5 │ 1 │ 2 │ 3 ││ 6 │ 1 │ 2 │ 3 │╰───┴───┴───┴────────────────╯"); + assert_eq!( + actual.out, + "╭───┬───┬───┬────────────────╮│ # │ a │ b │ c │├───┼───┼───┼────────────────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ 4 │ 5 │ [list 3 items] ││ 2 │ 1 │ 2 │ 3 ││ 3 │ 1 │ 2 │ 3 ││ 4 │ 1 │ 2 │ 3 ││ 5 │ 1 │ 2 │ 3 ││ 6 │ 1 │ 2 │ 3 │╰───┴───┴───┴────────────────╯" + ); let actual = nu!( r#"[[a b, c]; [1 2 3] [4 5 [1 2 3]] [1 2 3] [1 2 3] [1 2 3] [1 2 3] [1 2 3]] | table --width=80 -a 2"# ); - assert_eq!(actual.out, "╭───┬─────┬─────┬────────────────╮│ # │ a │ b │ c │├───┼─────┼─────┼────────────────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ 4 │ 5 │ [list 3 items] ││ 2 │ ... │ ... │ ... ││ 3 │ 1 │ 2 │ 3 ││ 4 │ 1 │ 2 │ 3 │╰───┴─────┴─────┴────────────────╯"); + assert_eq!( + actual.out, + "╭───┬─────┬─────┬────────────────╮│ # │ a │ b │ c │├───┼─────┼─────┼────────────────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ 4 │ 5 │ [list 3 items] ││ 2 │ ... │ ... │ ... ││ 3 │ 1 │ 2 │ 3 ││ 4 │ 1 │ 2 │ 3 │╰───┴─────┴─────┴────────────────╯" + ); let actual = nu!( r#"[[a b, c]; [1 2 3] [4 5 [1 2 3]] [1 2 3] [1 2 3] [1 2 3] [1 2 3] [1 2 3]] | table --width=80 -a 1"# ); - assert_eq!(actual.out, "╭───┬─────┬─────┬─────╮│ # │ a │ b │ c │├───┼─────┼─────┼─────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ ... │ ... │ ... ││ 2 │ 1 │ 2 │ 3 │╰───┴─────┴─────┴─────╯"); + assert_eq!( + actual.out, + "╭───┬─────┬─────┬─────╮│ # │ a │ b │ c │├───┼─────┼─────┼─────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ ... │ ... │ ... ││ 2 │ 1 │ 2 │ 3 │╰───┴─────┴─────┴─────╯" + ); let actual = nu!( r#"[[a b, c]; [1 2 3] [4 5 [1 2 3]] [1 2 3] [1 2 3] [1 2 3] [1 2 3] [1 2 3]] | table --width=80 -a 0"# @@ -3372,12 +3390,18 @@ fn table_abbreviation_kv() { let actual = nu!( r#"{ a: 1 b: { a: 1 b: [1 2 3] c: [1 2 3] } c: [1 2 [1 2 3] 3] e: 1 q: 2 t: 4 r: 1 x: 9 } | table --width=80 -a 100"# ); - assert_eq!(actual.out, "╭───┬───────────────────╮│ a │ 1 ││ b │ {record 3 fields} ││ c │ [list 4 items] ││ e │ 1 ││ q │ 2 ││ t │ 4 ││ r │ 1 ││ x │ 9 │╰───┴───────────────────╯"); + assert_eq!( + actual.out, + "╭───┬───────────────────╮│ a │ 1 ││ b │ {record 3 fields} ││ c │ [list 4 items] ││ e │ 1 ││ q │ 2 ││ t │ 4 ││ r │ 1 ││ x │ 9 │╰───┴───────────────────╯" + ); let actual = nu!( r#"{ a: 1 b: { a: 1 b: [1 2 3] c: [1 2 3] } c: [1 2 [1 2 3] 3] e: 1 q: 2 t: 4 r: 1 x: 9 } | table --width=80 -a 2"# ); - assert_eq!(actual.out, "╭─────┬───────────────────╮│ a │ 1 ││ b │ {record 3 fields} ││ ... │ ... ││ r │ 1 ││ x │ 9 │╰─────┴───────────────────╯"); + assert_eq!( + actual.out, + "╭─────┬───────────────────╮│ a │ 1 ││ b │ {record 3 fields} ││ ... │ ... ││ r │ 1 ││ x │ 9 │╰─────┴───────────────────╯" + ); let actual = nu!( r#"{ a: 1 b: { a: 1 b: [1 2 3] c: [1 2 3] } c: [1 2 [1 2 3] 3] e: 1 q: 2 t: 4 r: 1 x: 9 } | table --width=80 -a 1"# @@ -3398,12 +3422,18 @@ fn table_abbreviation_kv_expand() { let actual = nu!( r#"{ a: 1 b: { a: 1 b: [1 2 3] c: [1 2 3] } c: [1 2 [1 2 3] 3] e: 1 q: 2 t: 4 r: 1 x: 9 } | table --width=80 -a 100 -e"# ); - assert_eq!(actual.out, "╭───┬───────────────────╮│ a │ 1 ││ │ ╭───┬───────────╮ ││ b │ │ a │ 1 │ ││ │ │ │ ╭───┬───╮ │ ││ │ │ b │ │ 0 │ 1 │ │ ││ │ │ │ │ 1 │ 2 │ │ ││ │ │ │ │ 2 │ 3 │ │ ││ │ │ │ ╰───┴───╯ │ ││ │ │ │ ╭───┬───╮ │ ││ │ │ c │ │ 0 │ 1 │ │ ││ │ │ │ │ 1 │ 2 │ │ ││ │ │ │ │ 2 │ 3 │ │ ││ │ │ │ ╰───┴───╯ │ ││ │ ╰───┴───────────╯ ││ │ ╭───┬───────────╮ ││ c │ │ 0 │ 1 │ ││ │ │ 1 │ 2 │ ││ │ │ 2 │ ╭───┬───╮ │ ││ │ │ │ │ 0 │ 1 │ │ ││ │ │ │ │ 1 │ 2 │ │ ││ │ │ │ │ 2 │ 3 │ │ ││ │ │ │ ╰───┴───╯ │ ││ │ │ 3 │ 3 │ ││ │ ╰───┴───────────╯ ││ e │ 1 ││ q │ 2 ││ t │ 4 ││ r │ 1 ││ x │ 9 │╰───┴───────────────────╯"); + assert_eq!( + actual.out, + "╭───┬───────────────────╮│ a │ 1 ││ │ ╭───┬───────────╮ ││ b │ │ a │ 1 │ ││ │ │ │ ╭───┬───╮ │ ││ │ │ b │ │ 0 │ 1 │ │ ││ │ │ │ │ 1 │ 2 │ │ ││ │ │ │ │ 2 │ 3 │ │ ││ │ │ │ ╰───┴───╯ │ ││ │ │ │ ╭───┬───╮ │ ││ │ │ c │ │ 0 │ 1 │ │ ││ │ │ │ │ 1 │ 2 │ │ ││ │ │ │ │ 2 │ 3 │ │ ││ │ │ │ ╰───┴───╯ │ ││ │ ╰───┴───────────╯ ││ │ ╭───┬───────────╮ ││ c │ │ 0 │ 1 │ ││ │ │ 1 │ 2 │ ││ │ │ 2 │ ╭───┬───╮ │ ││ │ │ │ │ 0 │ 1 │ │ ││ │ │ │ │ 1 │ 2 │ │ ││ │ │ │ │ 2 │ 3 │ │ ││ │ │ │ ╰───┴───╯ │ ││ │ │ 3 │ 3 │ ││ │ ╰───┴───────────╯ ││ e │ 1 ││ q │ 2 ││ t │ 4 ││ r │ 1 ││ x │ 9 │╰───┴───────────────────╯" + ); let actual = nu!( r#"{ a: 1 b: { a: 1 b: [1 2 3] c: [1 2 3] } c: [1 2 [1 2 3] 3] e: 1 q: 2 t: 4 r: 1 x: 9 } | table --width=80 -a 2 -e"# ); - assert_eq!(actual.out, "╭─────┬───────────────────╮│ a │ 1 ││ │ ╭───┬───────────╮ ││ b │ │ a │ 1 │ ││ │ │ │ ╭───┬───╮ │ ││ │ │ b │ │ 0 │ 1 │ │ ││ │ │ │ │ 1 │ 2 │ │ ││ │ │ │ │ 2 │ 3 │ │ ││ │ │ │ ╰───┴───╯ │ ││ │ │ │ ╭───┬───╮ │ ││ │ │ c │ │ 0 │ 1 │ │ ││ │ │ │ │ 1 │ 2 │ │ ││ │ │ │ │ 2 │ 3 │ │ ││ │ │ │ ╰───┴───╯ │ ││ │ ╰───┴───────────╯ ││ ... │ ... ││ r │ 1 ││ x │ 9 │╰─────┴───────────────────╯"); + assert_eq!( + actual.out, + "╭─────┬───────────────────╮│ a │ 1 ││ │ ╭───┬───────────╮ ││ b │ │ a │ 1 │ ││ │ │ │ ╭───┬───╮ │ ││ │ │ b │ │ 0 │ 1 │ │ ││ │ │ │ │ 1 │ 2 │ │ ││ │ │ │ │ 2 │ 3 │ │ ││ │ │ │ ╰───┴───╯ │ ││ │ │ │ ╭───┬───╮ │ ││ │ │ c │ │ 0 │ 1 │ │ ││ │ │ │ │ 1 │ 2 │ │ ││ │ │ │ │ 2 │ 3 │ │ ││ │ │ │ ╰───┴───╯ │ ││ │ ╰───┴───────────╯ ││ ... │ ... ││ r │ 1 ││ x │ 9 │╰─────┴───────────────────╯" + ); let actual = nu!( r#"{ a: 1 b: { a: 1 b: [1 2 3] c: [1 2 3] } c: [1 2 [1 2 3] 3] e: 1 q: 2 t: 4 r: 1 x: 9 } | table --width=80 -a 1 -e"# @@ -3424,17 +3454,26 @@ fn table_abbreviation_by_config() { let actual = nu!( r#"$env.config.table.abbreviated_row_count = 100; [[a b, c]; [1 2 3] [4 5 [1 2 3]] [1 2 3] [1 2 3] [1 2 3] [1 2 3] [1 2 3]] | table --width=80"# ); - assert_eq!(actual.out, "╭───┬───┬───┬────────────────╮│ # │ a │ b │ c │├───┼───┼───┼────────────────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ 4 │ 5 │ [list 3 items] ││ 2 │ 1 │ 2 │ 3 ││ 3 │ 1 │ 2 │ 3 ││ 4 │ 1 │ 2 │ 3 ││ 5 │ 1 │ 2 │ 3 ││ 6 │ 1 │ 2 │ 3 │╰───┴───┴───┴────────────────╯"); + assert_eq!( + actual.out, + "╭───┬───┬───┬────────────────╮│ # │ a │ b │ c │├───┼───┼───┼────────────────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ 4 │ 5 │ [list 3 items] ││ 2 │ 1 │ 2 │ 3 ││ 3 │ 1 │ 2 │ 3 ││ 4 │ 1 │ 2 │ 3 ││ 5 │ 1 │ 2 │ 3 ││ 6 │ 1 │ 2 │ 3 │╰───┴───┴───┴────────────────╯" + ); let actual = nu!( r#"$env.config.table.abbreviated_row_count = 2; [[a b, c]; [1 2 3] [4 5 [1 2 3]] [1 2 3] [1 2 3] [1 2 3] [1 2 3] [1 2 3]] | table --width=80"# ); - assert_eq!(actual.out, "╭───┬─────┬─────┬────────────────╮│ # │ a │ b │ c │├───┼─────┼─────┼────────────────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ 4 │ 5 │ [list 3 items] ││ 2 │ ... │ ... │ ... ││ 3 │ 1 │ 2 │ 3 ││ 4 │ 1 │ 2 │ 3 │╰───┴─────┴─────┴────────────────╯"); + assert_eq!( + actual.out, + "╭───┬─────┬─────┬────────────────╮│ # │ a │ b │ c │├───┼─────┼─────┼────────────────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ 4 │ 5 │ [list 3 items] ││ 2 │ ... │ ... │ ... ││ 3 │ 1 │ 2 │ 3 ││ 4 │ 1 │ 2 │ 3 │╰───┴─────┴─────┴────────────────╯" + ); let actual = nu!( r#"$env.config.table.abbreviated_row_count = 1; [[a b, c]; [1 2 3] [4 5 [1 2 3]] [1 2 3] [1 2 3] [1 2 3] [1 2 3] [1 2 3]] | table --width=80"# ); - assert_eq!(actual.out, "╭───┬─────┬─────┬─────╮│ # │ a │ b │ c │├───┼─────┼─────┼─────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ ... │ ... │ ... ││ 2 │ 1 │ 2 │ 3 │╰───┴─────┴─────┴─────╯"); + assert_eq!( + actual.out, + "╭───┬─────┬─────┬─────╮│ # │ a │ b │ c │├───┼─────┼─────┼─────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ ... │ ... │ ... ││ 2 │ 1 │ 2 │ 3 │╰───┴─────┴─────┴─────╯" + ); let actual = nu!( r#"$env.config.table.abbreviated_row_count = 0; [[a b, c]; [1 2 3] [4 5 [1 2 3]] [1 2 3] [1 2 3] [1 2 3] [1 2 3] [1 2 3]] | table --width=80"# @@ -3447,12 +3486,18 @@ fn table_abbreviation_by_config_override() { let actual = nu!( r#"$env.config.table.abbreviated_row_count = 2; [[a b, c]; [1 2 3] [4 5 [1 2 3]] [1 2 3] [1 2 3] [1 2 3] [1 2 3] [1 2 3]] | table --width=80 -a 1"# ); - assert_eq!(actual.out, "╭───┬─────┬─────┬─────╮│ # │ a │ b │ c │├───┼─────┼─────┼─────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ ... │ ... │ ... ││ 2 │ 1 │ 2 │ 3 │╰───┴─────┴─────┴─────╯"); + assert_eq!( + actual.out, + "╭───┬─────┬─────┬─────╮│ # │ a │ b │ c │├───┼─────┼─────┼─────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ ... │ ... │ ... ││ 2 │ 1 │ 2 │ 3 │╰───┴─────┴─────┴─────╯" + ); let actual = nu!( r#"$env.config.table.abbreviated_row_count = 1; [[a b, c]; [1 2 3] [4 5 [1 2 3]] [1 2 3] [1 2 3] [1 2 3] [1 2 3] [1 2 3]] | table --width=80 -a 2"# ); - assert_eq!(actual.out, "╭───┬─────┬─────┬────────────────╮│ # │ a │ b │ c │├───┼─────┼─────┼────────────────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ 4 │ 5 │ [list 3 items] ││ 2 │ ... │ ... │ ... ││ 3 │ 1 │ 2 │ 3 ││ 4 │ 1 │ 2 │ 3 │╰───┴─────┴─────┴────────────────╯"); + assert_eq!( + actual.out, + "╭───┬─────┬─────┬────────────────╮│ # │ a │ b │ c │├───┼─────┼─────┼────────────────┤│ 0 │ 1 │ 2 │ 3 ││ 1 │ 4 │ 5 │ [list 3 items] ││ 2 │ ... │ ... │ ... ││ 3 │ 1 │ 2 │ 3 ││ 4 │ 1 │ 2 │ 3 │╰───┴─────┴─────┴────────────────╯" + ); } #[test] @@ -3467,7 +3512,10 @@ fn table_abbreviation_cut() { ); let actual = nu!(r#"0..2000 | table --width=80 -a 3"#); - assert_eq!(actual.out, "╭───┬──────╮│ 0 │ 0 ││ 1 │ 1 ││ 2 │ 2 ││ 3 │ ... ││ 4 │ 1998 ││ 5 │ 1999 ││ 6 │ 2000 │╰───┴──────╯"); + assert_eq!( + actual.out, + "╭───┬──────╮│ 0 │ 0 ││ 1 │ 1 ││ 2 │ 2 ││ 3 │ ... ││ 4 │ 1998 ││ 5 │ 1999 ││ 6 │ 2000 │╰───┴──────╯" + ); let output = "╭──────┬──────╮│ 0 │ 0 ││ 1 │ 1 ││ 2 │ 2 ││ 3 │ 3 ││ 4 │ 4 ││ 5 │ 5 ││ 6 │ 6 ││ 7 │ 7 ││ 8 │ 8 ││ 9 │ 9 ││ 10 │ 10 ││ 11 │ 11 ││ 12 │ 12 ││ 13 │ 13 ││ 14 │ 14 ││ 15 │ 15 ││ 16 │ 16 ││ 17 │ 17 ││ 18 │ 18 ││ 19 │ 19 ││ 20 │ 20 ││ 21 │ 21 ││ 22 │ 22 ││ 23 │ 23 ││ 24 │ 24 ││ 25 │ 25 ││ 26 │ 26 ││ 27 │ 27 ││ 28 │ 28 ││ 29 │ 29 ││ 30 │ 30 ││ 31 │ 31 ││ 32 │ 32 ││ 33 │ 33 ││ 34 │ 34 ││ 35 │ 35 ││ 36 │ 36 ││ 37 │ 37 ││ 38 │ 38 ││ 39 │ 39 ││ 40 │ 40 ││ 41 │ 41 ││ 42 │ 42 ││ 43 │ 43 ││ 44 │ 44 ││ 45 │ 45 ││ 46 │ 46 ││ 47 │ 47 ││ 48 │ 48 ││ 49 │ 49 ││ 50 │ 50 ││ 51 │ 51 ││ 52 │ 52 ││ 53 │ 53 ││ 54 │ 54 ││ 55 │ 55 ││ 56 │ 56 ││ 57 │ 57 ││ 58 │ 58 ││ 59 │ 59 ││ 60 │ 60 ││ 61 │ 61 ││ 62 │ 62 ││ 63 │ 63 ││ 64 │ 64 ││ 65 │ 65 ││ 66 │ 66 ││ 67 │ 67 ││ 68 │ 68 ││ 69 │ 69 ││ 70 │ 70 ││ 71 │ 71 ││ 72 │ 72 ││ 73 │ 73 ││ 74 │ 74 ││ 75 │ 75 ││ 76 │ 76 ││ 77 │ 77 ││ 78 │ 78 ││ 79 │ 79 ││ 80 │ 80 ││ 81 │ 81 ││ 82 │ 82 ││ 83 │ 83 ││ 84 │ 84 ││ 85 │ 85 ││ 86 │ 86 ││ 87 │ 87 ││ 88 │ 88 ││ 89 │ 89 ││ 90 │ 90 ││ 91 │ 91 ││ 92 │ 92 ││ 93 │ 93 ││ 94 │ 94 ││ 95 │ 95 ││ 96 │ 96 ││ 97 │ 97 ││ 98 │ 98 ││ 99 │ 99 ││ 100 │ 100 ││ 101 │ 101 ││ 102 │ 102 ││ 103 │ 103 ││ 104 │ 104 ││ 105 │ 105 ││ 106 │ 106 ││ 107 │ 107 ││ 108 │ 108 ││ 109 │ 109 ││ 110 │ 110 ││ 111 │ 111 ││ 112 │ 112 ││ 113 │ 113 ││ 114 │ 114 ││ 115 │ 115 ││ 116 │ 116 ││ 117 │ 117 ││ 118 │ 118 ││ 119 │ 119 ││ 120 │ 120 ││ 121 │ 121 ││ 122 │ 122 ││ 123 │ 123 ││ 124 │ 124 ││ 125 │ 125 ││ 126 │ 126 ││ 127 │ 127 ││ 128 │ 128 ││ 129 │ 129 ││ 130 │ 130 ││ 131 │ 131 ││ 132 │ 132 ││ 133 │ 133 ││ 134 │ 134 ││ 135 │ 135 ││ 136 │ 136 ││ 137 │ 137 ││ 138 │ 138 ││ 139 │ 139 ││ 140 │ 140 ││ 141 │ 141 ││ 142 │ 142 ││ 143 │ 143 ││ 144 │ 144 ││ 145 │ 145 ││ 146 │ 146 ││ 147 │ 147 ││ 148 │ 148 ││ 149 │ 149 ││ 150 │ 150 ││ 151 │ 151 ││ 152 │ 152 ││ 153 │ 153 ││ 154 │ 154 ││ 155 │ 155 ││ 156 │ 156 ││ 157 │ 157 ││ 158 │ 158 ││ 159 │ 159 ││ 160 │ 160 ││ 161 │ 161 ││ 162 │ 162 ││ 163 │ 163 ││ 164 │ 164 ││ 165 │ 165 ││ 166 │ 166 ││ 167 │ 167 ││ 168 │ 168 ││ 169 │ 169 ││ 170 │ 170 ││ 171 │ 171 ││ 172 │ 172 ││ 173 │ 173 ││ 174 │ 174 ││ 175 │ 175 ││ 176 │ 176 ││ 177 │ 177 ││ 178 │ 178 ││ 179 │ 179 ││ 180 │ 180 ││ 181 │ 181 ││ 182 │ 182 ││ 183 │ 183 ││ 184 │ 184 ││ 185 │ 185 ││ 186 │ 186 ││ 187 │ 187 ││ 188 │ 188 ││ 189 │ 189 ││ 190 │ 190 ││ 191 │ 191 ││ 192 │ 192 ││ 193 │ 193 ││ 194 │ 194 ││ 195 │ 195 ││ 196 │ 196 ││ 197 │ 197 ││ 198 │ 198 ││ 199 │ 199 ││ 200 │ 200 ││ 201 │ 201 ││ 202 │ 202 ││ 203 │ 203 ││ 204 │ 204 ││ 205 │ 205 ││ 206 │ 206 ││ 207 │ 207 ││ 208 │ 208 ││ 209 │ 209 ││ 210 │ 210 ││ 211 │ 211 ││ 212 │ 212 ││ 213 │ 213 ││ 214 │ 214 ││ 215 │ 215 ││ 216 │ 216 ││ 217 │ 217 ││ 218 │ 218 ││ 219 │ 219 ││ 220 │ 220 ││ 221 │ 221 ││ 222 │ 222 ││ 223 │ 223 ││ 224 │ 224 ││ 225 │ 225 ││ 226 │ 226 ││ 227 │ 227 ││ 228 │ 228 ││ 229 │ 229 ││ 230 │ 230 ││ 231 │ 231 ││ 232 │ 232 ││ 233 │ 233 ││ 234 │ 234 ││ 235 │ 235 ││ 236 │ 236 ││ 237 │ 237 ││ 238 │ 238 ││ 239 │ 239 ││ 240 │ 240 ││ 241 │ 241 ││ 242 │ 242 ││ 243 │ 243 ││ 244 │ 244 ││ 245 │ 245 ││ 246 │ 246 ││ 247 │ 247 ││ 248 │ 248 ││ 249 │ 249 ││ 250 │ 250 ││ 251 │ 251 ││ 252 │ 252 ││ 253 │ 253 ││ 254 │ 254 ││ 255 │ 255 ││ 256 │ 256 ││ 257 │ 257 ││ 258 │ 258 ││ 259 │ 259 ││ 260 │ 260 ││ 261 │ 261 ││ 262 │ 262 ││ 263 │ 263 ││ 264 │ 264 ││ 265 │ 265 ││ 266 │ 266 ││ 267 │ 267 ││ 268 │ 268 ││ 269 │ 269 ││ 270 │ 270 ││ 271 │ 271 ││ 272 │ 272 ││ 273 │ 273 ││ 274 │ 274 ││ 275 │ 275 ││ 276 │ 276 ││ 277 │ 277 ││ 278 │ 278 ││ 279 │ 279 ││ 280 │ 280 ││ 281 │ 281 ││ 282 │ 282 ││ 283 │ 283 ││ 284 │ 284 ││ 285 │ 285 ││ 286 │ 286 ││ 287 │ 287 ││ 288 │ 288 ││ 289 │ 289 ││ 290 │ 290 ││ 291 │ 291 ││ 292 │ 292 ││ 293 │ 293 ││ 294 │ 294 ││ 295 │ 295 ││ 296 │ 296 ││ 297 │ 297 ││ 298 │ 298 ││ 299 │ 299 ││ 300 │ 300 ││ 301 │ 301 ││ 302 │ 302 ││ 303 │ 303 ││ 304 │ 304 ││ 305 │ 305 ││ 306 │ 306 ││ 307 │ 307 ││ 308 │ 308 ││ 309 │ 309 ││ 310 │ 310 ││ 311 │ 311 ││ 312 │ 312 ││ 313 │ 313 ││ 314 │ 314 ││ 315 │ 315 ││ 316 │ 316 ││ 317 │ 317 ││ 318 │ 318 ││ 319 │ 319 ││ 320 │ 320 ││ 321 │ 321 ││ 322 │ 322 ││ 323 │ 323 ││ 324 │ 324 ││ 325 │ 325 ││ 326 │ 326 ││ 327 │ 327 ││ 328 │ 328 ││ 329 │ 329 ││ 330 │ 330 ││ 331 │ 331 ││ 332 │ 332 ││ 333 │ 333 ││ 334 │ 334 ││ 335 │ 335 ││ 336 │ 336 ││ 337 │ 337 ││ 338 │ 338 ││ 339 │ 339 ││ 340 │ 340 ││ 341 │ 341 ││ 342 │ 342 ││ 343 │ 343 ││ 344 │ 344 ││ 345 │ 345 ││ 346 │ 346 ││ 347 │ 347 ││ 348 │ 348 ││ 349 │ 349 ││ 350 │ 350 ││ 351 │ 351 ││ 352 │ 352 ││ 353 │ 353 ││ 354 │ 354 ││ 355 │ 355 ││ 356 │ 356 ││ 357 │ 357 ││ 358 │ 358 ││ 359 │ 359 ││ 360 │ 360 ││ 361 │ 361 ││ 362 │ 362 ││ 363 │ 363 ││ 364 │ 364 ││ 365 │ 365 ││ 366 │ 366 ││ 367 │ 367 ││ 368 │ 368 ││ 369 │ 369 ││ 370 │ 370 ││ 371 │ 371 ││ 372 │ 372 ││ 373 │ 373 ││ 374 │ 374 ││ 375 │ 375 ││ 376 │ 376 ││ 377 │ 377 ││ 378 │ 378 ││ 379 │ 379 ││ 380 │ 380 ││ 381 │ 381 ││ 382 │ 382 ││ 383 │ 383 ││ 384 │ 384 ││ 385 │ 385 ││ 386 │ 386 ││ 387 │ 387 ││ 388 │ 388 ││ 389 │ 389 ││ 390 │ 390 ││ 391 │ 391 ││ 392 │ 392 ││ 393 │ 393 ││ 394 │ 394 ││ 395 │ 395 ││ 396 │ 396 ││ 397 │ 397 ││ 398 │ 398 ││ 399 │ 399 ││ 400 │ 400 ││ 401 │ 401 ││ 402 │ 402 ││ 403 │ 403 ││ 404 │ 404 ││ 405 │ 405 ││ 406 │ 406 ││ 407 │ 407 ││ 408 │ 408 ││ 409 │ 409 ││ 410 │ 410 ││ 411 │ 411 ││ 412 │ 412 ││ 413 │ 413 ││ 414 │ 414 ││ 415 │ 415 ││ 416 │ 416 ││ 417 │ 417 ││ 418 │ 418 ││ 419 │ 419 ││ 420 │ 420 ││ 421 │ 421 ││ 422 │ 422 ││ 423 │ 423 ││ 424 │ 424 ││ 425 │ 425 ││ 426 │ 426 ││ 427 │ 427 ││ 428 │ 428 ││ 429 │ 429 ││ 430 │ 430 ││ 431 │ 431 ││ 432 │ 432 ││ 433 │ 433 ││ 434 │ 434 ││ 435 │ 435 ││ 436 │ 436 ││ 437 │ 437 ││ 438 │ 438 ││ 439 │ 439 ││ 440 │ 440 ││ 441 │ 441 ││ 442 │ 442 ││ 443 │ 443 ││ 444 │ 444 ││ 445 │ 445 ││ 446 │ 446 ││ 447 │ 447 ││ 448 │ 448 ││ 449 │ 449 ││ 450 │ 450 ││ 451 │ 451 ││ 452 │ 452 ││ 453 │ 453 ││ 454 │ 454 ││ 455 │ 455 ││ 456 │ 456 ││ 457 │ 457 ││ 458 │ 458 ││ 459 │ 459 ││ 460 │ 460 ││ 461 │ 461 ││ 462 │ 462 ││ 463 │ 463 ││ 464 │ 464 ││ 465 │ 465 ││ 466 │ 466 ││ 467 │ 467 ││ 468 │ 468 ││ 469 │ 469 ││ 470 │ 470 ││ 471 │ 471 ││ 472 │ 472 ││ 473 │ 473 ││ 474 │ 474 ││ 475 │ 475 ││ 476 │ 476 ││ 477 │ 477 ││ 478 │ 478 ││ 479 │ 479 ││ 480 │ 480 ││ 481 │ 481 ││ 482 │ 482 ││ 483 │ 483 ││ 484 │ 484 ││ 485 │ 485 ││ 486 │ 486 ││ 487 │ 487 ││ 488 │ 488 ││ 489 │ 489 ││ 490 │ 490 ││ 491 │ 491 ││ 492 │ 492 ││ 493 │ 493 ││ 494 │ 494 ││ 495 │ 495 ││ 496 │ 496 ││ 497 │ 497 ││ 498 │ 498 ││ 499 │ 499 ││ 500 │ 500 ││ 501 │ 501 ││ 502 │ 502 ││ 503 │ 503 ││ 504 │ 504 ││ 505 │ 505 ││ 506 │ 506 ││ 507 │ 507 ││ 508 │ 508 ││ 509 │ 509 ││ 510 │ 510 ││ 511 │ 511 ││ 512 │ 512 ││ 513 │ 513 ││ 514 │ 514 ││ 515 │ 515 ││ 516 │ 516 ││ 517 │ 517 ││ 518 │ 518 ││ 519 │ 519 ││ 520 │ 520 ││ 521 │ 521 ││ 522 │ 522 ││ 523 │ 523 ││ 524 │ 524 ││ 525 │ 525 ││ 526 │ 526 ││ 527 │ 527 ││ 528 │ 528 ││ 529 │ 529 ││ 530 │ 530 ││ 531 │ 531 ││ 532 │ 532 ││ 533 │ 533 ││ 534 │ 534 ││ 535 │ 535 ││ 536 │ 536 ││ 537 │ 537 ││ 538 │ 538 ││ 539 │ 539 ││ 540 │ 540 ││ 541 │ 541 ││ 542 │ 542 ││ 543 │ 543 ││ 544 │ 544 ││ 545 │ 545 ││ 546 │ 546 ││ 547 │ 547 ││ 548 │ 548 ││ 549 │ 549 ││ 550 │ 550 ││ 551 │ 551 ││ 552 │ 552 ││ 553 │ 553 ││ 554 │ 554 ││ 555 │ 555 ││ 556 │ 556 ││ 557 │ 557 ││ 558 │ 558 ││ 559 │ 559 ││ 560 │ 560 ││ 561 │ 561 ││ 562 │ 562 ││ 563 │ 563 ││ 564 │ 564 ││ 565 │ 565 ││ 566 │ 566 ││ 567 │ 567 ││ 568 │ 568 ││ 569 │ 569 ││ 570 │ 570 ││ 571 │ 571 ││ 572 │ 572 ││ 573 │ 573 ││ 574 │ 574 ││ 575 │ 575 ││ 576 │ 576 ││ 577 │ 577 ││ 578 │ 578 ││ 579 │ 579 ││ 580 │ 580 ││ 581 │ 581 ││ 582 │ 582 ││ 583 │ 583 ││ 584 │ 584 ││ 585 │ 585 ││ 586 │ 586 ││ 587 │ 587 ││ 588 │ 588 ││ 589 │ 589 ││ 590 │ 590 ││ 591 │ 591 ││ 592 │ 592 ││ 593 │ 593 ││ 594 │ 594 ││ 595 │ 595 ││ 596 │ 596 ││ 597 │ 597 ││ 598 │ 598 ││ 599 │ 599 ││ 600 │ 600 ││ 601 │ 601 ││ 602 │ 602 ││ 603 │ 603 ││ 604 │ 604 ││ 605 │ 605 ││ 606 │ 606 ││ 607 │ 607 ││ 608 │ 608 ││ 609 │ 609 ││ 610 │ 610 ││ 611 │ 611 ││ 612 │ 612 ││ 613 │ 613 ││ 614 │ 614 ││ 615 │ 615 ││ 616 │ 616 ││ 617 │ 617 ││ 618 │ 618 ││ 619 │ 619 ││ 620 │ 620 ││ 621 │ 621 ││ 622 │ 622 ││ 623 │ 623 ││ 624 │ 624 ││ 625 │ 625 ││ 626 │ 626 ││ 627 │ 627 ││ 628 │ 628 ││ 629 │ 629 ││ 630 │ 630 ││ 631 │ 631 ││ 632 │ 632 ││ 633 │ 633 ││ 634 │ 634 ││ 635 │ 635 ││ 636 │ 636 ││ 637 │ 637 ││ 638 │ 638 ││ 639 │ 639 ││ 640 │ 640 ││ 641 │ 641 ││ 642 │ 642 ││ 643 │ 643 ││ 644 │ 644 ││ 645 │ 645 ││ 646 │ 646 ││ 647 │ 647 ││ 648 │ 648 ││ 649 │ 649 ││ 650 │ 650 ││ 651 │ 651 ││ 652 │ 652 ││ 653 │ 653 ││ 654 │ 654 ││ 655 │ 655 ││ 656 │ 656 ││ 657 │ 657 ││ 658 │ 658 ││ 659 │ 659 ││ 660 │ 660 ││ 661 │ 661 ││ 662 │ 662 ││ 663 │ 663 ││ 664 │ 664 ││ 665 │ 665 ││ 666 │ 666 ││ 667 │ 667 ││ 668 │ 668 ││ 669 │ 669 ││ 670 │ 670 ││ 671 │ 671 ││ 672 │ 672 ││ 673 │ 673 ││ 674 │ 674 ││ 675 │ 675 ││ 676 │ 676 ││ 677 │ 677 ││ 678 │ 678 ││ 679 │ 679 ││ 680 │ 680 ││ 681 │ 681 ││ 682 │ 682 ││ 683 │ 683 ││ 684 │ 684 ││ 685 │ 685 ││ 686 │ 686 ││ 687 │ 687 ││ 688 │ 688 ││ 689 │ 689 ││ 690 │ 690 ││ 691 │ 691 ││ 692 │ 692 ││ 693 │ 693 ││ 694 │ 694 ││ 695 │ 695 ││ 696 │ 696 ││ 697 │ 697 ││ 698 │ 698 ││ 699 │ 699 ││ 700 │ 700 ││ 701 │ 701 ││ 702 │ 702 ││ 703 │ 703 ││ 704 │ 704 ││ 705 │ 705 ││ 706 │ 706 ││ 707 │ 707 ││ 708 │ 708 ││ 709 │ 709 ││ 710 │ 710 ││ 711 │ 711 ││ 712 │ 712 ││ 713 │ 713 ││ 714 │ 714 ││ 715 │ 715 ││ 716 │ 716 ││ 717 │ 717 ││ 718 │ 718 ││ 719 │ 719 ││ 720 │ 720 ││ 721 │ 721 ││ 722 │ 722 ││ 723 │ 723 ││ 724 │ 724 ││ 725 │ 725 ││ 726 │ 726 ││ 727 │ 727 ││ 728 │ 728 ││ 729 │ 729 ││ 730 │ 730 ││ 731 │ 731 ││ 732 │ 732 ││ 733 │ 733 ││ 734 │ 734 ││ 735 │ 735 ││ 736 │ 736 ││ 737 │ 737 ││ 738 │ 738 ││ 739 │ 739 ││ 740 │ 740 ││ 741 │ 741 ││ 742 │ 742 ││ 743 │ 743 ││ 744 │ 744 ││ 745 │ 745 ││ 746 │ 746 ││ 747 │ 747 ││ 748 │ 748 ││ 749 │ 749 ││ 750 │ 750 ││ 751 │ 751 ││ 752 │ 752 ││ 753 │ 753 ││ 754 │ 754 ││ 755 │ 755 ││ 756 │ 756 ││ 757 │ 757 ││ 758 │ 758 ││ 759 │ 759 ││ 760 │ 760 ││ 761 │ 761 ││ 762 │ 762 ││ 763 │ 763 ││ 764 │ 764 ││ 765 │ 765 ││ 766 │ 766 ││ 767 │ 767 ││ 768 │ 768 ││ 769 │ 769 ││ 770 │ 770 ││ 771 │ 771 ││ 772 │ 772 ││ 773 │ 773 ││ 774 │ 774 ││ 775 │ 775 ││ 776 │ 776 ││ 777 │ 777 ││ 778 │ 778 ││ 779 │ 779 ││ 780 │ 780 ││ 781 │ 781 ││ 782 │ 782 ││ 783 │ 783 ││ 784 │ 784 ││ 785 │ 785 ││ 786 │ 786 ││ 787 │ 787 ││ 788 │ 788 ││ 789 │ 789 ││ 790 │ 790 ││ 791 │ 791 ││ 792 │ 792 ││ 793 │ 793 ││ 794 │ 794 ││ 795 │ 795 ││ 796 │ 796 ││ 797 │ 797 ││ 798 │ 798 ││ 799 │ 799 ││ 800 │ 800 ││ 801 │ 801 ││ 802 │ 802 ││ 803 │ 803 ││ 804 │ 804 ││ 805 │ 805 ││ 806 │ 806 ││ 807 │ 807 ││ 808 │ 808 ││ 809 │ 809 ││ 810 │ 810 ││ 811 │ 811 ││ 812 │ 812 ││ 813 │ 813 ││ 814 │ 814 ││ 815 │ 815 ││ 816 │ 816 ││ 817 │ 817 ││ 818 │ 818 ││ 819 │ 819 ││ 820 │ 820 ││ 821 │ 821 ││ 822 │ 822 ││ 823 │ 823 ││ 824 │ 824 ││ 825 │ 825 ││ 826 │ 826 ││ 827 │ 827 ││ 828 │ 828 ││ 829 │ 829 ││ 830 │ 830 ││ 831 │ 831 ││ 832 │ 832 ││ 833 │ 833 ││ 834 │ 834 ││ 835 │ 835 ││ 836 │ 836 ││ 837 │ 837 ││ 838 │ 838 ││ 839 │ 839 ││ 840 │ 840 ││ 841 │ 841 ││ 842 │ 842 ││ 843 │ 843 ││ 844 │ 844 ││ 845 │ 845 ││ 846 │ 846 ││ 847 │ 847 ││ 848 │ 848 ││ 849 │ 849 ││ 850 │ 850 ││ 851 │ 851 ││ 852 │ 852 ││ 853 │ 853 ││ 854 │ 854 ││ 855 │ 855 ││ 856 │ 856 ││ 857 │ 857 ││ 858 │ 858 ││ 859 │ 859 ││ 860 │ 860 ││ 861 │ 861 ││ 862 │ 862 ││ 863 │ 863 ││ 864 │ 864 ││ 865 │ 865 ││ 866 │ 866 ││ 867 │ 867 ││ 868 │ 868 ││ 869 │ 869 ││ 870 │ 870 ││ 871 │ 871 ││ 872 │ 872 ││ 873 │ 873 ││ 874 │ 874 ││ 875 │ 875 ││ 876 │ 876 ││ 877 │ 877 ││ 878 │ 878 ││ 879 │ 879 ││ 880 │ 880 ││ 881 │ 881 ││ 882 │ 882 ││ 883 │ 883 ││ 884 │ 884 ││ 885 │ 885 ││ 886 │ 886 ││ 887 │ 887 ││ 888 │ 888 ││ 889 │ 889 ││ 890 │ 890 ││ 891 │ 891 ││ 892 │ 892 ││ 893 │ 893 ││ 894 │ 894 ││ 895 │ 895 ││ 896 │ 896 ││ 897 │ 897 ││ 898 │ 898 ││ 899 │ 899 ││ 900 │ 900 ││ 901 │ 901 ││ 902 │ 902 ││ 903 │ 903 ││ 904 │ 904 ││ 905 │ 905 ││ 906 │ 906 ││ 907 │ 907 ││ 908 │ 908 ││ 909 │ 909 ││ 910 │ 910 ││ 911 │ 911 ││ 912 │ 912 ││ 913 │ 913 ││ 914 │ 914 ││ 915 │ 915 ││ 916 │ 916 ││ 917 │ 917 ││ 918 │ 918 ││ 919 │ 919 ││ 920 │ 920 ││ 921 │ 921 ││ 922 │ 922 ││ 923 │ 923 ││ 924 │ 924 ││ 925 │ 925 ││ 926 │ 926 ││ 927 │ 927 ││ 928 │ 928 ││ 929 │ 929 ││ 930 │ 930 ││ 931 │ 931 ││ 932 │ 932 ││ 933 │ 933 ││ 934 │ 934 ││ 935 │ 935 ││ 936 │ 936 ││ 937 │ 937 ││ 938 │ 938 ││ 939 │ 939 ││ 940 │ 940 ││ 941 │ 941 ││ 942 │ 942 ││ 943 │ 943 ││ 944 │ 944 ││ 945 │ 945 ││ 946 │ 946 ││ 947 │ 947 ││ 948 │ 948 ││ 949 │ 949 ││ 950 │ 950 ││ 951 │ 951 ││ 952 │ 952 ││ 953 │ 953 ││ 954 │ 954 ││ 955 │ 955 ││ 956 │ 956 ││ 957 │ 957 ││ 958 │ 958 ││ 959 │ 959 ││ 960 │ 960 ││ 961 │ 961 ││ 962 │ 962 ││ 963 │ 963 ││ 964 │ 964 ││ 965 │ 965 ││ 966 │ 966 ││ 967 │ 967 ││ 968 │ 968 ││ 969 │ 969 ││ 970 │ 970 ││ 971 │ 971 ││ 972 │ 972 ││ 973 │ 973 ││ 974 │ 974 ││ 975 │ 975 ││ 976 │ 976 ││ 977 │ 977 ││ 978 │ 978 ││ 979 │ 979 ││ 980 │ 980 ││ 981 │ 981 ││ 982 │ 982 ││ 983 │ 983 ││ 984 │ 984 ││ 985 │ 985 ││ 986 │ 986 ││ 987 │ 987 ││ 988 │ 988 ││ 989 │ 989 ││ 990 │ 990 ││ 991 │ 991 ││ 992 │ 992 ││ 993 │ 993 ││ 994 │ 994 ││ 995 │ 995 ││ 996 │ 996 ││ 997 │ 997 ││ 998 │ 998 ││ 999 │ 999 ││ 1000 │ 1000 ││ 1001 │ 1001 ││ 1002 │ 1002 ││ 1003 │ 1003 ││ 1004 │ 1004 ││ 1005 │ 1005 ││ 1006 │ 1006 ││ 1007 │ 1007 ││ 1008 │ 1008 ││ 1009 │ 1009 ││ 1010 │ 1010 ││ 1011 │ 1011 ││ 1012 │ 1012 ││ 1013 │ 1013 ││ 1014 │ 1014 ││ 1015 │ 1015 ││ 1016 │ 1016 ││ 1017 │ 1017 ││ 1018 │ 1018 ││ 1019 │ 1019 ││ 1020 │ 1020 ││ 1021 │ 1021 ││ 1022 │ 1022 ││ 1023 │ 1023 ││ 1024 │ 1024 ││ 1025 │ 1025 ││ 1026 │ 1026 ││ 1027 │ 1027 ││ 1028 │ 1028 ││ 1029 │ 1029 ││ 1030 │ 1030 ││ 1031 │ 1031 ││ 1032 │ 1032 ││ 1033 │ 1033 ││ 1034 │ 1034 ││ 1035 │ 1035 ││ 1036 │ 1036 ││ 1037 │ 1037 ││ 1038 │ 1038 ││ 1039 │ 1039 ││ 1040 │ 1040 ││ 1041 │ 1041 ││ 1042 │ 1042 ││ 1043 │ 1043 ││ 1044 │ 1044 ││ 1045 │ 1045 ││ 1046 │ 1046 ││ 1047 │ 1047 ││ 1048 │ 1048 ││ 1049 │ 1049 ││ 1050 │ 1050 ││ 1051 │ 1051 ││ 1052 │ 1052 ││ 1053 │ 1053 ││ 1054 │ 1054 ││ 1055 │ 1055 ││ 1056 │ 1056 ││ 1057 │ 1057 ││ 1058 │ 1058 ││ 1059 │ 1059 ││ 1060 │ 1060 ││ 1061 │ 1061 ││ 1062 │ 1062 ││ 1063 │ 1063 ││ 1064 │ 1064 ││ 1065 │ 1065 ││ 1066 │ 1066 ││ 1067 │ 1067 ││ 1068 │ 1068 ││ 1069 │ 1069 ││ 1070 │ 1070 ││ 1071 │ 1071 ││ 1072 │ 1072 ││ 1073 │ 1073 ││ 1074 │ 1074 ││ 1075 │ 1075 ││ 1076 │ 1076 ││ 1077 │ 1077 ││ 1078 │ 1078 ││ 1079 │ 1079 ││ 1080 │ 1080 ││ 1081 │ 1081 ││ 1082 │ 1082 ││ 1083 │ 1083 ││ 1084 │ 1084 ││ 1085 │ 1085 ││ 1086 │ 1086 ││ 1087 │ 1087 ││ 1088 │ 1088 ││ 1089 │ 1089 ││ 1090 │ 1090 ││ 1091 │ 1091 ││ 1092 │ 1092 ││ 1093 │ 1093 ││ 1094 │ 1094 ││ 1095 │ 1095 ││ 1096 │ 1096 ││ 1097 │ 1097 ││ 1098 │ 1098 ││ 1099 │ 1099 ││ 1100 │ 1100 ││ 1101 │ 1101 ││ 1102 │ 1102 ││ 1103 │ 1103 ││ 1104 │ 1104 ││ 1105 │ 1105 ││ 1106 │ 1106 ││ 1107 │ 1107 ││ 1108 │ 1108 ││ 1109 │ 1109 ││ 1110 │ 1110 ││ 1111 │ 1111 ││ 1112 │ 1112 ││ 1113 │ 1113 ││ 1114 │ 1114 ││ 1115 │ 1115 ││ 1116 │ 1116 ││ 1117 │ 1117 ││ 1118 │ 1118 ││ 1119 │ 1119 ││ 1120 │ 1120 ││ 1121 │ 1121 ││ 1122 │ 1122 ││ 1123 │ 1123 ││ 1124 │ 1124 ││ 1125 │ 1125 ││ 1126 │ 1126 ││ 1127 │ 1127 ││ 1128 │ 1128 ││ 1129 │ 1129 ││ 1130 │ 1130 ││ 1131 │ 1131 ││ 1132 │ 1132 ││ 1133 │ 1133 ││ 1134 │ 1134 ││ 1135 │ 1135 ││ 1136 │ 1136 ││ 1137 │ 1137 ││ 1138 │ 1138 ││ 1139 │ 1139 ││ 1140 │ 1140 ││ 1141 │ 1141 ││ 1142 │ 1142 ││ 1143 │ 1143 ││ 1144 │ 1144 ││ 1145 │ 1145 ││ 1146 │ 1146 ││ 1147 │ 1147 ││ 1148 │ 1148 ││ 1149 │ 1149 ││ 1150 │ 1150 ││ 1151 │ 1151 ││ 1152 │ 1152 ││ 1153 │ 1153 ││ 1154 │ 1154 ││ 1155 │ 1155 ││ 1156 │ 1156 ││ 1157 │ 1157 ││ 1158 │ 1158 ││ 1159 │ 1159 ││ 1160 │ 1160 ││ 1161 │ 1161 ││ 1162 │ 1162 ││ 1163 │ 1163 ││ 1164 │ 1164 ││ 1165 │ 1165 ││ 1166 │ 1166 ││ 1167 │ 1167 ││ 1168 │ 1168 ││ 1169 │ 1169 ││ 1170 │ 1170 ││ 1171 │ 1171 ││ 1172 │ 1172 ││ 1173 │ 1173 ││ 1174 │ 1174 ││ 1175 │ 1175 ││ 1176 │ 1176 ││ 1177 │ 1177 ││ 1178 │ 1178 ││ 1179 │ 1179 ││ 1180 │ 1180 ││ 1181 │ 1181 ││ 1182 │ 1182 ││ 1183 │ 1183 ││ 1184 │ 1184 ││ 1185 │ 1185 ││ 1186 │ 1186 ││ 1187 │ 1187 ││ 1188 │ 1188 ││ 1189 │ 1189 ││ 1190 │ 1190 ││ 1191 │ 1191 ││ 1192 │ 1192 ││ 1193 │ 1193 ││ 1194 │ 1194 ││ 1195 │ 1195 ││ 1196 │ 1196 ││ 1197 │ 1197 ││ 1198 │ 1198 ││ 1199 │ 1199 ││ 1200 │ 1200 ││ 1201 │ 1201 ││ 1202 │ 1202 ││ 1203 │ 1203 ││ 1204 │ 1204 ││ 1205 │ 1205 ││ 1206 │ 1206 ││ 1207 │ 1207 ││ 1208 │ 1208 ││ 1209 │ 1209 ││ 1210 │ 1210 ││ 1211 │ 1211 ││ 1212 │ 1212 ││ 1213 │ 1213 ││ 1214 │ 1214 ││ 1215 │ 1215 ││ 1216 │ 1216 ││ 1217 │ 1217 ││ 1218 │ 1218 ││ 1219 │ 1219 ││ 1220 │ 1220 ││ 1221 │ 1221 ││ 1222 │ 1222 ││ 1223 │ 1223 ││ 1224 │ 1224 ││ 1225 │ 1225 ││ 1226 │ 1226 ││ 1227 │ 1227 ││ 1228 │ 1228 ││ 1229 │ 1229 ││ 1230 │ 1230 ││ 1231 │ 1231 ││ 1232 │ 1232 ││ 1233 │ 1233 ││ 1234 │ 1234 ││ 1235 │ 1235 ││ 1236 │ 1236 ││ 1237 │ 1237 ││ 1238 │ 1238 ││ 1239 │ 1239 ││ 1240 │ 1240 ││ 1241 │ 1241 ││ 1242 │ 1242 ││ 1243 │ 1243 ││ 1244 │ 1244 ││ 1245 │ 1245 ││ 1246 │ 1246 ││ 1247 │ 1247 ││ 1248 │ 1248 ││ 1249 │ 1249 ││ 1250 │ 1250 ││ 1251 │ 1251 ││ 1252 │ 1252 ││ 1253 │ 1253 ││ 1254 │ 1254 ││ 1255 │ 1255 ││ 1256 │ 1256 ││ 1257 │ 1257 ││ 1258 │ 1258 ││ 1259 │ 1259 ││ 1260 │ 1260 ││ 1261 │ 1261 ││ 1262 │ 1262 ││ 1263 │ 1263 ││ 1264 │ 1264 ││ 1265 │ 1265 ││ 1266 │ 1266 ││ 1267 │ 1267 ││ 1268 │ 1268 ││ 1269 │ 1269 ││ 1270 │ 1270 ││ 1271 │ 1271 ││ 1272 │ 1272 ││ 1273 │ 1273 ││ 1274 │ 1274 ││ 1275 │ 1275 ││ 1276 │ 1276 ││ 1277 │ 1277 ││ 1278 │ 1278 ││ 1279 │ 1279 ││ 1280 │ 1280 ││ 1281 │ 1281 ││ 1282 │ 1282 ││ 1283 │ 1283 ││ 1284 │ 1284 ││ 1285 │ 1285 ││ 1286 │ 1286 ││ 1287 │ 1287 ││ 1288 │ 1288 ││ 1289 │ 1289 ││ 1290 │ 1290 ││ 1291 │ 1291 ││ 1292 │ 1292 ││ 1293 │ 1293 ││ 1294 │ 1294 ││ 1295 │ 1295 ││ 1296 │ 1296 ││ 1297 │ 1297 ││ 1298 │ 1298 ││ 1299 │ 1299 ││ 1300 │ 1300 ││ 1301 │ 1301 ││ 1302 │ 1302 ││ 1303 │ 1303 ││ 1304 │ 1304 ││ 1305 │ 1305 ││ 1306 │ 1306 ││ 1307 │ 1307 ││ 1308 │ 1308 ││ 1309 │ 1309 ││ 1310 │ 1310 ││ 1311 │ 1311 ││ 1312 │ 1312 ││ 1313 │ 1313 ││ 1314 │ 1314 ││ 1315 │ 1315 ││ 1316 │ 1316 ││ 1317 │ 1317 ││ 1318 │ 1318 ││ 1319 │ 1319 ││ 1320 │ 1320 ││ 1321 │ 1321 ││ 1322 │ 1322 ││ 1323 │ 1323 ││ 1324 │ 1324 ││ 1325 │ 1325 ││ 1326 │ 1326 ││ 1327 │ 1327 ││ 1328 │ 1328 ││ 1329 │ 1329 ││ 1330 │ 1330 ││ 1331 │ 1331 ││ 1332 │ 1332 ││ 1333 │ 1333 ││ 1334 │ 1334 ││ 1335 │ 1335 ││ 1336 │ 1336 ││ 1337 │ 1337 ││ 1338 │ 1338 ││ 1339 │ 1339 ││ 1340 │ 1340 ││ 1341 │ 1341 ││ 1342 │ 1342 ││ 1343 │ 1343 ││ 1344 │ 1344 ││ 1345 │ 1345 ││ 1346 │ 1346 ││ 1347 │ 1347 ││ 1348 │ 1348 ││ 1349 │ 1349 ││ 1350 │ 1350 ││ 1351 │ 1351 ││ 1352 │ 1352 ││ 1353 │ 1353 ││ 1354 │ 1354 ││ 1355 │ 1355 ││ 1356 │ 1356 ││ 1357 │ 1357 ││ 1358 │ 1358 ││ 1359 │ 1359 ││ 1360 │ 1360 ││ 1361 │ 1361 ││ 1362 │ 1362 ││ 1363 │ 1363 ││ 1364 │ 1364 ││ 1365 │ 1365 ││ 1366 │ 1366 ││ 1367 │ 1367 ││ 1368 │ 1368 ││ 1369 │ 1369 ││ 1370 │ 1370 ││ 1371 │ 1371 ││ 1372 │ 1372 ││ 1373 │ 1373 ││ 1374 │ 1374 ││ 1375 │ 1375 ││ 1376 │ 1376 ││ 1377 │ 1377 ││ 1378 │ 1378 ││ 1379 │ 1379 ││ 1380 │ 1380 ││ 1381 │ 1381 ││ 1382 │ 1382 ││ 1383 │ 1383 ││ 1384 │ 1384 ││ 1385 │ 1385 ││ 1386 │ 1386 ││ 1387 │ 1387 ││ 1388 │ 1388 ││ 1389 │ 1389 ││ 1390 │ 1390 ││ 1391 │ 1391 ││ 1392 │ 1392 ││ 1393 │ 1393 ││ 1394 │ 1394 ││ 1395 │ 1395 ││ 1396 │ 1396 ││ 1397 │ 1397 ││ 1398 │ 1398 ││ 1399 │ 1399 ││ 1400 │ 1400 ││ 1401 │ 1401 ││ 1402 │ 1402 ││ 1403 │ 1403 ││ 1404 │ 1404 ││ 1405 │ 1405 ││ 1406 │ 1406 ││ 1407 │ 1407 ││ 1408 │ 1408 ││ 1409 │ 1409 ││ 1410 │ 1410 ││ 1411 │ 1411 ││ 1412 │ 1412 ││ 1413 │ 1413 ││ 1414 │ 1414 ││ 1415 │ 1415 ││ 1416 │ 1416 ││ 1417 │ 1417 ││ 1418 │ 1418 ││ 1419 │ 1419 ││ 1420 │ 1420 ││ 1421 │ 1421 ││ 1422 │ 1422 ││ 1423 │ 1423 ││ 1424 │ 1424 ││ 1425 │ 1425 ││ 1426 │ 1426 ││ 1427 │ 1427 ││ 1428 │ 1428 ││ 1429 │ 1429 ││ 1430 │ 1430 ││ 1431 │ 1431 ││ 1432 │ 1432 ││ 1433 │ 1433 ││ 1434 │ 1434 ││ 1435 │ 1435 ││ 1436 │ 1436 ││ 1437 │ 1437 ││ 1438 │ 1438 ││ 1439 │ 1439 ││ 1440 │ 1440 ││ 1441 │ 1441 ││ 1442 │ 1442 ││ 1443 │ 1443 ││ 1444 │ 1444 ││ 1445 │ 1445 ││ 1446 │ 1446 ││ 1447 │ 1447 ││ 1448 │ 1448 ││ 1449 │ 1449 ││ 1450 │ 1450 ││ 1451 │ 1451 ││ 1452 │ 1452 ││ 1453 │ 1453 ││ 1454 │ 1454 ││ 1455 │ 1455 ││ 1456 │ 1456 ││ 1457 │ 1457 ││ 1458 │ 1458 ││ 1459 │ 1459 ││ 1460 │ 1460 ││ 1461 │ 1461 ││ 1462 │ 1462 ││ 1463 │ 1463 ││ 1464 │ 1464 ││ 1465 │ 1465 ││ 1466 │ 1466 ││ 1467 │ 1467 ││ 1468 │ 1468 ││ 1469 │ 1469 ││ 1470 │ 1470 ││ 1471 │ 1471 ││ 1472 │ 1472 ││ 1473 │ 1473 ││ 1474 │ 1474 ││ 1475 │ 1475 ││ 1476 │ 1476 ││ 1477 │ 1477 ││ 1478 │ 1478 ││ 1479 │ 1479 ││ 1480 │ 1480 ││ 1481 │ 1481 ││ 1482 │ 1482 ││ 1483 │ 1483 ││ 1484 │ 1484 ││ 1485 │ 1485 ││ 1486 │ 1486 ││ 1487 │ 1487 ││ 1488 │ 1488 ││ 1489 │ 1489 ││ 1490 │ 1490 ││ 1491 │ 1491 ││ 1492 │ 1492 ││ 1493 │ 1493 ││ 1494 │ 1494 ││ 1495 │ 1495 ││ 1496 │ 1496 ││ 1497 │ 1497 ││ 1498 │ 1498 ││ 1499 │ 1499 ││ 1500 │ 1500 ││ 1501 │ 1501 ││ 1502 │ 1502 ││ 1503 │ 1503 ││ 1504 │ 1504 ││ 1505 │ 1505 ││ 1506 │ 1506 ││ 1507 │ 1507 ││ 1508 │ 1508 ││ 1509 │ 1509 ││ 1510 │ 1510 ││ 1511 │ 1511 ││ 1512 │ 1512 ││ 1513 │ 1513 ││ 1514 │ 1514 ││ 1515 │ 1515 ││ 1516 │ 1516 ││ 1517 │ 1517 ││ 1518 │ 1518 ││ 1519 │ 1519 ││ 1520 │ 1520 ││ 1521 │ 1521 ││ 1522 │ 1522 ││ 1523 │ 1523 ││ 1524 │ 1524 ││ 1525 │ 1525 ││ 1526 │ 1526 ││ 1527 │ 1527 ││ 1528 │ 1528 ││ 1529 │ 1529 ││ 1530 │ 1530 ││ 1531 │ 1531 ││ 1532 │ 1532 ││ 1533 │ 1533 ││ 1534 │ 1534 ││ 1535 │ 1535 ││ 1536 │ 1536 ││ 1537 │ 1537 ││ 1538 │ 1538 ││ 1539 │ 1539 ││ 1540 │ 1540 ││ 1541 │ 1541 ││ 1542 │ 1542 ││ 1543 │ 1543 ││ 1544 │ 1544 ││ 1545 │ 1545 ││ 1546 │ 1546 ││ 1547 │ 1547 ││ 1548 │ 1548 ││ 1549 │ 1549 ││ 1550 │ 1550 ││ 1551 │ 1551 ││ 1552 │ 1552 ││ 1553 │ 1553 ││ 1554 │ 1554 ││ 1555 │ 1555 ││ 1556 │ 1556 ││ 1557 │ 1557 ││ 1558 │ 1558 ││ 1559 │ 1559 ││ 1560 │ 1560 ││ 1561 │ 1561 ││ 1562 │ 1562 ││ 1563 │ 1563 ││ 1564 │ 1564 ││ 1565 │ 1565 ││ 1566 │ 1566 ││ 1567 │ 1567 ││ 1568 │ 1568 ││ 1569 │ 1569 ││ 1570 │ 1570 ││ 1571 │ 1571 ││ 1572 │ 1572 ││ 1573 │ 1573 ││ 1574 │ 1574 ││ 1575 │ 1575 ││ 1576 │ 1576 ││ 1577 │ 1577 ││ 1578 │ 1578 ││ 1579 │ 1579 ││ 1580 │ 1580 ││ 1581 │ 1581 ││ 1582 │ 1582 ││ 1583 │ 1583 ││ 1584 │ 1584 ││ 1585 │ 1585 ││ 1586 │ 1586 ││ 1587 │ 1587 ││ 1588 │ 1588 ││ 1589 │ 1589 ││ 1590 │ 1590 ││ 1591 │ 1591 ││ 1592 │ 1592 ││ 1593 │ 1593 ││ 1594 │ 1594 ││ 1595 │ 1595 ││ 1596 │ 1596 ││ 1597 │ 1597 ││ 1598 │ 1598 ││ 1599 │ 1599 ││ 1600 │ 1600 ││ 1601 │ 1601 ││ 1602 │ 1602 ││ 1603 │ 1603 ││ 1604 │ 1604 ││ 1605 │ 1605 ││ 1606 │ 1606 ││ 1607 │ 1607 ││ 1608 │ 1608 ││ 1609 │ 1609 ││ 1610 │ 1610 ││ 1611 │ 1611 ││ 1612 │ 1612 ││ 1613 │ 1613 ││ 1614 │ 1614 ││ 1615 │ 1615 ││ 1616 │ 1616 ││ 1617 │ 1617 ││ 1618 │ 1618 ││ 1619 │ 1619 ││ 1620 │ 1620 ││ 1621 │ 1621 ││ 1622 │ 1622 ││ 1623 │ 1623 ││ 1624 │ 1624 ││ 1625 │ 1625 ││ 1626 │ 1626 ││ 1627 │ 1627 ││ 1628 │ 1628 ││ 1629 │ 1629 ││ 1630 │ 1630 ││ 1631 │ 1631 ││ 1632 │ 1632 ││ 1633 │ 1633 ││ 1634 │ 1634 ││ 1635 │ 1635 ││ 1636 │ 1636 ││ 1637 │ 1637 ││ 1638 │ 1638 ││ 1639 │ 1639 ││ 1640 │ 1640 ││ 1641 │ 1641 ││ 1642 │ 1642 ││ 1643 │ 1643 ││ 1644 │ 1644 ││ 1645 │ 1645 ││ 1646 │ 1646 ││ 1647 │ 1647 ││ 1648 │ 1648 ││ 1649 │ 1649 ││ 1650 │ 1650 ││ 1651 │ 1651 ││ 1652 │ 1652 ││ 1653 │ 1653 ││ 1654 │ 1654 ││ 1655 │ 1655 ││ 1656 │ 1656 ││ 1657 │ 1657 ││ 1658 │ 1658 ││ 1659 │ 1659 ││ 1660 │ 1660 ││ 1661 │ 1661 ││ 1662 │ 1662 ││ 1663 │ 1663 ││ 1664 │ 1664 ││ 1665 │ 1665 ││ 1666 │ 1666 ││ 1667 │ 1667 ││ 1668 │ 1668 ││ 1669 │ 1669 ││ 1670 │ 1670 ││ 1671 │ 1671 ││ 1672 │ 1672 ││ 1673 │ 1673 ││ 1674 │ 1674 ││ 1675 │ 1675 ││ 1676 │ 1676 ││ 1677 │ 1677 ││ 1678 │ 1678 ││ 1679 │ 1679 ││ 1680 │ 1680 ││ 1681 │ 1681 ││ 1682 │ 1682 ││ 1683 │ 1683 ││ 1684 │ 1684 ││ 1685 │ 1685 ││ 1686 │ 1686 ││ 1687 │ 1687 ││ 1688 │ 1688 ││ 1689 │ 1689 ││ 1690 │ 1690 ││ 1691 │ 1691 ││ 1692 │ 1692 ││ 1693 │ 1693 ││ 1694 │ 1694 ││ 1695 │ 1695 ││ 1696 │ 1696 ││ 1697 │ 1697 ││ 1698 │ 1698 ││ 1699 │ 1699 ││ 1700 │ 1700 ││ 1701 │ 1701 ││ 1702 │ 1702 ││ 1703 │ 1703 ││ 1704 │ 1704 ││ 1705 │ 1705 ││ 1706 │ 1706 ││ 1707 │ 1707 ││ 1708 │ 1708 ││ 1709 │ 1709 ││ 1710 │ 1710 ││ 1711 │ 1711 ││ 1712 │ 1712 ││ 1713 │ 1713 ││ 1714 │ 1714 ││ 1715 │ 1715 ││ 1716 │ 1716 ││ 1717 │ 1717 ││ 1718 │ 1718 ││ 1719 │ 1719 ││ 1720 │ 1720 ││ 1721 │ 1721 ││ 1722 │ 1722 ││ 1723 │ 1723 ││ 1724 │ 1724 ││ 1725 │ 1725 ││ 1726 │ 1726 ││ 1727 │ 1727 ││ 1728 │ 1728 ││ 1729 │ 1729 ││ 1730 │ 1730 ││ 1731 │ 1731 ││ 1732 │ 1732 ││ 1733 │ 1733 ││ 1734 │ 1734 ││ 1735 │ 1735 ││ 1736 │ 1736 ││ 1737 │ 1737 ││ 1738 │ 1738 ││ 1739 │ 1739 ││ 1740 │ 1740 ││ 1741 │ 1741 ││ 1742 │ 1742 ││ 1743 │ 1743 ││ 1744 │ 1744 ││ 1745 │ 1745 ││ 1746 │ 1746 ││ 1747 │ 1747 ││ 1748 │ 1748 ││ 1749 │ 1749 ││ 1750 │ 1750 ││ 1751 │ 1751 ││ 1752 │ 1752 ││ 1753 │ 1753 ││ 1754 │ 1754 ││ 1755 │ 1755 ││ 1756 │ 1756 ││ 1757 │ 1757 ││ 1758 │ 1758 ││ 1759 │ 1759 ││ 1760 │ 1760 ││ 1761 │ 1761 ││ 1762 │ 1762 ││ 1763 │ 1763 ││ 1764 │ 1764 ││ 1765 │ 1765 ││ 1766 │ 1766 ││ 1767 │ 1767 ││ 1768 │ 1768 ││ 1769 │ 1769 ││ 1770 │ 1770 ││ 1771 │ 1771 ││ 1772 │ 1772 ││ 1773 │ 1773 ││ 1774 │ 1774 ││ 1775 │ 1775 ││ 1776 │ 1776 ││ 1777 │ 1777 ││ 1778 │ 1778 ││ 1779 │ 1779 ││ 1780 │ 1780 ││ 1781 │ 1781 ││ 1782 │ 1782 ││ 1783 │ 1783 ││ 1784 │ 1784 ││ 1785 │ 1785 ││ 1786 │ 1786 ││ 1787 │ 1787 ││ 1788 │ 1788 ││ 1789 │ 1789 ││ 1790 │ 1790 ││ 1791 │ 1791 ││ 1792 │ 1792 ││ 1793 │ 1793 ││ 1794 │ 1794 ││ 1795 │ 1795 ││ 1796 │ 1796 ││ 1797 │ 1797 ││ 1798 │ 1798 ││ 1799 │ 1799 ││ 1800 │ 1800 ││ 1801 │ 1801 ││ 1802 │ 1802 ││ 1803 │ 1803 ││ 1804 │ 1804 ││ 1805 │ 1805 ││ 1806 │ 1806 ││ 1807 │ 1807 ││ 1808 │ 1808 ││ 1809 │ 1809 ││ 1810 │ 1810 ││ 1811 │ 1811 ││ 1812 │ 1812 ││ 1813 │ 1813 ││ 1814 │ 1814 ││ 1815 │ 1815 ││ 1816 │ 1816 ││ 1817 │ 1817 ││ 1818 │ 1818 ││ 1819 │ 1819 ││ 1820 │ 1820 ││ 1821 │ 1821 ││ 1822 │ 1822 ││ 1823 │ 1823 ││ 1824 │ 1824 ││ 1825 │ 1825 ││ 1826 │ 1826 ││ 1827 │ 1827 ││ 1828 │ 1828 ││ 1829 │ 1829 ││ 1830 │ 1830 ││ 1831 │ 1831 ││ 1832 │ 1832 ││ 1833 │ 1833 ││ 1834 │ 1834 ││ 1835 │ 1835 ││ 1836 │ 1836 ││ 1837 │ 1837 ││ 1838 │ 1838 ││ 1839 │ 1839 ││ 1840 │ 1840 ││ 1841 │ 1841 ││ 1842 │ 1842 ││ 1843 │ 1843 ││ 1844 │ 1844 ││ 1845 │ 1845 ││ 1846 │ 1846 ││ 1847 │ 1847 ││ 1848 │ 1848 ││ 1849 │ 1849 ││ 1850 │ 1850 ││ 1851 │ 1851 ││ 1852 │ 1852 ││ 1853 │ 1853 ││ 1854 │ 1854 ││ 1855 │ 1855 ││ 1856 │ 1856 ││ 1857 │ 1857 ││ 1858 │ 1858 ││ 1859 │ 1859 ││ 1860 │ 1860 ││ 1861 │ 1861 ││ 1862 │ 1862 ││ 1863 │ 1863 ││ 1864 │ 1864 ││ 1865 │ 1865 ││ 1866 │ 1866 ││ 1867 │ 1867 ││ 1868 │ 1868 ││ 1869 │ 1869 ││ 1870 │ 1870 ││ 1871 │ 1871 ││ 1872 │ 1872 ││ 1873 │ 1873 ││ 1874 │ 1874 ││ 1875 │ 1875 ││ 1876 │ 1876 ││ 1877 │ 1877 ││ 1878 │ 1878 ││ 1879 │ 1879 ││ 1880 │ 1880 ││ 1881 │ 1881 ││ 1882 │ 1882 ││ 1883 │ 1883 ││ 1884 │ 1884 ││ 1885 │ 1885 ││ 1886 │ 1886 ││ 1887 │ 1887 ││ 1888 │ 1888 ││ 1889 │ 1889 ││ 1890 │ 1890 ││ 1891 │ 1891 ││ 1892 │ 1892 ││ 1893 │ 1893 ││ 1894 │ 1894 ││ 1895 │ 1895 ││ 1896 │ 1896 ││ 1897 │ 1897 ││ 1898 │ 1898 ││ 1899 │ 1899 ││ 1900 │ 1900 ││ 1901 │ 1901 ││ 1902 │ 1902 ││ 1903 │ 1903 ││ 1904 │ 1904 ││ 1905 │ 1905 ││ 1906 │ 1906 ││ 1907 │ 1907 ││ 1908 │ 1908 ││ 1909 │ 1909 ││ 1910 │ 1910 ││ 1911 │ 1911 ││ 1912 │ 1912 ││ 1913 │ 1913 ││ 1914 │ 1914 ││ 1915 │ 1915 ││ 1916 │ 1916 ││ 1917 │ 1917 ││ 1918 │ 1918 ││ 1919 │ 1919 ││ 1920 │ 1920 ││ 1921 │ 1921 ││ 1922 │ 1922 ││ 1923 │ 1923 ││ 1924 │ 1924 ││ 1925 │ 1925 ││ 1926 │ 1926 ││ 1927 │ 1927 ││ 1928 │ 1928 ││ 1929 │ 1929 ││ 1930 │ 1930 ││ 1931 │ 1931 ││ 1932 │ 1932 ││ 1933 │ 1933 ││ 1934 │ 1934 ││ 1935 │ 1935 ││ 1936 │ 1936 ││ 1937 │ 1937 ││ 1938 │ 1938 ││ 1939 │ 1939 ││ 1940 │ 1940 ││ 1941 │ 1941 ││ 1942 │ 1942 ││ 1943 │ 1943 ││ 1944 │ 1944 ││ 1945 │ 1945 ││ 1946 │ 1946 ││ 1947 │ 1947 ││ 1948 │ 1948 ││ 1949 │ 1949 ││ 1950 │ 1950 ││ 1951 │ 1951 ││ 1952 │ 1952 ││ 1953 │ 1953 ││ 1954 │ 1954 ││ 1955 │ 1955 ││ 1956 │ 1956 ││ 1957 │ 1957 ││ 1958 │ 1958 ││ 1959 │ 1959 ││ 1960 │ 1960 ││ 1961 │ 1961 ││ 1962 │ 1962 ││ 1963 │ 1963 ││ 1964 │ 1964 ││ 1965 │ 1965 ││ 1966 │ 1966 ││ 1967 │ 1967 ││ 1968 │ 1968 ││ 1969 │ 1969 ││ 1970 │ 1970 ││ 1971 │ 1971 ││ 1972 │ 1972 ││ 1973 │ 1973 ││ 1974 │ 1974 ││ 1975 │ 1975 ││ 1976 │ 1976 ││ 1977 │ 1977 ││ 1978 │ 1978 ││ 1979 │ 1979 ││ 1980 │ 1980 ││ 1981 │ 1981 ││ 1982 │ 1982 ││ 1983 │ 1983 ││ 1984 │ 1984 ││ 1985 │ 1985 ││ 1986 │ 1986 ││ 1987 │ 1987 ││ 1988 │ 1988 ││ 1989 │ 1989 ││ 1990 │ 1990 ││ 1991 │ 1991 ││ 1992 │ 1992 ││ 1993 │ 1993 ││ 1994 │ 1994 ││ 1995 │ 1995 ││ 1996 │ 1996 ││ 1997 │ 1997 ││ 1998 │ 1998 ││ 1999 │ 1999 ││ 2000 │ 2000 │╰──────┴──────╯"; @@ -3481,32 +3529,50 @@ fn table_abbreviation_cut() { #[test] fn table_expand_inner_index_0() { let actual = nu!("0..1000 | each {[0]} | table -e"); - assert_eq!(actual.out, "╭─────┬───────────╮│ 0 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 1 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 2 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 3 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 4 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 5 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 6 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 7 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 8 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 9 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 10 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 11 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 12 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 13 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 14 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 15 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 16 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 17 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 18 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 19 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 20 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 21 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 22 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 23 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 24 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 25 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 26 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 27 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 28 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 29 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 30 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 31 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 32 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 33 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 34 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 35 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 36 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 37 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 38 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 39 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 40 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 41 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 42 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 43 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 44 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 45 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 46 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 47 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 48 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 49 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 50 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 51 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 52 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 53 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 54 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 55 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 56 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 57 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 58 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 59 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 60 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 61 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 62 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 63 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 64 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 65 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 66 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 67 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 68 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 69 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 70 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 71 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 72 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 73 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 74 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 75 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 76 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 77 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 78 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 79 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 80 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 81 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 82 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 83 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 84 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 85 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 86 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 87 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 88 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 89 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 90 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 91 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 92 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 93 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 94 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 95 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 96 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 97 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 98 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 99 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 100 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 101 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 102 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 103 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 104 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 105 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 106 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 107 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 108 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 109 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 110 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 111 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 112 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 113 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 114 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 115 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 116 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 117 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 118 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 119 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 120 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 121 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 122 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 123 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 124 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 125 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 126 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 127 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 128 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 129 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 130 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 131 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 132 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 133 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 134 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 135 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 136 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 137 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 138 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 139 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 140 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 141 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 142 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 143 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 144 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 145 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 146 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 147 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 148 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 149 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 150 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 151 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 152 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 153 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 154 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 155 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 156 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 157 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 158 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 159 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 160 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 161 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 162 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 163 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 164 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 165 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 166 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 167 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 168 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 169 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 170 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 171 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 172 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 173 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 174 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 175 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 176 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 177 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 178 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 179 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 180 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 181 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 182 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 183 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 184 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 185 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 186 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 187 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 188 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 189 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 190 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 191 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 192 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 193 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 194 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 195 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 196 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 197 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 198 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 199 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 200 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 201 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 202 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 203 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 204 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 205 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 206 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 207 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 208 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 209 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 210 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 211 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 212 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 213 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 214 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 215 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 216 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 217 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 218 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 219 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 220 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 221 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 222 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 223 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 224 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 225 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 226 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 227 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 228 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 229 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 230 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 231 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 232 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 233 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 234 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 235 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 236 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 237 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 238 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 239 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 240 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 241 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 242 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 243 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 244 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 245 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 246 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 247 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 248 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 249 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 250 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 251 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 252 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 253 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 254 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 255 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 256 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 257 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 258 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 259 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 260 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 261 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 262 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 263 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 264 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 265 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 266 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 267 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 268 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 269 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 270 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 271 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 272 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 273 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 274 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 275 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 276 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 277 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 278 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 279 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 280 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 281 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 282 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 283 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 284 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 285 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 286 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 287 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 288 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 289 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 290 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 291 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 292 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 293 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 294 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 295 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 296 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 297 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 298 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 299 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 300 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 301 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 302 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 303 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 304 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 305 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 306 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 307 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 308 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 309 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 310 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 311 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 312 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 313 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 314 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 315 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 316 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 317 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 318 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 319 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 320 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 321 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 322 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 323 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 324 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 325 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 326 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 327 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 328 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 329 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 330 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 331 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 332 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 333 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 334 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 335 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 336 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 337 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 338 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 339 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 340 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 341 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 342 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 343 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 344 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 345 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 346 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 347 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 348 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 349 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 350 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 351 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 352 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 353 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 354 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 355 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 356 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 357 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 358 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 359 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 360 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 361 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 362 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 363 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 364 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 365 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 366 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 367 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 368 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 369 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 370 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 371 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 372 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 373 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 374 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 375 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 376 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 377 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 378 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 379 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 380 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 381 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 382 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 383 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 384 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 385 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 386 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 387 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 388 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 389 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 390 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 391 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 392 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 393 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 394 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 395 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 396 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 397 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 398 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 399 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 400 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 401 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 402 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 403 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 404 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 405 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 406 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 407 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 408 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 409 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 410 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 411 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 412 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 413 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 414 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 415 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 416 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 417 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 418 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 419 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 420 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 421 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 422 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 423 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 424 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 425 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 426 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 427 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 428 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 429 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 430 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 431 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 432 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 433 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 434 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 435 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 436 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 437 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 438 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 439 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 440 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 441 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 442 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 443 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 444 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 445 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 446 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 447 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 448 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 449 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 450 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 451 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 452 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 453 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 454 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 455 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 456 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 457 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 458 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 459 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 460 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 461 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 462 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 463 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 464 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 465 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 466 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 467 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 468 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 469 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 470 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 471 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 472 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 473 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 474 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 475 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 476 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 477 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 478 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 479 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 480 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 481 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 482 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 483 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 484 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 485 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 486 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 487 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 488 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 489 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 490 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 491 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 492 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 493 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 494 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 495 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 496 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 497 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 498 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 499 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 500 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 501 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 502 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 503 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 504 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 505 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 506 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 507 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 508 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 509 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 510 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 511 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 512 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 513 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 514 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 515 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 516 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 517 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 518 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 519 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 520 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 521 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 522 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 523 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 524 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 525 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 526 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 527 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 528 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 529 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 530 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 531 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 532 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 533 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 534 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 535 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 536 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 537 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 538 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 539 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 540 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 541 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 542 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 543 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 544 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 545 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 546 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 547 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 548 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 549 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 550 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 551 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 552 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 553 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 554 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 555 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 556 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 557 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 558 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 559 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 560 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 561 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 562 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 563 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 564 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 565 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 566 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 567 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 568 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 569 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 570 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 571 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 572 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 573 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 574 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 575 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 576 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 577 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 578 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 579 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 580 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 581 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 582 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 583 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 584 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 585 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 586 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 587 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 588 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 589 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 590 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 591 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 592 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 593 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 594 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 595 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 596 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 597 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 598 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 599 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 600 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 601 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 602 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 603 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 604 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 605 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 606 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 607 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 608 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 609 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 610 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 611 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 612 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 613 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 614 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 615 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 616 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 617 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 618 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 619 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 620 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 621 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 622 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 623 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 624 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 625 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 626 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 627 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 628 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 629 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 630 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 631 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 632 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 633 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 634 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 635 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 636 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 637 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 638 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 639 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 640 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 641 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 642 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 643 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 644 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 645 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 646 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 647 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 648 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 649 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 650 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 651 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 652 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 653 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 654 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 655 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 656 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 657 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 658 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 659 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 660 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 661 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 662 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 663 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 664 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 665 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 666 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 667 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 668 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 669 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 670 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 671 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 672 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 673 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 674 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 675 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 676 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 677 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 678 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 679 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 680 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 681 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 682 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 683 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 684 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 685 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 686 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 687 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 688 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 689 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 690 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 691 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 692 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 693 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 694 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 695 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 696 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 697 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 698 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 699 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 700 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 701 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 702 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 703 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 704 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 705 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 706 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 707 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 708 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 709 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 710 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 711 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 712 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 713 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 714 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 715 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 716 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 717 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 718 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 719 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 720 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 721 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 722 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 723 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 724 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 725 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 726 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 727 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 728 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 729 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 730 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 731 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 732 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 733 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 734 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 735 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 736 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 737 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 738 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 739 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 740 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 741 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 742 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 743 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 744 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 745 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 746 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 747 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 748 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 749 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 750 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 751 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 752 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 753 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 754 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 755 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 756 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 757 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 758 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 759 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 760 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 761 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 762 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 763 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 764 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 765 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 766 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 767 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 768 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 769 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 770 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 771 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 772 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 773 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 774 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 775 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 776 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 777 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 778 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 779 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 780 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 781 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 782 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 783 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 784 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 785 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 786 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 787 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 788 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 789 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 790 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 791 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 792 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 793 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 794 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 795 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 796 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 797 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 798 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 799 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 800 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 801 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 802 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 803 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 804 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 805 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 806 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 807 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 808 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 809 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 810 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 811 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 812 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 813 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 814 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 815 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 816 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 817 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 818 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 819 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 820 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 821 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 822 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 823 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 824 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 825 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 826 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 827 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 828 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 829 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 830 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 831 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 832 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 833 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 834 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 835 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 836 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 837 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 838 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 839 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 840 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 841 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 842 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 843 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 844 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 845 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 846 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 847 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 848 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 849 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 850 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 851 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 852 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 853 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 854 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 855 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 856 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 857 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 858 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 859 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 860 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 861 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 862 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 863 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 864 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 865 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 866 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 867 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 868 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 869 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 870 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 871 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 872 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 873 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 874 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 875 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 876 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 877 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 878 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 879 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 880 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 881 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 882 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 883 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 884 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 885 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 886 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 887 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 888 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 889 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 890 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 891 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 892 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 893 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 894 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 895 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 896 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 897 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 898 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 899 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 900 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 901 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 902 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 903 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 904 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 905 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 906 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 907 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 908 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 909 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 910 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 911 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 912 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 913 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 914 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 915 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 916 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 917 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 918 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 919 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 920 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 921 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 922 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 923 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 924 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 925 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 926 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 927 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 928 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 929 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 930 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 931 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 932 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 933 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 934 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 935 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 936 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 937 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 938 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 939 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 940 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 941 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 942 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 943 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 944 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 945 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 946 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 947 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 948 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 949 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 950 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 951 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 952 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 953 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 954 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 955 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 956 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 957 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 958 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 959 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 960 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 961 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 962 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 963 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 964 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 965 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 966 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 967 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 968 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 969 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 970 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 971 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 972 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 973 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 974 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 975 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 976 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 977 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 978 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 979 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 980 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 981 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 982 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 983 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 984 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 985 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 986 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 987 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 988 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 989 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 990 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 991 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 992 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 993 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 994 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 995 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 996 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 997 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 998 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 999 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ │╰─────┴───────────╯╭──────┬───────────╮│ 1000 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ │╰──────┴───────────╯"); + assert_eq!( + actual.out, + "╭─────┬───────────╮│ 0 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 1 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 2 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 3 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 4 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 5 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 6 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 7 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 8 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 9 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 10 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 11 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 12 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 13 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 14 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 15 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 16 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 17 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 18 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 19 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 20 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 21 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 22 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 23 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 24 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 25 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 26 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 27 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 28 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 29 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 30 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 31 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 32 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 33 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 34 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 35 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 36 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 37 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 38 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 39 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 40 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 41 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 42 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 43 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 44 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 45 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 46 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 47 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 48 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 49 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 50 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 51 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 52 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 53 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 54 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 55 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 56 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 57 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 58 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 59 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 60 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 61 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 62 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 63 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 64 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 65 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 66 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 67 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 68 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 69 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 70 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 71 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 72 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 73 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 74 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 75 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 76 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 77 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 78 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 79 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 80 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 81 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 82 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 83 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 84 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 85 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 86 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 87 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 88 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 89 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 90 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 91 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 92 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 93 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 94 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 95 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 96 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 97 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 98 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 99 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 100 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 101 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 102 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 103 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 104 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 105 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 106 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 107 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 108 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 109 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 110 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 111 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 112 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 113 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 114 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 115 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 116 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 117 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 118 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 119 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 120 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 121 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 122 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 123 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 124 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 125 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 126 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 127 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 128 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 129 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 130 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 131 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 132 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 133 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 134 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 135 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 136 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 137 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 138 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 139 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 140 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 141 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 142 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 143 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 144 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 145 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 146 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 147 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 148 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 149 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 150 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 151 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 152 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 153 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 154 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 155 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 156 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 157 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 158 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 159 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 160 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 161 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 162 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 163 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 164 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 165 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 166 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 167 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 168 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 169 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 170 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 171 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 172 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 173 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 174 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 175 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 176 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 177 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 178 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 179 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 180 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 181 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 182 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 183 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 184 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 185 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 186 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 187 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 188 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 189 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 190 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 191 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 192 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 193 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 194 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 195 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 196 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 197 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 198 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 199 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 200 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 201 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 202 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 203 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 204 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 205 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 206 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 207 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 208 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 209 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 210 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 211 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 212 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 213 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 214 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 215 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 216 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 217 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 218 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 219 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 220 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 221 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 222 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 223 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 224 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 225 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 226 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 227 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 228 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 229 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 230 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 231 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 232 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 233 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 234 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 235 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 236 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 237 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 238 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 239 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 240 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 241 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 242 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 243 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 244 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 245 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 246 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 247 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 248 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 249 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 250 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 251 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 252 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 253 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 254 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 255 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 256 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 257 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 258 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 259 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 260 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 261 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 262 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 263 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 264 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 265 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 266 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 267 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 268 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 269 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 270 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 271 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 272 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 273 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 274 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 275 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 276 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 277 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 278 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 279 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 280 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 281 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 282 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 283 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 284 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 285 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 286 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 287 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 288 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 289 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 290 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 291 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 292 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 293 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 294 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 295 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 296 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 297 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 298 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 299 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 300 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 301 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 302 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 303 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 304 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 305 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 306 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 307 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 308 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 309 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 310 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 311 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 312 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 313 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 314 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 315 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 316 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 317 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 318 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 319 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 320 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 321 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 322 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 323 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 324 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 325 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 326 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 327 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 328 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 329 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 330 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 331 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 332 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 333 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 334 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 335 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 336 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 337 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 338 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 339 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 340 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 341 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 342 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 343 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 344 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 345 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 346 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 347 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 348 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 349 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 350 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 351 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 352 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 353 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 354 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 355 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 356 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 357 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 358 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 359 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 360 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 361 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 362 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 363 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 364 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 365 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 366 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 367 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 368 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 369 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 370 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 371 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 372 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 373 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 374 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 375 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 376 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 377 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 378 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 379 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 380 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 381 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 382 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 383 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 384 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 385 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 386 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 387 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 388 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 389 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 390 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 391 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 392 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 393 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 394 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 395 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 396 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 397 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 398 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 399 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 400 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 401 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 402 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 403 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 404 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 405 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 406 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 407 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 408 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 409 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 410 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 411 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 412 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 413 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 414 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 415 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 416 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 417 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 418 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 419 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 420 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 421 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 422 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 423 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 424 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 425 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 426 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 427 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 428 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 429 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 430 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 431 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 432 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 433 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 434 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 435 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 436 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 437 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 438 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 439 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 440 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 441 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 442 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 443 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 444 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 445 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 446 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 447 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 448 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 449 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 450 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 451 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 452 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 453 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 454 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 455 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 456 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 457 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 458 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 459 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 460 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 461 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 462 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 463 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 464 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 465 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 466 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 467 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 468 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 469 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 470 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 471 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 472 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 473 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 474 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 475 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 476 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 477 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 478 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 479 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 480 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 481 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 482 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 483 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 484 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 485 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 486 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 487 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 488 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 489 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 490 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 491 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 492 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 493 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 494 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 495 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 496 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 497 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 498 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 499 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 500 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 501 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 502 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 503 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 504 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 505 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 506 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 507 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 508 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 509 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 510 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 511 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 512 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 513 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 514 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 515 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 516 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 517 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 518 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 519 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 520 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 521 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 522 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 523 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 524 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 525 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 526 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 527 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 528 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 529 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 530 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 531 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 532 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 533 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 534 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 535 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 536 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 537 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 538 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 539 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 540 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 541 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 542 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 543 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 544 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 545 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 546 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 547 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 548 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 549 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 550 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 551 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 552 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 553 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 554 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 555 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 556 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 557 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 558 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 559 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 560 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 561 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 562 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 563 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 564 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 565 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 566 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 567 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 568 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 569 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 570 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 571 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 572 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 573 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 574 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 575 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 576 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 577 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 578 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 579 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 580 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 581 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 582 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 583 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 584 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 585 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 586 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 587 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 588 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 589 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 590 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 591 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 592 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 593 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 594 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 595 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 596 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 597 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 598 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 599 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 600 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 601 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 602 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 603 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 604 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 605 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 606 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 607 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 608 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 609 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 610 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 611 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 612 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 613 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 614 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 615 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 616 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 617 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 618 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 619 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 620 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 621 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 622 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 623 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 624 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 625 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 626 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 627 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 628 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 629 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 630 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 631 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 632 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 633 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 634 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 635 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 636 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 637 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 638 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 639 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 640 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 641 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 642 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 643 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 644 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 645 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 646 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 647 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 648 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 649 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 650 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 651 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 652 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 653 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 654 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 655 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 656 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 657 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 658 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 659 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 660 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 661 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 662 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 663 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 664 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 665 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 666 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 667 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 668 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 669 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 670 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 671 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 672 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 673 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 674 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 675 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 676 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 677 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 678 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 679 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 680 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 681 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 682 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 683 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 684 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 685 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 686 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 687 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 688 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 689 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 690 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 691 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 692 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 693 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 694 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 695 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 696 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 697 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 698 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 699 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 700 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 701 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 702 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 703 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 704 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 705 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 706 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 707 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 708 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 709 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 710 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 711 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 712 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 713 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 714 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 715 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 716 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 717 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 718 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 719 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 720 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 721 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 722 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 723 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 724 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 725 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 726 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 727 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 728 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 729 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 730 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 731 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 732 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 733 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 734 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 735 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 736 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 737 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 738 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 739 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 740 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 741 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 742 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 743 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 744 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 745 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 746 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 747 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 748 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 749 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 750 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 751 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 752 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 753 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 754 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 755 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 756 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 757 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 758 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 759 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 760 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 761 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 762 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 763 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 764 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 765 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 766 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 767 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 768 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 769 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 770 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 771 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 772 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 773 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 774 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 775 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 776 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 777 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 778 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 779 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 780 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 781 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 782 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 783 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 784 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 785 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 786 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 787 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 788 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 789 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 790 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 791 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 792 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 793 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 794 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 795 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 796 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 797 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 798 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 799 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 800 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 801 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 802 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 803 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 804 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 805 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 806 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 807 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 808 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 809 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 810 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 811 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 812 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 813 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 814 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 815 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 816 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 817 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 818 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 819 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 820 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 821 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 822 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 823 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 824 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 825 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 826 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 827 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 828 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 829 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 830 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 831 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 832 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 833 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 834 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 835 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 836 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 837 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 838 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 839 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 840 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 841 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 842 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 843 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 844 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 845 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 846 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 847 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 848 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 849 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 850 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 851 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 852 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 853 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 854 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 855 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 856 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 857 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 858 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 859 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 860 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 861 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 862 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 863 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 864 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 865 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 866 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 867 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 868 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 869 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 870 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 871 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 872 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 873 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 874 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 875 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 876 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 877 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 878 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 879 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 880 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 881 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 882 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 883 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 884 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 885 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 886 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 887 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 888 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 889 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 890 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 891 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 892 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 893 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 894 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 895 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 896 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 897 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 898 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 899 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 900 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 901 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 902 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 903 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 904 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 905 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 906 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 907 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 908 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 909 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 910 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 911 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 912 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 913 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 914 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 915 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 916 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 917 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 918 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 919 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 920 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 921 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 922 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 923 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 924 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 925 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 926 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 927 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 928 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 929 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 930 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 931 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 932 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 933 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 934 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 935 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 936 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 937 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 938 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 939 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 940 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 941 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 942 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 943 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 944 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 945 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 946 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 947 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 948 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 949 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 950 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 951 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 952 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 953 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 954 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 955 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 956 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 957 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 958 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 959 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 960 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 961 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 962 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 963 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 964 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 965 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 966 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 967 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 968 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 969 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 970 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 971 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 972 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 973 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 974 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 975 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 976 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 977 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 978 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 979 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 980 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 981 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 982 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 983 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 984 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 985 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 986 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 987 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 988 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 989 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 990 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 991 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 992 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 993 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 994 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 995 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 996 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 997 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 998 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ ││ 999 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ │╰─────┴───────────╯╭──────┬───────────╮│ 1000 │ ╭───┬───╮ ││ │ │ 0 │ 0 │ ││ │ ╰───┴───╯ │╰──────┴───────────╯" + ); } #[test] fn table_theme_arg() { let actual = nu!("[[a b, c]; [1 2 3] [4 5 [1 2 3]] [1 2 3]] | table --width=80 --theme light"); - assert_eq!(actual.out, " # a b c ──────────────────────────── 0 1 2 3 1 4 5 [list 3 items] 2 1 2 3 "); + assert_eq!( + actual.out, + " # a b c ──────────────────────────── 0 1 2 3 1 4 5 [list 3 items] 2 1 2 3 " + ); let actual = nu!(theme_cmd( "basic", false, "[[a b, c]; [1 2 3] [4 5 [1 2 3]] [1 2 3]] | table --width=80 --theme light" )); - assert_eq!(actual.out, "─#───a───b─────────c──────── 0 1 2 3 1 4 5 [list 3 items] 2 1 2 3 "); + assert_eq!( + actual.out, + "─#───a───b─────────c──────── 0 1 2 3 1 4 5 [list 3 items] 2 1 2 3 " + ); } #[test] fn table_index_arg() { let actual = nu!("[[a b]; [1 2] [2 [4 4]]] | table --width=80 --theme basic -i false"); - assert_eq!(actual.out, "+---+----------------+| a | b |+---+----------------+| 1 | 2 |+---+----------------+| 2 | [list 2 items] |+---+----------------+"); + assert_eq!( + actual.out, + "+---+----------------+| a | b |+---+----------------+| 1 | 2 |+---+----------------+| 2 | [list 2 items] |+---+----------------+" + ); let actual = nu!("[[a b]; [1 2] [2 [4 4]]] | table --width=80 --theme basic -i true"); - assert_eq!(actual.out, "+---+---+----------------+| # | a | b |+---+---+----------------+| 0 | 1 | 2 |+---+---+----------------+| 1 | 2 | [list 2 items] |+---+---+----------------+"); + assert_eq!( + actual.out, + "+---+---+----------------+| # | a | b |+---+---+----------------+| 0 | 1 | 2 |+---+---+----------------+| 1 | 2 | [list 2 items] |+---+---+----------------+" + ); let actual = nu!("[[a b]; [1 2] [2 [4 4]]] | table --width=80 --theme basic -i 10"); - assert_eq!(actual.out, "+----+---+----------------+| # | a | b |+----+---+----------------+| 10 | 1 | 2 |+----+---+----------------+| 11 | 2 | [list 2 items] |+----+---+----------------+"); + assert_eq!( + actual.out, + "+----+---+----------------+| # | a | b |+----+---+----------------+| 10 | 1 | 2 |+----+---+----------------+| 11 | 2 | [list 2 items] |+----+---+----------------+" + ); } #[test] @@ -3563,31 +3629,55 @@ fn table_expand_index_arg() { #[test] fn table_list() { let actual = nu!("table --list"); - assert_eq!(actual.out, "╭────┬────────────────╮│ 0 │ basic ││ 1 │ compact ││ 2 │ compact_double ││ 3 │ default ││ 4 │ heavy ││ 5 │ light ││ 6 │ none ││ 7 │ reinforced ││ 8 │ rounded ││ 9 │ thin ││ 10 │ with_love ││ 11 │ psql ││ 12 │ markdown ││ 13 │ dots ││ 14 │ restructured ││ 15 │ ascii_rounded ││ 16 │ basic_compact ││ 17 │ single │╰────┴────────────────╯"); + assert_eq!( + actual.out, + "╭────┬────────────────╮│ 0 │ basic ││ 1 │ compact ││ 2 │ compact_double ││ 3 │ default ││ 4 │ heavy ││ 5 │ light ││ 6 │ none ││ 7 │ reinforced ││ 8 │ rounded ││ 9 │ thin ││ 10 │ with_love ││ 11 │ psql ││ 12 │ markdown ││ 13 │ dots ││ 14 │ restructured ││ 15 │ ascii_rounded ││ 16 │ basic_compact ││ 17 │ single │╰────┴────────────────╯" + ); let actual = nu!("ls | table --list"); - assert_eq!(actual.out, "╭────┬────────────────╮│ 0 │ basic ││ 1 │ compact ││ 2 │ compact_double ││ 3 │ default ││ 4 │ heavy ││ 5 │ light ││ 6 │ none ││ 7 │ reinforced ││ 8 │ rounded ││ 9 │ thin ││ 10 │ with_love ││ 11 │ psql ││ 12 │ markdown ││ 13 │ dots ││ 14 │ restructured ││ 15 │ ascii_rounded ││ 16 │ basic_compact ││ 17 │ single │╰────┴────────────────╯"); + assert_eq!( + actual.out, + "╭────┬────────────────╮│ 0 │ basic ││ 1 │ compact ││ 2 │ compact_double ││ 3 │ default ││ 4 │ heavy ││ 5 │ light ││ 6 │ none ││ 7 │ reinforced ││ 8 │ rounded ││ 9 │ thin ││ 10 │ with_love ││ 11 │ psql ││ 12 │ markdown ││ 13 │ dots ││ 14 │ restructured ││ 15 │ ascii_rounded ││ 16 │ basic_compact ││ 17 │ single │╰────┴────────────────╯" + ); let actual = nu!("table --list --theme basic"); - assert_eq!(actual.out, "╭────┬────────────────╮│ 0 │ basic ││ 1 │ compact ││ 2 │ compact_double ││ 3 │ default ││ 4 │ heavy ││ 5 │ light ││ 6 │ none ││ 7 │ reinforced ││ 8 │ rounded ││ 9 │ thin ││ 10 │ with_love ││ 11 │ psql ││ 12 │ markdown ││ 13 │ dots ││ 14 │ restructured ││ 15 │ ascii_rounded ││ 16 │ basic_compact ││ 17 │ single │╰────┴────────────────╯"); + assert_eq!( + actual.out, + "╭────┬────────────────╮│ 0 │ basic ││ 1 │ compact ││ 2 │ compact_double ││ 3 │ default ││ 4 │ heavy ││ 5 │ light ││ 6 │ none ││ 7 │ reinforced ││ 8 │ rounded ││ 9 │ thin ││ 10 │ with_love ││ 11 │ psql ││ 12 │ markdown ││ 13 │ dots ││ 14 │ restructured ││ 15 │ ascii_rounded ││ 16 │ basic_compact ││ 17 │ single │╰────┴────────────────╯" + ); } #[test] fn table_kv_header_on_separator_trim_algorithm() { - let actual = nu!("$env.config.table.header_on_separator = true; {key1: '111111111111111111111111111111111111111111111111111111111111'} | table --width=60 --theme basic"); - assert_eq!(actual.out, "+------+---------------------------------------------------+| key1 | 1111111111111111111111111111111111111111111111111 || | 11111111111 |+------+---------------------------------------------------+"); + let actual = nu!( + "$env.config.table.header_on_separator = true; {key1: '111111111111111111111111111111111111111111111111111111111111'} | table --width=60 --theme basic" + ); + assert_eq!( + actual.out, + "+------+---------------------------------------------------+| key1 | 1111111111111111111111111111111111111111111111111 || | 11111111111 |+------+---------------------------------------------------+" + ); } #[test] fn table_general_header_on_separator_trim_algorithm() { - let actual = nu!("$env.config.table.header_on_separator = true; [[a b]; ['11111111111111111111111111111111111111' 2] ] | table --width=20 --theme basic"); - assert_eq!(actual.out, "+-#-+----a-----+-b-+| 0 | 11111111 | 2 || | 11111111 | || | 11111111 | || | 11111111 | || | 111111 | |+---+----------+---+"); + let actual = nu!( + "$env.config.table.header_on_separator = true; [[a b]; ['11111111111111111111111111111111111111' 2] ] | table --width=20 --theme basic" + ); + assert_eq!( + actual.out, + "+-#-+----a-----+-b-+| 0 | 11111111 | 2 || | 11111111 | || | 11111111 | || | 11111111 | || | 111111 | |+---+----------+---+" + ); } #[test] fn table_general_header_on_separator_issue1() { - let actual = nu!("$env.config.table.header_on_separator = true; [['Llll oo Bbbbbbbb' 'Bbbbbbbb Aaaa' Nnnnnn Ggggg 'Xxxxx Llllllll #' Bbb 'Pppp Ccccc' 'Rrrrrrrr Dddd' Rrrrrr 'Rrrrrr Ccccc II' 'Rrrrrr Ccccc Ppppppp II' 'Pppppp Dddddddd Tttt' 'Pppppp Dddddddd Dddd' 'Rrrrrrrrr Trrrrrr' 'Pppppp Ppppp Dddd' 'Ppppp Dddd' Hhhh]; [RRRRRRR FFFFFFFF UUUU VV 202407160001 BBB 1 '7/16/2024' '' AAA-1111 AAA-1111-11 '7 YEARS' 2555 'RRRRRRRR DDDD' '7/16/2031' '7/16/2031' NN]] | table --width=87 --theme basic"); - assert_eq!(actual.out, "+-#-+-Llll oo Bbbbbbbb-+-Bbbbbbbb Aaaa-+-Nnnnnn-+-Ggggg-+-Xxxxx Llllllll #-+-...-+| 0 | RRRRRRR | FFFFFFFF | UUUU | VV | 202407160001 | ... |+---+------------------+---------------+--------+-------+------------------+-----+"); + let actual = nu!( + "$env.config.table.header_on_separator = true; [['Llll oo Bbbbbbbb' 'Bbbbbbbb Aaaa' Nnnnnn Ggggg 'Xxxxx Llllllll #' Bbb 'Pppp Ccccc' 'Rrrrrrrr Dddd' Rrrrrr 'Rrrrrr Ccccc II' 'Rrrrrr Ccccc Ppppppp II' 'Pppppp Dddddddd Tttt' 'Pppppp Dddddddd Dddd' 'Rrrrrrrrr Trrrrrr' 'Pppppp Ppppp Dddd' 'Ppppp Dddd' Hhhh]; [RRRRRRR FFFFFFFF UUUU VV 202407160001 BBB 1 '7/16/2024' '' AAA-1111 AAA-1111-11 '7 YEARS' 2555 'RRRRRRRR DDDD' '7/16/2031' '7/16/2031' NN]] | table --width=87 --theme basic" + ); + assert_eq!( + actual.out, + "+-#-+-Llll oo Bbbbbbbb-+-Bbbbbbbb Aaaa-+-Nnnnnn-+-Ggggg-+-Xxxxx Llllllll #-+-...-+| 0 | RRRRRRR | FFFFFFFF | UUUU | VV | 202407160001 | ... |+---+------------------+---------------+--------+-------+------------------+-----+" + ); } #[test] @@ -3628,13 +3718,11 @@ fn table_footer_inheritance() { #[test] fn table_footer_inheritance_kv_rows() { - let actual = nu!( - concat!( - "$env.config.table.footer_inheritance = true;", - "$env.config.footer_mode = 7;", - "[[a b]; ['kv' {0: 0, 1: 1, 2: 2, 3: 3, 4: 4} ], ['data' 0], ['data' 0] ] | table --expand --width=80", - ) - ); + let actual = nu!(concat!( + "$env.config.table.footer_inheritance = true;", + "$env.config.footer_mode = 7;", + "[[a b]; ['kv' {0: 0, 1: 1, 2: 2, 3: 3, 4: 4} ], ['data' 0], ['data' 0] ] | table --expand --width=80", + )); assert_eq!( actual.out, @@ -3653,13 +3741,11 @@ fn table_footer_inheritance_kv_rows() { ╰───┴──────┴───────────╯" ); - let actual = nu!( - concat!( - "$env.config.table.footer_inheritance = true;", - "$env.config.footer_mode = 7;", - "[[a b]; ['kv' {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5} ], ['data' 0], ['data' 0] ] | table --expand --width=80", - ) - ); + let actual = nu!(concat!( + "$env.config.table.footer_inheritance = true;", + "$env.config.footer_mode = 7;", + "[[a b]; ['kv' {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5} ], ['data' 0], ['data' 0] ] | table --expand --width=80", + )); assert_eq!( actual.out, @@ -3684,13 +3770,11 @@ fn table_footer_inheritance_kv_rows() { #[test] fn table_footer_inheritance_list_rows() { - let actual = nu!( - concat!( - "$env.config.table.footer_inheritance = true;", - "$env.config.footer_mode = 7;", - "[[a b]; ['kv' {0: [[field]; [0] [1] [2] [3] [4]]} ], ['data' 0], ['data' 0] ] | table --expand --width=80", - ) - ); + let actual = nu!(concat!( + "$env.config.table.footer_inheritance = true;", + "$env.config.footer_mode = 7;", + "[[a b]; ['kv' {0: [[field]; [0] [1] [2] [3] [4]]} ], ['data' 0], ['data' 0] ] | table --expand --width=80", + )); assert_eq!( actual.out, @@ -3713,13 +3797,11 @@ fn table_footer_inheritance_list_rows() { ╰───┴──────┴───────────────────────╯" ); - let actual = nu!( - concat!( - "$env.config.table.footer_inheritance = true;", - "$env.config.footer_mode = 7;", - "[[a b]; ['kv' {0: [[field]; [0] [1] [2] [3] [4] [5]]} ], ['data' 0], ['data' 0] ] | table --expand --width=80", - ) - ); + let actual = nu!(concat!( + "$env.config.table.footer_inheritance = true;", + "$env.config.footer_mode = 7;", + "[[a b]; ['kv' {0: [[field]; [0] [1] [2] [3] [4] [5]]} ], ['data' 0], ['data' 0] ] | table --expand --width=80", + )); assert_eq!( actual.out, @@ -3755,7 +3837,7 @@ fn table_colors() { )); assert_eq!( actual.out, - "\u{1b}[37m╭───┬───╮\u{1b}[0m\u{1b}[37m│\u{1b}[0m \u{1b}[1;32ma\u{1b}[0m \u{1b}[37m│\u{1b}[0m \u{1b}[37m1\u{1b}[0m \u{1b}[37m│\u{1b}[0m\u{1b}[37m│\u{1b}[0m \u{1b}[1;32mb\u{1b}[0m \u{1b}[37m│\u{1b}[0m \u{1b}[37m2\u{1b}[0m \u{1b}[37m│\u{1b}[0m\u{1b}[37m╰───┴───╯\u{1b}[0m" + "\u{1b}[37m╭───┬───╮\u{1b}[0m\u{1b}[37m│\u{1b}[0m \u{1b}[1;32ma\u{1b}[0m \u{1b}[37m│\u{1b}[0m \u{1b}[37m1\u{1b}[0m \u{1b}[37m│\u{1b}[0m\u{1b}[37m│\u{1b}[0m \u{1b}[1;32mb\u{1b}[0m \u{1b}[37m│\u{1b}[0m \u{1b}[37m2\u{1b}[0m \u{1b}[37m│\u{1b}[0m\u{1b}[37m╰───┴───╯\u{1b}[0m" ); let actual = nu!(concat!( @@ -3767,7 +3849,9 @@ fn table_colors() { #[test] fn table_index() { - let actual = nu!("[[ index var ]; [ abc 1 ] [ def 2 ] [ ghi 3 ]] | table --width=80"); + let actual = nu!( + "[[ index var ]; [ abc 1 ] [ def 2 ] [ ghi 3 ]] | table --width=80" + ); assert_eq!( actual.out, "╭─────┬─────╮\ @@ -3782,7 +3866,9 @@ fn table_index() { #[test] fn table_index_expand() { - let actual = nu!("[[ index var ]; [ abc 1 ] [ def 2 ] [ ghi 3 ]] | table --width=80 --expand"); + let actual = nu!( + "[[ index var ]; [ abc 1 ] [ def 2 ] [ ghi 3 ]] | table --width=80 --expand" + ); assert_eq!( actual.out, "╭─────┬─────╮\ diff --git a/crates/nu-command/tests/commands/try_.rs b/crates/nu-command/tests/commands/try_.rs index 65a36db6e1..a58bf1525a 100644 --- a/crates/nu-command/tests/commands/try_.rs +++ b/crates/nu-command/tests/commands/try_.rs @@ -146,8 +146,11 @@ fn get_error_columns() { #[test] fn get_json_error() { - let actual = nu!("try { non_existent_command } catch {|err| $err} | get json | from json | update labels.span {{start: 0 end: 0}} | to json -r"); + let actual = nu!( + "try { non_existent_command } catch {|err| $err} | get json | from json | update labels.span {{start: 0 end: 0}} | to json -r" + ); assert_eq!( - actual.out, "{\"msg\":\"External command failed\",\"labels\":[{\"text\":\"Command `non_existent_command` not found\",\"span\":{\"start\":0,\"end\":0}}],\"code\":\"nu::shell::external_command\",\"url\":null,\"help\":\"`non_existent_command` is neither a Nushell built-in or a known external command\",\"inner\":[]}" + actual.out, + "{\"msg\":\"External command failed\",\"labels\":[{\"text\":\"Command `non_existent_command` not found\",\"span\":{\"start\":0,\"end\":0}}],\"code\":\"nu::shell::external_command\",\"url\":null,\"help\":\"`non_existent_command` is neither a Nushell built-in or a known external command\",\"inner\":[]}" ); } diff --git a/crates/nu-command/tests/commands/ucp.rs b/crates/nu-command/tests/commands/ucp.rs index 9b4cdce889..55ae518ea5 100644 --- a/crates/nu-command/tests/commands/ucp.rs +++ b/crates/nu-command/tests/commands/ucp.rs @@ -1,7 +1,7 @@ use nu_test_support::fs::file_contents; use nu_test_support::fs::{ - files_exist_at, Stub::{EmptyFile, FileWithContent, FileWithPermission}, + files_exist_at, }; use nu_test_support::nu; use nu_test_support::playground::Playground; @@ -928,14 +928,16 @@ fn test_cp_verbose_default() { src.display(), TEST_HELLO_WORLD_DEST ); - assert!(actual.out.contains( - format!( - "'{}' -> '{}'", - src.display(), - dirs.root().join(TEST_HELLO_WORLD_DEST).display() + assert!( + actual.out.contains( + format!( + "'{}' -> '{}'", + src.display(), + dirs.root().join(TEST_HELLO_WORLD_DEST).display() + ) + .as_str(), ) - .as_str(), - )); + ); }); } @@ -948,9 +950,11 @@ fn test_cp_only_source_no_dest() { "cp {}", src.display(), ); - assert!(actual - .err - .contains("Missing destination path operand after")); + assert!( + actual + .err + .contains("Missing destination path operand after") + ); assert!(actual.err.contains(TEST_HELLO_WORLD_SOURCE)); }); } @@ -1159,7 +1163,9 @@ fn test_cp_inside_glob_metachars_dir() { #[test] fn test_cp_to_customized_home_directory() { Playground::setup("cp_to_home", |dirs, sandbox| { - std::env::set_var("HOME", dirs.test()); + unsafe { + std::env::set_var("HOME", dirs.test()); + } sandbox.with_files(&[EmptyFile("test_file.txt")]); let actual = nu!(cwd: dirs.test(), "mkdir test; cp test_file.txt ~/test/"); diff --git a/crates/nu-command/tests/commands/ulimit.rs b/crates/nu-command/tests/commands/ulimit.rs index 673eb7aa52..e1c2576330 100644 --- a/crates/nu-command/tests/commands/ulimit.rs +++ b/crates/nu-command/tests/commands/ulimit.rs @@ -119,9 +119,11 @@ fn limit_set_invalid3() { " ); - assert!(actual - .err - .contains("Only unlimited, soft and hard are supported for strings")); + assert!( + actual + .err + .contains("Only unlimited, soft and hard are supported for strings") + ); }); } @@ -211,8 +213,10 @@ fn limit_set_filesize2() { " ); - assert!(actual - .err - .contains("filesize is not compatible with resource RLIMIT_NOFILE")); + assert!( + actual + .err + .contains("filesize is not compatible with resource RLIMIT_NOFILE") + ); }); } diff --git a/crates/nu-command/tests/commands/uniq.rs b/crates/nu-command/tests/commands/uniq.rs index f543bda24d..4324da8f26 100644 --- a/crates/nu-command/tests/commands/uniq.rs +++ b/crates/nu-command/tests/commands/uniq.rs @@ -155,7 +155,9 @@ fn table() { " )); - let expected = nu!("[[fruit day]; [apple monday] [apple friday] [Apple friday] [pear monday] [orange tuesday]]"); + let expected = nu!( + "[[fruit day]; [apple monday] [apple friday] [Apple friday] [pear monday] [orange tuesday]]" + ); assert_eq!(actual.out, expected.out); } diff --git a/crates/nu-command/tests/commands/upsert.rs b/crates/nu-command/tests/commands/upsert.rs index 0ce8307e70..0dc8fd9d3e 100644 --- a/crates/nu-command/tests/commands/upsert.rs +++ b/crates/nu-command/tests/commands/upsert.rs @@ -61,7 +61,9 @@ fn upsert_uses_enumerate_index_inserting() { #[test] fn upsert_uses_enumerate_index_updating() { - let actual = nu!("[[a]; [7] [6]] | enumerate | upsert a {|el| $el.index + 1 + $el.item.a } | flatten | to nuon"); + let actual = nu!( + "[[a]; [7] [6]] | enumerate | upsert a {|el| $el.index + 1 + $el.item.a } | flatten | to nuon" + ); assert_eq!(actual.out, "[[index, a]; [0, 8], [1, 8]]"); } @@ -84,9 +86,11 @@ fn upsert_at_end_of_list() { fn upsert_past_end_of_list() { let actual = nu!("[1, 2, 3] | upsert 5 abc"); - assert!(actual - .err - .contains("can't insert at index (the next available index is 3)")); + assert!( + actual + .err + .contains("can't insert at index (the next available index is 3)") + ); } #[test] @@ -107,9 +111,11 @@ fn upsert_at_end_of_list_stream() { fn upsert_past_end_of_list_stream() { let actual = nu!("[1, 2, 3] | every 1 | upsert 5 abc"); - assert!(actual - .err - .contains("can't insert at index (the next available index is 3)")); + assert!( + actual + .err + .contains("can't insert at index (the next available index is 3)") + ); } #[test] diff --git a/crates/nu-command/tests/commands/url/join.rs b/crates/nu-command/tests/commands/url/join.rs index 086d230cc4..0ca98197cf 100644 --- a/crates/nu-command/tests/commands/url/join.rs +++ b/crates/nu-command/tests/commands/url/join.rs @@ -154,12 +154,16 @@ fn url_join_with_different_query_and_params() { "# )); - assert!(actual - .err - .contains("Mismatch, query string from params is: ?par_1=aaab&par_2=bbb")); - assert!(actual - .err - .contains("instead query is: ?par_1=aaa&par_2=bbb")); + assert!( + actual + .err + .contains("Mismatch, query string from params is: ?par_1=aaab&par_2=bbb") + ); + assert!( + actual + .err + .contains("instead query is: ?par_1=aaa&par_2=bbb") + ); let actual = nu!(pipeline( r#" @@ -178,12 +182,16 @@ fn url_join_with_different_query_and_params() { "# )); - assert!(actual - .err - .contains("Mismatch, query param is: par_1=aaa&par_2=bbb")); - assert!(actual - .err - .contains("instead query string from params is: ?par_1=aaab&par_2=bbb")); + assert!( + actual + .err + .contains("Mismatch, query param is: par_1=aaa&par_2=bbb") + ); + assert!( + actual + .err + .contains("instead query string from params is: ?par_1=aaab&par_2=bbb") + ); } #[test] @@ -201,9 +209,11 @@ fn url_join_with_invalid_params() { "# )); - assert!(actual - .err - .contains("Key params has to be a record or a table")); + assert!( + actual + .err + .contains("Key params has to be a record or a table") + ); } #[test] @@ -245,9 +255,11 @@ fn url_join_with_invalid_port() { "# )); - assert!(actual - .err - .contains("Port parameter should represent an unsigned int")); + assert!( + actual + .err + .contains("Port parameter should represent an unsigned int") + ); let actual = nu!(pipeline( r#" @@ -259,9 +271,11 @@ fn url_join_with_invalid_port() { "# )); - assert!(actual - .err - .contains("Port parameter should be an unsigned int or a string representing it")); + assert!( + actual + .err + .contains("Port parameter should be an unsigned int or a string representing it") + ); } #[test] @@ -421,7 +435,9 @@ fn url_join_with_params_invalid_table() { )); assert!(actual.err.contains("expected a table")); - assert!(actual - .err - .contains("not a table, contains non-record values")); + assert!( + actual + .err + .contains("not a table, contains non-record values") + ); } diff --git a/crates/nu-command/tests/commands/use_.rs b/crates/nu-command/tests/commands/use_.rs index cb5f262e72..3873f048f5 100644 --- a/crates/nu-command/tests/commands/use_.rs +++ b/crates/nu-command/tests/commands/use_.rs @@ -196,9 +196,11 @@ fn use_module_creates_accurate_did_you_mean_2() { let actual = nu!(r#" module spam { export def foo [] { "foo" } }; foo "#); - assert!(actual - .err - .contains("A command with that name exists in module `spam`")); + assert!( + actual + .err + .contains("A command with that name exists in module `spam`") + ); } #[test] diff --git a/crates/nu-command/tests/commands/utouch.rs b/crates/nu-command/tests/commands/utouch.rs index acdf62ac59..9bbe7b796c 100644 --- a/crates/nu-command/tests/commands/utouch.rs +++ b/crates/nu-command/tests/commands/utouch.rs @@ -1,6 +1,6 @@ use chrono::{DateTime, Days, Local, TimeDelta, Utc}; use filetime::FileTime; -use nu_test_support::fs::{files_exist_at, Stub}; +use nu_test_support::fs::{Stub, files_exist_at}; use nu_test_support::nu; use nu_test_support::playground::{Dirs, Playground}; use std::path::Path; diff --git a/crates/nu-command/tests/commands/window.rs b/crates/nu-command/tests/commands/window.rs index 6e4addc6c0..2521a6b783 100644 --- a/crates/nu-command/tests/commands/window.rs +++ b/crates/nu-command/tests/commands/window.rs @@ -50,7 +50,9 @@ fn list_stream() { #[test] fn table_stream() { - let actual = nu!("([[foo bar]; [0 1] [2 3] [4 5]] | every 1 | window 2) == ([[foo bar]; [0 1] [2 3] [4 5]] | window 2)"); + let actual = nu!( + "([[foo bar]; [0 1] [2 3] [4 5]] | every 1 | window 2) == ([[foo bar]; [0 1] [2 3] [4 5]] | window 2)" + ); assert_eq!(actual.out, "true"); } diff --git a/crates/nu-command/tests/format_conversions/csv.rs b/crates/nu-command/tests/format_conversions/csv.rs index c071b3566c..c098bc9f20 100644 --- a/crates/nu-command/tests/format_conversions/csv.rs +++ b/crates/nu-command/tests/format_conversions/csv.rs @@ -38,9 +38,11 @@ fn table_to_csv_text() { "# )); - assert!(actual - .out - .contains("Tigre Ecuador,OMYA Andina,3824909999,Calcium carbonate,Colombia")); + assert!( + actual + .out + .contains("Tigre Ecuador,OMYA Andina,3824909999,Calcium carbonate,Colombia") + ); }) } @@ -68,9 +70,11 @@ fn table_to_csv_text_skipping_headers_after_conversion() { "# )); - assert!(actual - .out - .contains("Tigre Ecuador,OMYA Andina,3824909999,Calcium carbonate,Colombia")); + assert!( + actual + .out + .contains("Tigre Ecuador,OMYA Andina,3824909999,Calcium carbonate,Colombia") + ); }) } @@ -342,9 +346,11 @@ fn from_csv_text_with_multiple_char_separator() { "# )); - assert!(actual - .err - .contains("separator should be a single char or a 4-byte unicode")); + assert!( + actual + .err + .contains("separator should be a single char or a 4-byte unicode") + ); }) } diff --git a/crates/nu-command/tests/format_conversions/json.rs b/crates/nu-command/tests/format_conversions/json.rs index 643e4c3f22..9b6c0453d7 100644 --- a/crates/nu-command/tests/format_conversions/json.rs +++ b/crates/nu-command/tests/format_conversions/json.rs @@ -257,9 +257,11 @@ fn inf_in_range_fails() { let actual = nu!(r#"inf..5 | to json"#); assert!(actual.err.contains("can't convert to countable values")); let actual = nu!(r#"5..inf | to json"#); - assert!(actual - .err - .contains("Unbounded ranges are not allowed when converting to this format")); + assert!( + actual + .err + .contains("Unbounded ranges are not allowed when converting to this format") + ); let actual = nu!(r#"-inf..inf | to json"#); assert!(actual.err.contains("can't convert to countable values")); } diff --git a/crates/nu-command/tests/format_conversions/msgpack.rs b/crates/nu-command/tests/format_conversions/msgpack.rs index ae742cbfba..578e96efd5 100644 --- a/crates/nu-command/tests/format_conversions/msgpack.rs +++ b/crates/nu-command/tests/format_conversions/msgpack.rs @@ -9,16 +9,18 @@ fn msgpack_test(fixture_name: &str, commands: Option<&str>) -> nu_test_support:: let mut outcome = None; Playground::setup(&format!("msgpack test {}", fixture_name), |dirs, _| { - assert!(nu!( - cwd: dirs.test(), - format!( - "nu -n '{}' '{}'", - path_to_generate_nu.display(), - fixture_name - ), - ) - .status - .success()); + assert!( + nu!( + cwd: dirs.test(), + format!( + "nu -n '{}' '{}'", + path_to_generate_nu.display(), + fixture_name + ), + ) + .status + .success() + ); outcome = Some(nu!( cwd: dirs.test(), diff --git a/crates/nu-command/tests/sort_utils.rs b/crates/nu-command/tests/sort_utils.rs index be305588e2..60e2ac6769 100644 --- a/crates/nu-command/tests/sort_utils.rs +++ b/crates/nu-command/tests/sort_utils.rs @@ -1,7 +1,8 @@ -use nu_command::{sort, sort_by, sort_record, Comparator}; +use nu_command::{Comparator, sort, sort_by, sort_record}; use nu_protocol::{ + Record, Span, Value, ast::{CellPath, PathMember}, - record, Record, Span, Value, + record, }; #[test] @@ -530,14 +531,16 @@ fn test_sort_equivalent() { }); assert!(sort(&mut list, false, false).is_ok()); - assert!(sort_by( - &mut table, - vec![comparator], - Span::test_data(), - false, - false - ) - .is_ok()); + assert!( + sort_by( + &mut table, + vec![comparator], + Span::test_data(), + false, + false + ) + .is_ok() + ); let record_sorted = sort_record(record.clone(), true, false, false, false).unwrap(); let record_vals: Vec = record_sorted.into_iter().map(|pair| pair.1).collect(); diff --git a/crates/nu-derive-value/Cargo.toml b/crates/nu-derive-value/Cargo.toml index 24e70abac0..14e2938e18 100644 --- a/crates/nu-derive-value/Cargo.toml +++ b/crates/nu-derive-value/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["The Nushell Project Developers"] description = "Macros implementation of #[derive(FromValue, IntoValue)]" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-derive-value" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-derive-value" @@ -21,4 +21,4 @@ proc-macro2 = { workspace = true } syn = { workspace = true } quote = { workspace = true } proc-macro-error2 = { workspace = true } -heck = { workspace = true } \ No newline at end of file +heck = { workspace = true } diff --git a/crates/nu-derive-value/src/attributes.rs b/crates/nu-derive-value/src/attributes.rs index f13ac51ce6..37d1988890 100644 --- a/crates/nu-derive-value/src/attributes.rs +++ b/crates/nu-derive-value/src/attributes.rs @@ -1,6 +1,6 @@ -use syn::{meta::ParseNestedMeta, spanned::Spanned, Attribute, Fields, LitStr}; +use syn::{Attribute, Fields, LitStr, meta::ParseNestedMeta, spanned::Spanned}; -use crate::{case::Case, error::DeriveError, HELPER_ATTRIBUTE}; +use crate::{HELPER_ATTRIBUTE, case::Case, error::DeriveError}; pub trait ParseAttrs: Default { fn parse_attrs<'a, M>( diff --git a/crates/nu-derive-value/src/error.rs b/crates/nu-derive-value/src/error.rs index d5f3587b33..eb9bd28717 100644 --- a/crates/nu-derive-value/src/error.rs +++ b/crates/nu-derive-value/src/error.rs @@ -1,7 +1,7 @@ use std::{any, fmt::Debug, marker::PhantomData}; -use proc_macro2::Span; use proc_macro_error2::{Diagnostic, Level}; +use proc_macro2::Span; #[derive(Debug)] pub enum DeriveError { diff --git a/crates/nu-derive-value/src/from.rs b/crates/nu-derive-value/src/from.rs index ee5f9f823e..dc5f837f77 100644 --- a/crates/nu-derive-value/src/from.rs +++ b/crates/nu-derive-value/src/from.rs @@ -1,8 +1,8 @@ use proc_macro2::TokenStream as TokenStream2; -use quote::{quote, ToTokens}; +use quote::{ToTokens, quote}; use syn::{ - spanned::Spanned, Attribute, Data, DataEnum, DataStruct, DeriveInput, Fields, Generics, Ident, - Type, + Attribute, Data, DataEnum, DataStruct, DeriveInput, Fields, Generics, Ident, Type, + spanned::Spanned, }; use crate::{ diff --git a/crates/nu-derive-value/src/into.rs b/crates/nu-derive-value/src/into.rs index 4a52119097..de34a89a1f 100644 --- a/crates/nu-derive-value/src/into.rs +++ b/crates/nu-derive-value/src/into.rs @@ -1,8 +1,8 @@ use proc_macro2::TokenStream as TokenStream2; -use quote::{quote, ToTokens}; +use quote::{ToTokens, quote}; use syn::{ - spanned::Spanned, Attribute, Data, DataEnum, DataStruct, DeriveInput, Fields, Generics, Ident, - Index, + Attribute, Data, DataEnum, DataStruct, DeriveInput, Fields, Generics, Ident, Index, + spanned::Spanned, }; use crate::{ diff --git a/crates/nu-derive-value/src/lib.rs b/crates/nu-derive-value/src/lib.rs index 611f713b64..1324516d55 100644 --- a/crates/nu-derive-value/src/lib.rs +++ b/crates/nu-derive-value/src/lib.rs @@ -28,8 +28,8 @@ //! but ensures that no other code may influence this generated code or vice versa. use proc_macro::TokenStream; +use proc_macro_error2::{Diagnostic, proc_macro_error}; use proc_macro2::TokenStream as TokenStream2; -use proc_macro_error2::{proc_macro_error, Diagnostic}; mod attributes; mod case; diff --git a/crates/nu-derive-value/src/names.rs b/crates/nu-derive-value/src/names.rs index 3a8867121b..825f3e47e8 100644 --- a/crates/nu-derive-value/src/names.rs +++ b/crates/nu-derive-value/src/names.rs @@ -1,7 +1,7 @@ use proc_macro2::Span; use std::collections::HashMap; -use syn::ext::IdentExt; use syn::Ident; +use syn::ext::IdentExt; use crate::attributes::{ContainerAttributes, MemberAttributes}; use crate::case::{Case, Casing}; diff --git a/crates/nu-engine/Cargo.toml b/crates/nu-engine/Cargo.toml index 7d8b8a278a..57b46c3eb5 100644 --- a/crates/nu-engine/Cargo.toml +++ b/crates/nu-engine/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Nushell's evaluation engine" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-engine" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-engine" version = "0.104.1" @@ -29,4 +29,4 @@ os = [ plugin = [ "nu-protocol/plugin", "os", -] \ No newline at end of file +] diff --git a/crates/nu-engine/src/call_ext.rs b/crates/nu-engine/src/call_ext.rs index 4473739b35..7698a50b95 100644 --- a/crates/nu-engine/src/call_ext.rs +++ b/crates/nu-engine/src/call_ext.rs @@ -1,10 +1,10 @@ use crate::eval_expression; use nu_protocol::{ - ast, + FromValue, ShellError, Span, Value, ast, debugger::WithoutDebug, engine::{self, EngineState, Stack, StateWorkingSet}, eval_const::eval_constant, - ir, FromValue, ShellError, Span, Value, + ir, }; pub trait CallExt { diff --git a/crates/nu-engine/src/closure_eval.rs b/crates/nu-engine/src/closure_eval.rs index 66c6287cca..6778c09a52 100644 --- a/crates/nu-engine/src/closure_eval.rs +++ b/crates/nu-engine/src/closure_eval.rs @@ -1,11 +1,11 @@ use crate::{ - eval_block_with_early_return, get_eval_block_with_early_return, EvalBlockWithEarlyReturnFn, + EvalBlockWithEarlyReturnFn, eval_block_with_early_return, get_eval_block_with_early_return, }; use nu_protocol::{ + IntoPipelineData, PipelineData, ShellError, Value, ast::Block, debugger::{WithDebug, WithoutDebug}, engine::{Closure, EngineState, EnvVars, Stack}, - IntoPipelineData, PipelineData, ShellError, Value, }; use std::{ borrow::Cow, diff --git a/crates/nu-engine/src/command_prelude.rs b/crates/nu-engine/src/command_prelude.rs index 39124af1d4..c6073add4b 100644 --- a/crates/nu-engine/src/command_prelude.rs +++ b/crates/nu-engine/src/command_prelude.rs @@ -1,10 +1,10 @@ pub use crate::CallExt; pub use nu_protocol::{ + ByteStream, ByteStreamType, Category, ErrSpan, Example, IntoInterruptiblePipelineData, + IntoPipelineData, IntoSpanned, IntoValue, PipelineData, Record, ShellError, Signature, Span, + Spanned, SyntaxShape, Type, Value, ast::CellPath, engine::{Call, Command, EngineState, Stack, StateWorkingSet}, record, shell_error::io::*, - ByteStream, ByteStreamType, Category, ErrSpan, Example, IntoInterruptiblePipelineData, - IntoPipelineData, IntoSpanned, IntoValue, PipelineData, Record, ShellError, Signature, Span, - Spanned, SyntaxShape, Type, Value, }; diff --git a/crates/nu-engine/src/compile/builder.rs b/crates/nu-engine/src/compile/builder.rs index 71f41ee210..4d9117f4da 100644 --- a/crates/nu-engine/src/compile/builder.rs +++ b/crates/nu-engine/src/compile/builder.rs @@ -1,7 +1,7 @@ use nu_protocol::{ + CompileError, IntoSpanned, RegId, Span, Spanned, ast::Pattern, ir::{DataSlice, Instruction, IrAstRef, IrBlock, Literal}, - CompileError, IntoSpanned, RegId, Span, Spanned, }; /// A label identifier. Only exists while building code. Replaced with the actual target. diff --git a/crates/nu-engine/src/compile/call.rs b/crates/nu-engine/src/compile/call.rs index e58a7b3efe..3729489dd2 100644 --- a/crates/nu-engine/src/compile/call.rs +++ b/crates/nu-engine/src/compile/call.rs @@ -1,13 +1,13 @@ use std::sync::Arc; use nu_protocol::{ + IntoSpanned, RegId, Span, Spanned, ast::{Argument, Call, Expression, ExternalArgument}, engine::StateWorkingSet, ir::{Instruction, IrAstRef, Literal}, - IntoSpanned, RegId, Span, Spanned, }; -use super::{compile_expression, keyword::*, BlockBuilder, CompileError, RedirectModes}; +use super::{BlockBuilder, CompileError, RedirectModes, compile_expression, keyword::*}; pub(crate) fn compile_call( working_set: &StateWorkingSet, diff --git a/crates/nu-engine/src/compile/expression.rs b/crates/nu-engine/src/compile/expression.rs index 82fbcf9022..3fcbbac599 100644 --- a/crates/nu-engine/src/compile/expression.rs +++ b/crates/nu-engine/src/compile/expression.rs @@ -1,13 +1,13 @@ use super::{ - compile_binary_op, compile_block, compile_call, compile_external_call, compile_load_env, - BlockBuilder, CompileError, RedirectModes, + BlockBuilder, CompileError, RedirectModes, compile_binary_op, compile_block, compile_call, + compile_external_call, compile_load_env, }; use nu_protocol::{ + ENV_VARIABLE_ID, IntoSpanned, RegId, Span, Value, ast::{CellPath, Expr, Expression, ListItem, RecordItem, ValueWithUnit}, engine::StateWorkingSet, ir::{DataSlice, Instruction, Literal}, - IntoSpanned, RegId, Span, Value, ENV_VARIABLE_ID, }; pub(crate) fn compile_expression( diff --git a/crates/nu-engine/src/compile/keyword.rs b/crates/nu-engine/src/compile/keyword.rs index 7d5b2abf29..971b8c71df 100644 --- a/crates/nu-engine/src/compile/keyword.rs +++ b/crates/nu-engine/src/compile/keyword.rs @@ -1,11 +1,11 @@ use nu_protocol::{ + IntoSpanned, RegId, Type, VarId, ast::{Block, Call, Expr, Expression}, engine::StateWorkingSet, ir::Instruction, - IntoSpanned, RegId, Type, VarId, }; -use super::{compile_block, compile_expression, BlockBuilder, CompileError, RedirectModes}; +use super::{BlockBuilder, CompileError, RedirectModes, compile_block, compile_expression}; /// Compile a call to `if` as a branch-if pub(crate) fn compile_if( diff --git a/crates/nu-engine/src/compile/mod.rs b/crates/nu-engine/src/compile/mod.rs index f68232f9cb..5995e83d37 100644 --- a/crates/nu-engine/src/compile/mod.rs +++ b/crates/nu-engine/src/compile/mod.rs @@ -1,8 +1,8 @@ use nu_protocol::{ + CompileError, IntoSpanned, RegId, Span, ast::{Block, Expr, Pipeline, PipelineRedirection, RedirectionSource, RedirectionTarget}, engine::StateWorkingSet, ir::{Instruction, IrBlock, RedirectMode}, - CompileError, IntoSpanned, RegId, Span, }; mod builder; diff --git a/crates/nu-engine/src/compile/operator.rs b/crates/nu-engine/src/compile/operator.rs index 2a913f8836..5e67410922 100644 --- a/crates/nu-engine/src/compile/operator.rs +++ b/crates/nu-engine/src/compile/operator.rs @@ -1,12 +1,12 @@ use nu_protocol::{ + ENV_VARIABLE_ID, IntoSpanned, RegId, Span, Spanned, Value, ast::{Assignment, Boolean, CellPath, Expr, Expression, Math, Operator, PathMember, Pattern}, engine::StateWorkingSet, ir::{Instruction, Literal}, - IntoSpanned, RegId, Span, Spanned, Value, ENV_VARIABLE_ID, }; use nu_utils::IgnoreCaseExt; -use super::{compile_expression, BlockBuilder, CompileError, RedirectModes}; +use super::{BlockBuilder, CompileError, RedirectModes, compile_expression}; pub(crate) fn compile_binary_op( working_set: &StateWorkingSet, @@ -342,11 +342,14 @@ pub(crate) fn compile_load_env( .into_spanned(span), )?, [PathMember::Int { span, .. }, ..] => { - return Err(CompileError::AccessEnvByInt { span: *span }) + return Err(CompileError::AccessEnvByInt { span: *span }); } - [PathMember::String { - val: key, optional, .. - }, tail @ ..] => { + [ + PathMember::String { + val: key, optional, .. + }, + tail @ .., + ] => { let key = builder.data(key)?; builder.push(if *optional { diff --git a/crates/nu-engine/src/compile/redirect.rs b/crates/nu-engine/src/compile/redirect.rs index 8d780177d9..02011fbeb7 100644 --- a/crates/nu-engine/src/compile/redirect.rs +++ b/crates/nu-engine/src/compile/redirect.rs @@ -1,11 +1,11 @@ use nu_protocol::{ + IntoSpanned, OutDest, RegId, Span, Spanned, ast::{Expression, RedirectionTarget}, engine::StateWorkingSet, ir::{Instruction, RedirectMode}, - IntoSpanned, OutDest, RegId, Span, Spanned, }; -use super::{compile_expression, BlockBuilder, CompileError}; +use super::{BlockBuilder, CompileError, compile_expression}; #[derive(Default, Clone)] pub(crate) struct RedirectModes { diff --git a/crates/nu-engine/src/documentation.rs b/crates/nu-engine/src/documentation.rs index 78c11bc4d0..36f4a301d3 100644 --- a/crates/nu-engine/src/documentation.rs +++ b/crates/nu-engine/src/documentation.rs @@ -1,11 +1,12 @@ use crate::eval_call; use nu_protocol::{ + Category, Config, Example, IntoPipelineData, PipelineData, PositionalArg, Signature, Span, + SpanId, Spanned, SyntaxShape, Type, Value, ast::{Argument, Call, Expr, Expression, RecordItem}, debugger::WithoutDebug, engine::CommandType, engine::{Command, EngineState, Stack, UNKNOWN_SPAN_ID}, - record, Category, Config, Example, IntoPipelineData, PipelineData, PositionalArg, Signature, - Span, SpanId, Spanned, SyntaxShape, Type, Value, + record, }; use nu_utils::terminal_size; use std::{collections::HashMap, fmt::Write}; diff --git a/crates/nu-engine/src/env.rs b/crates/nu-engine/src/env.rs index 5a2a201911..088037fc44 100644 --- a/crates/nu-engine/src/env.rs +++ b/crates/nu-engine/src/env.rs @@ -1,10 +1,10 @@ use crate::ClosureEvalOnce; use nu_path::canonicalize_with; use nu_protocol::{ + ShellError, Span, Type, Value, VarId, ast::Expr, engine::{Call, EngineState, Stack, StateWorkingSet}, shell_error::io::{ErrorKindExt, IoError, NotFound}, - ShellError, Span, Type, Value, VarId, }; use std::{ collections::HashMap, @@ -307,11 +307,13 @@ pub fn find_in_dirs_env( cwd } else { return Err(ShellError::GenericError { - error: "Invalid current directory".into(), - msg: format!("The 'FILE_PWD' environment variable must be set to an absolute path. Found: '{cwd}'"), - span: Some(pwd.span()), - help: None, - inner: vec![] + error: "Invalid current directory".into(), + msg: format!( + "The 'FILE_PWD' environment variable must be set to an absolute path. Found: '{cwd}'" + ), + span: Some(pwd.span()), + help: None, + inner: vec![], }); } } diff --git a/crates/nu-engine/src/eval.rs b/crates/nu-engine/src/eval.rs index c39dd0cf30..392042f384 100644 --- a/crates/nu-engine/src/eval.rs +++ b/crates/nu-engine/src/eval.rs @@ -1,14 +1,14 @@ use crate::eval_ir_block; #[allow(deprecated)] use crate::get_full_help; -use nu_path::{expand_path_with, AbsolutePathBuf}; +use nu_path::{AbsolutePathBuf, expand_path_with}; use nu_protocol::{ + BlockId, Config, DataSource, ENV_VARIABLE_ID, IntoPipelineData, PipelineData, PipelineMetadata, + ShellError, Span, Value, VarId, ast::{Assignment, Block, Call, Expr, Expression, ExternalArgument, PathMember}, debugger::DebugContext, engine::{Closure, EngineState, Stack}, eval_base::Eval, - BlockId, Config, DataSource, IntoPipelineData, PipelineData, PipelineMetadata, ShellError, - Span, Value, VarId, ENV_VARIABLE_ID, }; use nu_utils::IgnoreCaseExt; use std::sync::Arc; diff --git a/crates/nu-engine/src/eval_helpers.rs b/crates/nu-engine/src/eval_helpers.rs index baa7bf432b..92b74d4aee 100644 --- a/crates/nu-engine/src/eval_helpers.rs +++ b/crates/nu-engine/src/eval_helpers.rs @@ -3,10 +3,10 @@ use crate::{ eval_ir_block, eval_subexpression, }; use nu_protocol::{ + PipelineData, ShellError, Value, ast::{Block, Expression}, debugger::{WithDebug, WithoutDebug}, engine::{EngineState, Stack}, - PipelineData, ShellError, Value, }; /// Type of eval_block() function diff --git a/crates/nu-engine/src/eval_ir.rs b/crates/nu-engine/src/eval_ir.rs index ffd0938079..4d129d3542 100644 --- a/crates/nu-engine/src/eval_ir.rs +++ b/crates/nu-engine/src/eval_ir.rs @@ -1,7 +1,10 @@ use std::{borrow::Cow, fs::File, sync::Arc}; -use nu_path::{expand_path_with, AbsolutePathBuf}; +use nu_path::{AbsolutePathBuf, expand_path_with}; use nu_protocol::{ + DataSource, DeclId, ENV_VARIABLE_ID, Flag, IntoPipelineData, IntoSpanned, ListStream, OutDest, + PipelineData, PipelineMetadata, PositionalArg, Range, Record, RegId, ShellError, Signals, + Signature, Span, Spanned, Type, Value, VarId, ast::{Bits, Block, Boolean, CellPath, Comparison, Math, Operator}, debugger::DebugContext, engine::{ @@ -9,14 +12,11 @@ use nu_protocol::{ }, ir::{Call, DataSlice, Instruction, IrAstRef, IrBlock, Literal, RedirectMode}, shell_error::io::IoError, - DataSource, DeclId, Flag, IntoPipelineData, IntoSpanned, ListStream, OutDest, PipelineData, - PipelineMetadata, PositionalArg, Range, Record, RegId, ShellError, Signals, Signature, Span, - Spanned, Type, Value, VarId, ENV_VARIABLE_ID, }; use nu_utils::IgnoreCaseExt; use crate::{ - convert_env_vars, eval::is_automatic_env_var, eval_block_with_early_return, ENV_CONVERSIONS, + ENV_CONVERSIONS, convert_env_vars, eval::is_automatic_env_var, eval_block_with_early_return, }; /// Evaluate the compiled representation of a [`Block`]. @@ -994,7 +994,7 @@ fn binary_op( return Err(ShellError::IrEvalError { msg: "can't eval assignment with the `binary-op` instruction".into(), span: Some(span), - }) + }); } }; @@ -1322,7 +1322,7 @@ fn check_input_types( return Err(ShellError::NushellFailed { msg: "Command input type strings is empty, despite being non-zero earlier" .to_string(), - }) + }); } 1 => input_types.swap_remove(0), 2 => input_types.join(" and "), diff --git a/crates/nu-engine/src/glob_from.rs b/crates/nu-engine/src/glob_from.rs index b9d473913d..1282c8983b 100644 --- a/crates/nu-engine/src/glob_from.rs +++ b/crates/nu-engine/src/glob_from.rs @@ -1,6 +1,6 @@ use nu_glob::MatchOptions; use nu_path::{canonicalize_with, expand_path_with}; -use nu_protocol::{shell_error::io::IoError, NuGlob, ShellError, Signals, Span, Spanned}; +use nu_protocol::{NuGlob, ShellError, Signals, Span, Spanned, shell_error::io::IoError}; use std::{ fs, path::{Component, Path, PathBuf}, diff --git a/crates/nu-engine/src/scope.rs b/crates/nu-engine/src/scope.rs index 5109612b16..576a1a4ea0 100644 --- a/crates/nu-engine/src/scope.rs +++ b/crates/nu-engine/src/scope.rs @@ -1,7 +1,8 @@ use nu_protocol::{ + DeclId, ModuleId, Signature, Span, SyntaxShape, Type, Value, VarId, ast::Expr, engine::{Command, EngineState, Stack, Visibility}, - record, DeclId, ModuleId, Signature, Span, SyntaxShape, Type, Value, VarId, + record, }; use std::{cmp::Ordering, collections::HashMap}; diff --git a/crates/nu-explore/Cargo.toml b/crates/nu-explore/Cargo.toml index feed5e8bb0..1f8edf9080 100644 --- a/crates/nu-explore/Cargo.toml +++ b/crates/nu-explore/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Nushell table pager" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-explore" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-explore" version = "0.104.1" @@ -34,4 +34,4 @@ ansi-str = { workspace = true } unicode-width = { workspace = true } lscolors = { workspace = true, default-features = false, features = [ "nu-ansi-term", -] } \ No newline at end of file +] } diff --git a/crates/nu-explore/src/commands/expand.rs b/crates/nu-explore/src/commands/expand.rs index a62dc3538e..8c6ad0681c 100644 --- a/crates/nu-explore/src/commands/expand.rs +++ b/crates/nu-explore/src/commands/expand.rs @@ -6,8 +6,8 @@ use crate::{ use anyhow::Result; use nu_color_config::StyleComputer; use nu_protocol::{ - engine::{EngineState, Stack}, Value, + engine::{EngineState, Stack}, }; #[derive(Default, Clone)] diff --git a/crates/nu-explore/src/commands/help.rs b/crates/nu-explore/src/commands/help.rs index a0b6a4d97a..47cba182da 100644 --- a/crates/nu-explore/src/commands/help.rs +++ b/crates/nu-explore/src/commands/help.rs @@ -3,8 +3,8 @@ use crate::views::{Preview, ViewConfig}; use anyhow::Result; use nu_ansi_term::Color; use nu_protocol::{ - engine::{EngineState, Stack}, Value, + engine::{EngineState, Stack}, }; use std::sync::LazyLock; diff --git a/crates/nu-explore/src/commands/mod.rs b/crates/nu-explore/src/commands/mod.rs index 8dafd83993..301094926b 100644 --- a/crates/nu-explore/src/commands/mod.rs +++ b/crates/nu-explore/src/commands/mod.rs @@ -3,8 +3,8 @@ use crate::views::ViewConfig; use super::pager::{Pager, Transition}; use anyhow::Result; use nu_protocol::{ - engine::{EngineState, Stack}, Value, + engine::{EngineState, Stack}, }; mod expand; @@ -18,8 +18,8 @@ pub use expand::ExpandCmd; pub use help::HelpCmd; pub use nu::NuCmd; pub use quit::QuitCmd; -pub use r#try::TryCmd; pub use table::TableCmd; +pub use r#try::TryCmd; pub trait SimpleCommand { fn name(&self) -> &'static str; diff --git a/crates/nu-explore/src/commands/nu.rs b/crates/nu-explore/src/commands/nu.rs index 05e74ea8dc..c788ca9867 100644 --- a/crates/nu-explore/src/commands/nu.rs +++ b/crates/nu-explore/src/commands/nu.rs @@ -6,8 +6,8 @@ use crate::{ }; use anyhow::Result; use nu_protocol::{ - engine::{EngineState, Stack}, PipelineData, Value, + engine::{EngineState, Stack}, }; use ratatui::layout::Rect; diff --git a/crates/nu-explore/src/commands/quit.rs b/crates/nu-explore/src/commands/quit.rs index 03c1c18381..fa0e9ca9d1 100644 --- a/crates/nu-explore/src/commands/quit.rs +++ b/crates/nu-explore/src/commands/quit.rs @@ -2,8 +2,8 @@ use super::SimpleCommand; use crate::pager::{Pager, Transition}; use anyhow::Result; use nu_protocol::{ - engine::{EngineState, Stack}, Value, + engine::{EngineState, Stack}, }; #[derive(Default, Clone)] diff --git a/crates/nu-explore/src/commands/table.rs b/crates/nu-explore/src/commands/table.rs index 1e4adeb0cb..e035b765ba 100644 --- a/crates/nu-explore/src/commands/table.rs +++ b/crates/nu-explore/src/commands/table.rs @@ -5,8 +5,8 @@ use crate::{ }; use anyhow::Result; use nu_protocol::{ - engine::{EngineState, Stack}, Value, + engine::{EngineState, Stack}, }; #[derive(Debug, Default, Clone)] diff --git a/crates/nu-explore/src/commands/try.rs b/crates/nu-explore/src/commands/try.rs index 6694125bab..926438bcc3 100644 --- a/crates/nu-explore/src/commands/try.rs +++ b/crates/nu-explore/src/commands/try.rs @@ -2,8 +2,8 @@ use super::ViewCommand; use crate::views::{TryView, ViewConfig}; use anyhow::Result; use nu_protocol::{ - engine::{EngineState, Stack}, Value, + engine::{EngineState, Stack}, }; #[derive(Debug, Default, Clone)] diff --git a/crates/nu-explore/src/explore.rs b/crates/nu-explore/src/explore.rs index 5384e0fcec..8bbb7f2fda 100644 --- a/crates/nu-explore/src/explore.rs +++ b/crates/nu-explore/src/explore.rs @@ -1,10 +1,9 @@ use crate::{ - run_pager, + PagerConfig, run_pager, util::{create_lscolors, create_map}, - PagerConfig, }; use nu_ansi_term::{Color, Style}; -use nu_color_config::{get_color_map, StyleComputer}; +use nu_color_config::{StyleComputer, get_color_map}; use nu_engine::command_prelude::*; use nu_protocol::Config; @@ -129,8 +128,7 @@ impl Command for Explore { result: None, }, Example { - description: - "Explore a JSON file, then save the last visited sub-structure to a file", + description: "Explore a JSON file, then save the last visited sub-structure to a file", example: r#"open file.json | explore --peek | to json | save part.json"#, result: None, }, diff --git a/crates/nu-explore/src/lib.rs b/crates/nu-explore/src/lib.rs index a6d4161631..a73ea146cf 100644 --- a/crates/nu-explore/src/lib.rs +++ b/crates/nu-explore/src/lib.rs @@ -15,8 +15,8 @@ pub use explore::Explore; use explore::ExploreConfig; use nu_common::{collect_pipeline, has_simple_value}; use nu_protocol::{ - engine::{EngineState, Stack}, PipelineData, Value, + engine::{EngineState, Stack}, }; use pager::{Page, Pager, PagerConfig}; use registry::CommandRegistry; diff --git a/crates/nu-explore/src/nu_common/command.rs b/crates/nu-explore/src/nu_common/command.rs index a41e7cf45b..c86c686f29 100644 --- a/crates/nu-explore/src/nu_common/command.rs +++ b/crates/nu-explore/src/nu_common/command.rs @@ -1,9 +1,9 @@ use nu_engine::eval_block; use nu_parser::parse; use nu_protocol::{ + OutDest, PipelineData, ShellError, Value, debugger::WithoutDebug, engine::{EngineState, Redirection, Stack, StateWorkingSet}, - OutDest, PipelineData, ShellError, Value, }; use std::sync::Arc; diff --git a/crates/nu-explore/src/nu_common/table.rs b/crates/nu-explore/src/nu_common/table.rs index 66ea63d7ad..5f0039c63d 100644 --- a/crates/nu-explore/src/nu_common/table.rs +++ b/crates/nu-explore/src/nu_common/table.rs @@ -2,8 +2,8 @@ use crate::nu_common::NuConfig; use nu_color_config::StyleComputer; use nu_protocol::{Record, Signals, Value}; use nu_table::{ - common::{nu_value_to_string, nu_value_to_string_clean}, ExpandedTable, TableOpts, + common::{nu_value_to_string, nu_value_to_string_clean}, }; pub fn try_build_table( diff --git a/crates/nu-explore/src/nu_common/value.rs b/crates/nu-explore/src/nu_common/value.rs index 3b5751c11a..0df3dab5c4 100644 --- a/crates/nu-explore/src/nu_common/value.rs +++ b/crates/nu-explore/src/nu_common/value.rs @@ -1,7 +1,7 @@ use super::NuSpan; use anyhow::Result; use nu_engine::get_columns; -use nu_protocol::{record, ByteStream, ListStream, PipelineData, PipelineMetadata, Value}; +use nu_protocol::{ByteStream, ListStream, PipelineData, PipelineMetadata, Value, record}; use std::collections::HashMap; pub fn collect_pipeline(input: PipelineData) -> Result<(Vec, Vec>)> { diff --git a/crates/nu-explore/src/pager/events.rs b/crates/nu-explore/src/pager/events.rs index 6023ddd8e3..629a76b671 100644 --- a/crates/nu-explore/src/pager/events.rs +++ b/crates/nu-explore/src/pager/events.rs @@ -3,7 +3,7 @@ use std::{ time::{Duration, Instant}, }; -use crossterm::event::{poll, read, Event, KeyEvent, KeyEventKind}; +use crossterm::event::{Event, KeyEvent, KeyEventKind, poll, read}; pub struct UIEvents { tick_rate: Duration, diff --git a/crates/nu-explore/src/pager/mod.rs b/crates/nu-explore/src/pager/mod.rs index 76f5f92595..1d84a51f01 100644 --- a/crates/nu-explore/src/pager/mod.rs +++ b/crates/nu-explore/src/pager/mod.rs @@ -13,23 +13,23 @@ use crate::{ explore::ExploreConfig, nu_common::{NuColor, NuConfig, NuStyle}, registry::{Command, CommandRegistry}, - views::{util::nu_style_to_tui, ViewConfig}, + views::{ViewConfig, util::nu_style_to_tui}, }; use anyhow::Result; use crossterm::{ event::{KeyCode, KeyEvent, KeyModifiers}, execute, terminal::{ - disable_raw_mode, enable_raw_mode, Clear, ClearType, EnterAlternateScreen, - LeaveAlternateScreen, + Clear, ClearType, EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, + enable_raw_mode, }, }; use events::UIEvents; use lscolors::LsColors; use nu_color_config::StyleComputer; use nu_protocol::{ - engine::{EngineState, Stack}, Value, + engine::{EngineState, Stack}, }; use ratatui::{backend::CrosstermBackend, layout::Rect, widgets::Block}; use std::{ diff --git a/crates/nu-explore/src/pager/status_bar.rs b/crates/nu-explore/src/pager/status_bar.rs index 949fdfe517..28f4228e76 100644 --- a/crates/nu-explore/src/pager/status_bar.rs +++ b/crates/nu-explore/src/pager/status_bar.rs @@ -6,7 +6,7 @@ use ratatui::{ }; use crate::{ - nu_common::{string_width, NuStyle}, + nu_common::{NuStyle, string_width}, views::util::{nu_style_to_tui, set_span}, }; diff --git a/crates/nu-explore/src/views/binary/mod.rs b/crates/nu-explore/src/views/binary/mod.rs index a9ba47d650..bbf46ef15c 100644 --- a/crates/nu-explore/src/views/binary/mod.rs +++ b/crates/nu-explore/src/views/binary/mod.rs @@ -4,8 +4,8 @@ mod binary_widget; use crossterm::event::KeyEvent; use nu_protocol::{ - engine::{EngineState, Stack}, Value, + engine::{EngineState, Stack}, }; use ratatui::layout::Rect; @@ -13,15 +13,15 @@ use crate::{ explore::ExploreConfig, nu_common::NuText, pager::{ - report::{Report, Severity}, Frame, Transition, ViewInfo, + report::{Report, Severity}, }, views::cursor::Position, }; use self::binary_widget::{BinarySettings, BinaryStyle, BinaryWidget}; -use super::{cursor::CursorMoveHandler, cursor::WindowCursor2D, Layout, View, ViewConfig}; +use super::{Layout, View, ViewConfig, cursor::CursorMoveHandler, cursor::WindowCursor2D}; /// An interactive view that displays binary data in a hex dump format. /// Not finished; many aspects are still WIP. diff --git a/crates/nu-explore/src/views/colored_text_widget.rs b/crates/nu-explore/src/views/colored_text_widget.rs index 4b1398e713..468f021b5a 100644 --- a/crates/nu-explore/src/views/colored_text_widget.rs +++ b/crates/nu-explore/src/views/colored_text_widget.rs @@ -1,6 +1,6 @@ use std::borrow::Cow; -use ansi_str::{get_blocks, AnsiStr}; +use ansi_str::{AnsiStr, get_blocks}; use nu_table::{string_truncate, string_width}; use ratatui::{ layout::Rect, diff --git a/crates/nu-explore/src/views/cursor/mod.rs b/crates/nu-explore/src/views/cursor/mod.rs index 638b979897..d262d509f9 100644 --- a/crates/nu-explore/src/views/cursor/mod.rs +++ b/crates/nu-explore/src/views/cursor/mod.rs @@ -1,7 +1,7 @@ mod window_cursor; mod window_cursor_2d; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; pub use window_cursor::WindowCursor; pub use window_cursor_2d::{CursorMoveHandler, Position, WindowCursor2D}; diff --git a/crates/nu-explore/src/views/cursor/window_cursor.rs b/crates/nu-explore/src/views/cursor/window_cursor.rs index 50f376d0a7..90b15e6e5d 100644 --- a/crates/nu-explore/src/views/cursor/window_cursor.rs +++ b/crates/nu-explore/src/views/cursor/window_cursor.rs @@ -1,7 +1,7 @@ use std::cmp::min; use super::Cursor; -use anyhow::{bail, Ok, Result}; +use anyhow::{Ok, Result, bail}; /// WindowCursor provides a mechanism to navigate through a 1-dimensional range /// using a smaller movable window within the view. diff --git a/crates/nu-explore/src/views/mod.rs b/crates/nu-explore/src/views/mod.rs index 7147a74807..dd63cbe008 100644 --- a/crates/nu-explore/src/views/mod.rs +++ b/crates/nu-explore/src/views/mod.rs @@ -15,15 +15,15 @@ use crossterm::event::KeyEvent; use lscolors::LsColors; use nu_color_config::StyleComputer; use nu_protocol::{ - engine::{EngineState, Stack}, Value, + engine::{EngineState, Stack}, }; use ratatui::layout::Rect; pub use binary::BinaryView; pub use preview::Preview; -pub use r#try::TryView; pub use record::{Orientation, RecordView}; +pub use r#try::TryView; #[derive(Debug, Default)] pub struct Layout { diff --git a/crates/nu-explore/src/views/preview.rs b/crates/nu-explore/src/views/preview.rs index 6b62bc0d0f..f16f91527b 100644 --- a/crates/nu-explore/src/views/preview.rs +++ b/crates/nu-explore/src/views/preview.rs @@ -1,16 +1,16 @@ use super::{ - colored_text_widget::ColoredTextWidget, cursor::CursorMoveHandler, cursor::WindowCursor2D, - Layout, View, ViewConfig, + Layout, View, ViewConfig, colored_text_widget::ColoredTextWidget, cursor::CursorMoveHandler, + cursor::WindowCursor2D, }; use crate::{ nu_common::{NuSpan, NuText}, - pager::{report::Report, Frame, StatusTopOrEnd, Transition, ViewInfo}, + pager::{Frame, StatusTopOrEnd, Transition, ViewInfo, report::Report}, }; use crossterm::event::KeyEvent; use nu_color_config::TextStyle; use nu_protocol::{ - engine::{EngineState, Stack}, Value, + engine::{EngineState, Stack}, }; use ratatui::layout::Rect; use std::cmp::max; diff --git a/crates/nu-explore/src/views/record/mod.rs b/crates/nu-explore/src/views/record/mod.rs index 1afc4c8dc6..728f1446c8 100644 --- a/crates/nu-explore/src/views/record/mod.rs +++ b/crates/nu-explore/src/views/record/mod.rs @@ -2,16 +2,16 @@ mod table_widget; use self::table_widget::{TableWidget, TableWidgetState}; use super::{ + Layout, View, ViewConfig, cursor::{CursorMoveHandler, Position, WindowCursor2D}, util::{make_styled_string, nu_style_to_tui}, - Layout, View, ViewConfig, }; use crate::{ explore::ExploreConfig, - nu_common::{collect_input, lscolorize, NuSpan, NuText}, + nu_common::{NuSpan, NuText, collect_input, lscolorize}, pager::{ - report::{Report, Severity}, Frame, Transition, ViewInfo, + report::{Report, Severity}, }, views::ElementInfo, }; @@ -19,8 +19,8 @@ use anyhow::Result; use crossterm::event::KeyEvent; use nu_color_config::StyleComputer; use nu_protocol::{ - engine::{EngineState, Stack}, Config, Record, Value, + engine::{EngineState, Stack}, }; use ratatui::{layout::Rect, widgets::Block}; use std::collections::HashMap; @@ -690,7 +690,7 @@ fn strip_string(text: &str) -> String { #[cfg(test)] mod tests { use super::*; - use nu_protocol::{span::Span, Value}; + use nu_protocol::{Value, span::Span}; // Helper to create a simple test Value::Record fn create_test_record() -> Value { diff --git a/crates/nu-explore/src/views/record/table_widget.rs b/crates/nu-explore/src/views/record/table_widget.rs index 39ff34b4ec..813ac6875c 100644 --- a/crates/nu-explore/src/views/record/table_widget.rs +++ b/crates/nu-explore/src/views/record/table_widget.rs @@ -1,7 +1,7 @@ use super::Layout; use crate::{ explore::TableConfig, - nu_common::{truncate_str, NuStyle, NuText}, + nu_common::{NuStyle, NuText, truncate_str}, views::util::{nu_style_to_tui, text_style_to_tui_style}, }; use nu_color_config::{Alignment, StyleComputer, TextStyle}; @@ -13,7 +13,7 @@ use ratatui::{ text::Span, widgets::{Block, Borders, Paragraph, StatefulWidget, Widget}, }; -use std::cmp::{max, Ordering}; +use std::cmp::{Ordering, max}; #[derive(Debug, Clone)] pub struct TableWidget<'a> { diff --git a/crates/nu-explore/src/views/try.rs b/crates/nu-explore/src/views/try.rs index 518cb181cd..b5e61e8900 100644 --- a/crates/nu-explore/src/views/try.rs +++ b/crates/nu-explore/src/views/try.rs @@ -1,14 +1,14 @@ -use super::{record::RecordView, util::nu_style_to_tui, Layout, Orientation, View, ViewConfig}; +use super::{Layout, Orientation, View, ViewConfig, record::RecordView, util::nu_style_to_tui}; use crate::{ explore::ExploreConfig, nu_common::{collect_pipeline, run_command_with_value}, - pager::{report::Report, Frame, Transition, ViewInfo}, + pager::{Frame, Transition, ViewInfo, report::Report}, }; use anyhow::Result; use crossterm::event::{KeyCode, KeyEvent}; use nu_protocol::{ - engine::{EngineState, Stack}, PipelineData, Value, + engine::{EngineState, Stack}, }; use ratatui::{ layout::Rect, diff --git a/crates/nu-explore/src/views/util.rs b/crates/nu-explore/src/views/util.rs index 285b25ea95..b46a383d5f 100644 --- a/crates/nu-explore/src/views/util.rs +++ b/crates/nu-explore/src/views/util.rs @@ -1,7 +1,7 @@ -use crate::nu_common::{truncate_str, NuColor, NuStyle, NuText}; +use crate::nu_common::{NuColor, NuStyle, NuText, truncate_str}; use nu_color_config::{Alignment, StyleComputer}; use nu_protocol::{ShellError, Value}; -use nu_table::{string_width, TextStyle}; +use nu_table::{TextStyle, string_width}; use ratatui::{ buffer::Buffer, style::{Color, Modifier, Style}, diff --git a/crates/nu-glob/Cargo.toml b/crates/nu-glob/Cargo.toml index 21c98d9880..cef22efab0 100644 --- a/crates/nu-glob/Cargo.toml +++ b/crates/nu-glob/Cargo.toml @@ -7,7 +7,7 @@ description = """ Fork of glob. Support for matching file paths against Unix shell style patterns. """ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-glob" -edition = "2021" +edition = "2024" categories = ["filesystem"] [lib] diff --git a/crates/nu-glob/src/lib.rs b/crates/nu-glob/src/lib.rs index 67f57cd119..62dadf8aef 100644 --- a/crates/nu-glob/src/lib.rs +++ b/crates/nu-glob/src/lib.rs @@ -882,7 +882,7 @@ impl Pattern { AnySequence if options.require_literal_separator && follows_separator => { - return SubPatternDoesntMatch + return SubPatternDoesntMatch; } _ => (), } @@ -1159,7 +1159,7 @@ impl Default for MatchOptions { mod test { use crate::{Paths, PatternError, Uninterruptible}; - use super::{glob as glob_with_signals, MatchOptions, Pattern}; + use super::{MatchOptions, Pattern, glob as glob_with_signals}; use std::path::Path; fn glob(pattern: &str) -> Result { @@ -1266,10 +1266,12 @@ mod test { }) .unwrap(); // FIXME (#9639): This needs to handle non-utf8 paths - assert!(glob(root_with_device.as_os_str().to_str().unwrap()) - .unwrap() - .next() - .is_some()); + assert!( + glob(root_with_device.as_os_str().to_str().unwrap()) + .unwrap() + .next() + .is_some() + ); } win() } @@ -1281,15 +1283,21 @@ mod test { assert!(!Pattern::new("a*b*c").unwrap().matches("abcd")); assert!(Pattern::new("a*b*c").unwrap().matches("a_b_c")); assert!(Pattern::new("a*b*c").unwrap().matches("a___b___c")); - assert!(Pattern::new("abc*abc*abc") - .unwrap() - .matches("abcabcabcabcabcabcabc")); - assert!(!Pattern::new("abc*abc*abc") - .unwrap() - .matches("abcabcabcabcabcabcabca")); - assert!(Pattern::new("a*a*a*a*a*a*a*a*a") - .unwrap() - .matches("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")); + assert!( + Pattern::new("abc*abc*abc") + .unwrap() + .matches("abcabcabcabcabcabcabc") + ); + assert!( + !Pattern::new("abc*abc*abc") + .unwrap() + .matches("abcabcabcabcabcabcabca") + ); + assert!( + Pattern::new("a*a*a*a*a*a*a*a*a") + .unwrap() + .matches("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ); assert!(Pattern::new("a*b[xyz]c*d").unwrap().matches("abxcdbxcddd")); } @@ -1480,31 +1488,47 @@ mod test { recursive_match_hidden_dir: true, }; - assert!(Pattern::new("abc/def") - .unwrap() - .matches_with("abc/def", options_require_literal)); - assert!(!Pattern::new("abc?def") - .unwrap() - .matches_with("abc/def", options_require_literal)); - assert!(!Pattern::new("abc*def") - .unwrap() - .matches_with("abc/def", options_require_literal)); - assert!(!Pattern::new("abc[/]def") - .unwrap() - .matches_with("abc/def", options_require_literal)); + assert!( + Pattern::new("abc/def") + .unwrap() + .matches_with("abc/def", options_require_literal) + ); + assert!( + !Pattern::new("abc?def") + .unwrap() + .matches_with("abc/def", options_require_literal) + ); + assert!( + !Pattern::new("abc*def") + .unwrap() + .matches_with("abc/def", options_require_literal) + ); + assert!( + !Pattern::new("abc[/]def") + .unwrap() + .matches_with("abc/def", options_require_literal) + ); - assert!(Pattern::new("abc/def") - .unwrap() - .matches_with("abc/def", options_not_require_literal)); - assert!(Pattern::new("abc?def") - .unwrap() - .matches_with("abc/def", options_not_require_literal)); - assert!(Pattern::new("abc*def") - .unwrap() - .matches_with("abc/def", options_not_require_literal)); - assert!(Pattern::new("abc[/]def") - .unwrap() - .matches_with("abc/def", options_not_require_literal)); + assert!( + Pattern::new("abc/def") + .unwrap() + .matches_with("abc/def", options_not_require_literal) + ); + assert!( + Pattern::new("abc?def") + .unwrap() + .matches_with("abc/def", options_not_require_literal) + ); + assert!( + Pattern::new("abc*def") + .unwrap() + .matches_with("abc/def", options_not_require_literal) + ); + assert!( + Pattern::new("abc[/]def") + .unwrap() + .matches_with("abc/def", options_not_require_literal) + ); } #[test] diff --git a/crates/nu-json/Cargo.toml b/crates/nu-json/Cargo.toml index c3f8ecb399..b7cf359dc3 100644 --- a/crates/nu-json/Cargo.toml +++ b/crates/nu-json/Cargo.toml @@ -5,7 +5,7 @@ authors = [ ] description = "Fork of serde-hjson" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-json" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-json" version = "0.104.1" @@ -32,4 +32,4 @@ serde_json = "1.0" fancy-regex = "0.14.0" [lints] -workspace = true \ No newline at end of file +workspace = true diff --git a/crates/nu-json/src/lib.rs b/crates/nu-json/src/lib.rs index 1cf2c0a9fd..8eff4c73c2 100644 --- a/crates/nu-json/src/lib.rs +++ b/crates/nu-json/src/lib.rs @@ -1,13 +1,13 @@ #![doc = include_str!("../README.md")] pub use self::de::{ - from_iter, from_reader, from_slice, from_str, Deserializer, StreamDeserializer, + Deserializer, StreamDeserializer, from_iter, from_reader, from_slice, from_str, }; pub use self::error::{Error, ErrorCode, Result}; pub use self::ser::{ - to_string, to_string_raw, to_string_with_indent, to_string_with_tab_indentation, to_vec, - to_writer, Serializer, + Serializer, to_string, to_string_raw, to_string_with_indent, to_string_with_tab_indentation, + to_vec, to_writer, }; -pub use self::value::{from_value, to_value, Map, Value}; +pub use self::value::{Map, Value, from_value, to_value}; pub mod builder; pub mod de; diff --git a/crates/nu-json/src/value.rs b/crates/nu-json/src/value.rs index 9be8a8596a..1a8a3548d9 100644 --- a/crates/nu-json/src/value.rs +++ b/crates/nu-json/src/value.rs @@ -1,5 +1,5 @@ #[cfg(not(feature = "preserve_order"))] -use std::collections::{btree_map, BTreeMap}; +use std::collections::{BTreeMap, btree_map}; #[cfg(feature = "preserve_order")] use linked_hash_map::LinkedHashMap; @@ -924,7 +924,7 @@ impl<'de> de::Deserializer<'de> for Value { return Err(de::Error::invalid_type( val.as_unexpected(), &"string or map", - )) + )); } }; diff --git a/crates/nu-lsp/Cargo.toml b/crates/nu-lsp/Cargo.toml index b1bf1fa677..312e6f71b0 100644 --- a/crates/nu-lsp/Cargo.toml +++ b/crates/nu-lsp/Cargo.toml @@ -4,7 +4,7 @@ description = "Nushell's integrated LSP server" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-lsp" name = "nu-lsp" version = "0.104.1" -edition = "2021" +edition = "2024" license = "MIT" [dependencies] diff --git a/crates/nu-lsp/src/ast.rs b/crates/nu-lsp/src/ast.rs index 812d78f353..735d1b25a6 100644 --- a/crates/nu-lsp/src/ast.rs +++ b/crates/nu-lsp/src/ast.rs @@ -1,8 +1,8 @@ use crate::Id; use nu_protocol::{ + DeclId, ModuleId, Span, ast::{Argument, Block, Call, Expr, Expression, FindMapResult, ListItem, PathMember, Traverse}, engine::StateWorkingSet, - DeclId, ModuleId, Span, }; use std::sync::Arc; diff --git a/crates/nu-lsp/src/completion.rs b/crates/nu-lsp/src/completion.rs index 7305778122..dee6db0fa3 100644 --- a/crates/nu-lsp/src/completion.rs +++ b/crates/nu-lsp/src/completion.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use crate::{span_to_range, uri_to_path, LanguageServer}; +use crate::{LanguageServer, span_to_range, uri_to_path}; use lsp_types::{ CompletionItem, CompletionItemKind, CompletionItemLabelDetails, CompletionParams, CompletionResponse, CompletionTextEdit, Documentation, InsertTextFormat, MarkupContent, @@ -8,8 +8,8 @@ use lsp_types::{ }; use nu_cli::{NuCompleter, SemanticSuggestion, SuggestionKind}; use nu_protocol::{ - engine::{CommandType, EngineState, Stack}, PositionalArg, Span, SyntaxShape, + engine::{CommandType, EngineState, Stack}, }; impl LanguageServer { @@ -199,9 +199,9 @@ mod tests { use assert_json_diff::assert_json_include; use lsp_server::{Connection, Message}; use lsp_types::{ - request::{Completion, Request}, CompletionParams, PartialResultParams, Position, TextDocumentIdentifier, TextDocumentPositionParams, Uri, WorkDoneProgressParams, + request::{Completion, Request}, }; use nu_test_support::fs::fixtures; diff --git a/crates/nu-lsp/src/diagnostics.rs b/crates/nu-lsp/src/diagnostics.rs index d6fcc58cd6..8f92ed4fda 100644 --- a/crates/nu-lsp/src/diagnostics.rs +++ b/crates/nu-lsp/src/diagnostics.rs @@ -1,9 +1,9 @@ -use crate::{span_to_range, LanguageServer}; +use crate::{LanguageServer, span_to_range}; use lsp_types::{ - notification::{Notification, PublishDiagnostics}, Diagnostic, DiagnosticSeverity, PublishDiagnosticsParams, Uri, + notification::{Notification, PublishDiagnostics}, }; -use miette::{miette, IntoDiagnostic, Result}; +use miette::{IntoDiagnostic, Result, miette}; impl LanguageServer { pub(crate) fn publish_diagnostics_for_file(&mut self, uri: Uri) -> Result<()> { diff --git a/crates/nu-lsp/src/goto.rs b/crates/nu-lsp/src/goto.rs index f8623ee0d7..45419e927f 100644 --- a/crates/nu-lsp/src/goto.rs +++ b/crates/nu-lsp/src/goto.rs @@ -1,10 +1,10 @@ use std::path::Path; -use crate::{path_to_uri, span_to_range, Id, LanguageServer}; +use crate::{Id, LanguageServer, path_to_uri, span_to_range}; use lsp_textdocument::FullTextDocument; use lsp_types::{GotoDefinitionParams, GotoDefinitionResponse, Location}; -use nu_protocol::engine::{CachedFile, StateWorkingSet}; use nu_protocol::Span; +use nu_protocol::engine::{CachedFile, StateWorkingSet}; impl LanguageServer { fn get_location_by_span<'a>( @@ -105,9 +105,9 @@ mod tests { use assert_json_diff::assert_json_eq; use lsp_server::{Connection, Message}; use lsp_types::{ - request::{GotoDefinition, Request}, GotoDefinitionParams, PartialResultParams, Position, TextDocumentIdentifier, TextDocumentPositionParams, Uri, WorkDoneProgressParams, + request::{GotoDefinition, Request}, }; use nu_test_support::fs::{fixtures, root}; diff --git a/crates/nu-lsp/src/hints.rs b/crates/nu-lsp/src/hints.rs index f5fe9b47e7..06a6e24eb4 100644 --- a/crates/nu-lsp/src/hints.rs +++ b/crates/nu-lsp/src/hints.rs @@ -1,13 +1,13 @@ -use crate::{span_to_range, LanguageServer}; +use crate::{LanguageServer, span_to_range}; use lsp_textdocument::FullTextDocument; use lsp_types::{ InlayHint, InlayHintKind, InlayHintLabel, InlayHintParams, InlayHintTooltip, MarkupContent, MarkupKind, Position, Range, }; use nu_protocol::{ + Type, ast::{Argument, Block, Expr, Expression, Operator, Traverse}, engine::StateWorkingSet, - Type, }; use std::sync::Arc; @@ -161,8 +161,8 @@ mod tests { use assert_json_diff::assert_json_eq; use lsp_server::{Connection, Message}; use lsp_types::{ - request::{InlayHintRequest, Request}, InlayHintParams, Position, Range, TextDocumentIdentifier, Uri, WorkDoneProgressParams, + request::{InlayHintRequest, Request}, }; use nu_test_support::fs::fixtures; diff --git a/crates/nu-lsp/src/hover.rs b/crates/nu-lsp/src/hover.rs index c75499f0c2..764985d87a 100644 --- a/crates/nu-lsp/src/hover.rs +++ b/crates/nu-lsp/src/hover.rs @@ -1,9 +1,9 @@ use lsp_types::{Hover, HoverContents, HoverParams, MarkupContent, MarkupKind}; -use nu_protocol::{engine::Command, PositionalArg}; +use nu_protocol::{PositionalArg, engine::Command}; use crate::{ - signature::{display_flag, doc_for_arg, get_signature_label}, Id, LanguageServer, + signature::{display_flag, doc_for_arg, get_signature_label}, }; impl LanguageServer { @@ -456,11 +456,13 @@ mod hover_tests { let resp = send_hover_request(&client_connection, script_uri, 0, 22); let result = result_from_message(resp); - assert!(result - .pointer("/contents/value") - .unwrap() - .to_string() - .replace("\\r", "") - .starts_with("\"\\n---\\n### Usage \\n```nu\\n foo {flags}\\n```\\n\\n### Flags")); + assert!( + result + .pointer("/contents/value") + .unwrap() + .to_string() + .replace("\\r", "") + .starts_with("\"\\n---\\n### Usage \\n```nu\\n foo {flags}\\n```\\n\\n### Flags") + ); } } diff --git a/crates/nu-lsp/src/lib.rs b/crates/nu-lsp/src/lib.rs index 090b519eb8..33e63a10a8 100644 --- a/crates/nu-lsp/src/lib.rs +++ b/crates/nu-lsp/src/lib.rs @@ -2,18 +2,18 @@ use lsp_server::{Connection, IoThreads, Message, Response, ResponseError}; use lsp_textdocument::{FullTextDocument, TextDocuments}; use lsp_types::{ - request::{self, Request}, InlayHint, OneOf, Position, Range, ReferencesOptions, RenameOptions, SemanticToken, SemanticTokenType, SemanticTokensLegend, SemanticTokensOptions, SemanticTokensServerCapabilities, ServerCapabilities, SignatureHelpOptions, TextDocumentSyncKind, Uri, WorkDoneProgressOptions, WorkspaceFolder, WorkspaceFoldersServerCapabilities, WorkspaceServerCapabilities, + request::{self, Request}, }; -use miette::{miette, IntoDiagnostic, Result}; +use miette::{IntoDiagnostic, Result, miette}; use nu_protocol::{ + DeclId, ModuleId, Span, Type, Value, VarId, ast::{Block, PathMember}, engine::{EngineState, StateDelta, StateWorkingSet}, - DeclId, ModuleId, Span, Type, Value, VarId, }; use std::{ collections::BTreeMap, @@ -444,15 +444,15 @@ impl LanguageServer { mod tests { use super::*; use lsp_types::{ + DidChangeTextDocumentParams, DidOpenTextDocumentParams, HoverParams, InitializedParams, + TextDocumentContentChangeEvent, TextDocumentIdentifier, TextDocumentItem, + TextDocumentPositionParams, WorkDoneProgressParams, notification::{ DidChangeTextDocument, DidOpenTextDocument, Exit, Initialized, Notification, }, request::{HoverRequest, Initialize, Request, Shutdown}, - DidChangeTextDocumentParams, DidOpenTextDocumentParams, HoverParams, InitializedParams, - TextDocumentContentChangeEvent, TextDocumentIdentifier, TextDocumentItem, - TextDocumentPositionParams, WorkDoneProgressParams, }; - use nu_protocol::{debugger::WithoutDebug, engine::Stack, PipelineData, ShellError, Value}; + use nu_protocol::{PipelineData, ShellError, Value, debugger::WithoutDebug, engine::Stack}; use nu_std::load_standard_library; use std::sync::mpsc::{self, Receiver}; use std::time::Duration; @@ -526,13 +526,15 @@ mod tests { engine_state.merge_delta(delta)?; - assert!(nu_engine::eval_block::( - engine_state, - stack, - &block, - PipelineData::Value(Value::nothing(Span::unknown()), None), - ) - .is_ok()); + assert!( + nu_engine::eval_block::( + engine_state, + stack, + &block, + PipelineData::Value(Value::nothing(Span::unknown()), None), + ) + .is_ok() + ); // Merge environment into the permanent state engine_state.merge_env(stack) diff --git a/crates/nu-lsp/src/notification.rs b/crates/nu-lsp/src/notification.rs index 369ca67f69..c74d0d3cd1 100644 --- a/crates/nu-lsp/src/notification.rs +++ b/crates/nu-lsp/src/notification.rs @@ -1,12 +1,12 @@ use crate::LanguageServer; use lsp_types::{ + DidChangeTextDocumentParams, DidChangeWorkspaceFoldersParams, DidCloseTextDocumentParams, + DidOpenTextDocumentParams, ProgressParams, ProgressParamsValue, ProgressToken, Uri, + WorkDoneProgress, WorkDoneProgressBegin, WorkDoneProgressEnd, WorkDoneProgressReport, notification::{ DidChangeTextDocument, DidChangeWorkspaceFolders, DidCloseTextDocument, DidOpenTextDocument, Notification, Progress, }, - DidChangeTextDocumentParams, DidChangeWorkspaceFoldersParams, DidCloseTextDocumentParams, - DidOpenTextDocumentParams, ProgressParams, ProgressParamsValue, ProgressToken, Uri, - WorkDoneProgress, WorkDoneProgressBegin, WorkDoneProgressEnd, WorkDoneProgressReport, }; use miette::{IntoDiagnostic, Result}; diff --git a/crates/nu-lsp/src/semantic_tokens.rs b/crates/nu-lsp/src/semantic_tokens.rs index 2925f983af..c1ecb23b66 100644 --- a/crates/nu-lsp/src/semantic_tokens.rs +++ b/crates/nu-lsp/src/semantic_tokens.rs @@ -3,12 +3,12 @@ use std::sync::Arc; use lsp_textdocument::FullTextDocument; use lsp_types::{SemanticToken, SemanticTokens, SemanticTokensParams}; use nu_protocol::{ + Span, ast::{Block, Expr, Expression, Traverse}, engine::StateWorkingSet, - Span, }; -use crate::{span_to_range, LanguageServer}; +use crate::{LanguageServer, span_to_range}; /// Important to keep spans in increasing order, /// since `SemanticToken`s are created by relative positions @@ -96,11 +96,11 @@ mod tests { use crate::tests::{initialize_language_server, open_unchecked, result_from_message}; use assert_json_diff::assert_json_eq; use lsp_server::{Connection, Message}; - use lsp_types::{ - request::{Request, SemanticTokensFullRequest}, - TextDocumentIdentifier, Uri, WorkDoneProgressParams, - }; use lsp_types::{PartialResultParams, SemanticTokensParams}; + use lsp_types::{ + TextDocumentIdentifier, Uri, WorkDoneProgressParams, + request::{Request, SemanticTokensFullRequest}, + }; use nu_test_support::fs::fixtures; fn send_semantic_token_request(client_connection: &Connection, uri: Uri) -> Message { diff --git a/crates/nu-lsp/src/signature.rs b/crates/nu-lsp/src/signature.rs index 6264e2736a..97ee5385d1 100644 --- a/crates/nu-lsp/src/signature.rs +++ b/crates/nu-lsp/src/signature.rs @@ -3,12 +3,12 @@ use lsp_types::{ SignatureHelpParams, SignatureInformation, }; use nu_protocol::{ + Flag, PositionalArg, Signature, SyntaxShape, Value, ast::{Argument, Call, Expr, Expression, FindMapResult, Traverse}, engine::StateWorkingSet, - Flag, PositionalArg, Signature, SyntaxShape, Value, }; -use crate::{uri_to_path, LanguageServer}; +use crate::{LanguageServer, uri_to_path}; fn find_active_internal_call<'a>( expr: &'a Expression, @@ -246,11 +246,11 @@ mod tests { use crate::tests::{initialize_language_server, open_unchecked, result_from_message}; use assert_json_diff::assert_json_include; use lsp_server::{Connection, Message}; - use lsp_types::{ - request::{Request, SignatureHelpRequest}, - TextDocumentIdentifier, Uri, WorkDoneProgressParams, - }; use lsp_types::{Position, SignatureHelpParams, TextDocumentPositionParams}; + use lsp_types::{ + TextDocumentIdentifier, Uri, WorkDoneProgressParams, + request::{Request, SignatureHelpRequest}, + }; use nu_test_support::fs::fixtures; fn send_signature_help_request( diff --git a/crates/nu-lsp/src/symbols.rs b/crates/nu-lsp/src/symbols.rs index 17791fdefd..bea7bab3e8 100644 --- a/crates/nu-lsp/src/symbols.rs +++ b/crates/nu-lsp/src/symbols.rs @@ -1,12 +1,12 @@ -use crate::{path_to_uri, span_to_range, uri_to_path, Id, LanguageServer}; +use crate::{Id, LanguageServer, path_to_uri, span_to_range, uri_to_path}; use lsp_textdocument::{FullTextDocument, TextDocuments}; use lsp_types::{ DocumentSymbolParams, DocumentSymbolResponse, Location, Range, SymbolInformation, SymbolKind, Uri, WorkspaceSymbolParams, WorkspaceSymbolResponse, }; use nu_protocol::{ - engine::{CachedFile, EngineState, StateWorkingSet}, DeclId, ModuleId, Span, VarId, + engine::{CachedFile, EngineState, StateWorkingSet}, }; use nucleo_matcher::pattern::{AtomKind, CaseMatching, Normalization, Pattern}; use nucleo_matcher::{Config, Matcher, Utf32Str}; @@ -302,9 +302,9 @@ mod tests { use assert_json_diff::assert_json_eq; use lsp_server::{Connection, Message}; use lsp_types::{ - request::{DocumentSymbolRequest, Request, WorkspaceSymbolRequest}, DocumentSymbolParams, PartialResultParams, TextDocumentIdentifier, Uri, WorkDoneProgressParams, WorkspaceSymbolParams, + request::{DocumentSymbolRequest, Request, WorkspaceSymbolRequest}, }; use nu_test_support::fs::fixtures; diff --git a/crates/nu-lsp/src/workspace.rs b/crates/nu-lsp/src/workspace.rs index bd99669d19..f33975fcab 100644 --- a/crates/nu-lsp/src/workspace.rs +++ b/crates/nu-lsp/src/workspace.rs @@ -1,6 +1,7 @@ use crate::{ + Id, LanguageServer, ast::{self, find_id, find_reference_by_id}, - path_to_uri, span_to_range, uri_to_path, Id, LanguageServer, + path_to_uri, span_to_range, uri_to_path, }; use lsp_textdocument::FullTextDocument; use lsp_types::{ @@ -8,11 +9,11 @@ use lsp_types::{ PrepareRenameResponse, ProgressToken, Range, ReferenceParams, RenameParams, TextDocumentPositionParams, TextEdit, Uri, WorkspaceEdit, WorkspaceFolder, }; -use miette::{miette, IntoDiagnostic, Result}; +use miette::{IntoDiagnostic, Result, miette}; use nu_glob::Uninterruptible; use nu_protocol::{ - engine::{EngineState, StateWorkingSet}, Span, + engine::{EngineState, StateWorkingSet}, }; use std::{ collections::{BTreeMap, HashMap}, @@ -495,9 +496,9 @@ mod tests { use assert_json_diff::assert_json_eq; use lsp_server::{Connection, Message}; use lsp_types::{ - request, request::Request, DocumentHighlightParams, InitializeParams, PartialResultParams, - Position, ReferenceContext, ReferenceParams, RenameParams, TextDocumentIdentifier, - TextDocumentPositionParams, Uri, WorkDoneProgressParams, WorkspaceFolder, + DocumentHighlightParams, InitializeParams, PartialResultParams, Position, ReferenceContext, + ReferenceParams, RenameParams, TextDocumentIdentifier, TextDocumentPositionParams, Uri, + WorkDoneProgressParams, WorkspaceFolder, request, request::Request, }; use nu_test_support::fs::fixtures; diff --git a/crates/nu-parser/Cargo.toml b/crates/nu-parser/Cargo.toml index f903d7b5a5..651beae92c 100644 --- a/crates/nu-parser/Cargo.toml +++ b/crates/nu-parser/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Nushell's parser" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-parser" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-parser" version = "0.104.1" @@ -31,4 +31,4 @@ serde_json = { workspace = true } rstest = { workspace = true, default-features = false } [features] -plugin = ["nu-plugin-engine"] \ No newline at end of file +plugin = ["nu-plugin-engine"] diff --git a/crates/nu-parser/fuzz/Cargo.toml b/crates/nu-parser/fuzz/Cargo.toml index 3966ba83ef..1bea5cde10 100644 --- a/crates/nu-parser/fuzz/Cargo.toml +++ b/crates/nu-parser/fuzz/Cargo.toml @@ -2,7 +2,7 @@ name = "nu-parser-fuzz" version = "0.0.0" publish = false -edition = "2021" +edition = "2024" [package.metadata] cargo-fuzz = true diff --git a/crates/nu-parser/src/flatten.rs b/crates/nu-parser/src/flatten.rs index c49b1720df..660d75b722 100644 --- a/crates/nu-parser/src/flatten.rs +++ b/crates/nu-parser/src/flatten.rs @@ -1,11 +1,11 @@ use nu_protocol::{ + DeclId, Span, SyntaxShape, VarId, ast::{ Argument, Block, Expr, Expression, ExternalArgument, ImportPatternMember, ListItem, MatchPattern, PathMember, Pattern, Pipeline, PipelineElement, PipelineRedirection, RecordItem, }, engine::StateWorkingSet, - DeclId, Span, SyntaxShape, VarId, }; use std::fmt::{Display, Formatter, Result}; diff --git a/crates/nu-parser/src/known_external.rs b/crates/nu-parser/src/known_external.rs index 2c341152a2..b594204e04 100644 --- a/crates/nu-parser/src/known_external.rs +++ b/crates/nu-parser/src/known_external.rs @@ -1,9 +1,9 @@ use nu_engine::command_prelude::*; use nu_protocol::{ + CustomExample, ast::{self, Expr, Expression}, engine::{self, CallImpl, CommandType, UNKNOWN_SPAN_ID}, ir::{self, DataSlice}, - CustomExample, }; #[derive(Clone)] diff --git a/crates/nu-parser/src/lib.rs b/crates/nu-parser/src/lib.rs index 8f698f22c9..96a05195b0 100644 --- a/crates/nu-parser/src/lib.rs +++ b/crates/nu-parser/src/lib.rs @@ -13,15 +13,15 @@ mod type_check; pub use deparse::escape_for_script_arg; pub use flatten::{ - flatten_block, flatten_expression, flatten_pipeline, flatten_pipeline_element, FlatShape, + FlatShape, flatten_block, flatten_expression, flatten_pipeline, flatten_pipeline_element, }; pub use known_external::KnownExternal; -pub use lex::{lex, lex_n_tokens, lex_signature, LexState, Token, TokenContents}; -pub use lite_parser::{lite_parse, LiteBlock, LiteCommand}; +pub use lex::{LexState, Token, TokenContents, lex, lex_n_tokens, lex_signature}; +pub use lite_parser::{LiteBlock, LiteCommand, lite_parse}; pub use nu_protocol::parser_path::*; pub use parse_keywords::*; pub use parser::{ - is_math_expression_like, parse, parse_block, parse_expression, parse_external_call, - parse_unit_value, trim_quotes, trim_quotes_str, unescape_unquote_string, DURATION_UNIT_GROUPS, + DURATION_UNIT_GROUPS, is_math_expression_like, parse, parse_block, parse_expression, + parse_external_call, parse_unit_value, trim_quotes, trim_quotes_str, unescape_unquote_string, }; diff --git a/crates/nu-parser/src/lite_parser.rs b/crates/nu-parser/src/lite_parser.rs index f199375579..0db009c927 100644 --- a/crates/nu-parser/src/lite_parser.rs +++ b/crates/nu-parser/src/lite_parser.rs @@ -3,7 +3,7 @@ use crate::{Token, TokenContents}; use itertools::{Either, Itertools}; -use nu_protocol::{ast::RedirectionSource, engine::StateWorkingSet, ParseError, Span}; +use nu_protocol::{ParseError, Span, ast::RedirectionSource, engine::StateWorkingSet}; use std::mem; #[derive(Debug, Clone, Copy)] diff --git a/crates/nu-parser/src/parse_keywords.rs b/crates/nu-parser/src/parse_keywords.rs index afa875e8be..42cf330b6b 100644 --- a/crates/nu-parser/src/parse_keywords.rs +++ b/crates/nu-parser/src/parse_keywords.rs @@ -8,16 +8,16 @@ use itertools::Itertools; use log::trace; use nu_path::canonicalize_with; use nu_protocol::{ + Alias, BlockId, CustomExample, DeclId, FromValue, Module, ModuleId, ParseError, PositionalArg, + ResolvedImportPattern, ShellError, Span, Spanned, SyntaxShape, Type, Value, VarId, ast::{ Argument, AttributeBlock, Block, Call, Expr, Expression, ImportPattern, ImportPatternHead, ImportPatternMember, Pipeline, PipelineElement, }, category_from_string, - engine::{StateWorkingSet, DEFAULT_OVERLAY_NAME}, + engine::{DEFAULT_OVERLAY_NAME, StateWorkingSet}, eval_const::eval_constant, parser_path::ParserPath, - Alias, BlockId, CustomExample, DeclId, FromValue, Module, ModuleId, ParseError, PositionalArg, - ResolvedImportPattern, ShellError, Span, Spanned, SyntaxShape, Type, Value, VarId, }; use std::{ collections::{HashMap, HashSet}, @@ -30,16 +30,16 @@ pub const LIB_DIRS_VAR: &str = "NU_LIB_DIRS"; pub const PLUGIN_DIRS_VAR: &str = "NU_PLUGIN_DIRS"; use crate::{ - is_math_expression_like, + Token, TokenContents, is_math_expression_like, known_external::KnownExternal, lex, - lite_parser::{lite_parse, LiteCommand}, + lite_parser::{LiteCommand, lite_parse}, parser::{ - check_call, garbage, garbage_pipeline, parse, parse_call, parse_expression, - parse_full_signature, parse_import_pattern, parse_internal_call, parse_string, parse_value, - parse_var_with_opt_type, trim_quotes, ParsedInternalCall, + ParsedInternalCall, check_call, garbage, garbage_pipeline, parse, parse_call, + parse_expression, parse_full_signature, parse_import_pattern, parse_internal_call, + parse_string, parse_value, parse_var_with_opt_type, trim_quotes, }, - unescape_unquote_string, Token, TokenContents, + unescape_unquote_string, }; /// These parser keywords can be aliased @@ -4206,12 +4206,14 @@ fn detect_params_in_name( .find_position(|c| **c == delim) .unwrap_or((name.len(), &b' ')); let param_span = Span::new(name_span.start + idx - 1, name_span.start + idx - 1); - let error = ParseError::LabeledErrorWithHelp{ + let error = ParseError::LabeledErrorWithHelp { error: "no space between name and parameters".into(), label: "expected space".into(), - help: format!("consider adding a space between the `{decl_name}` command's name and its parameters"), + help: format!( + "consider adding a space between the `{decl_name}` command's name and its parameters" + ), span: param_span, - }; + }; Some(error) }; diff --git a/crates/nu-parser/src/parse_patterns.rs b/crates/nu-parser/src/parse_patterns.rs index 4c856a06a5..92b1977f81 100644 --- a/crates/nu-parser/src/parse_patterns.rs +++ b/crates/nu-parser/src/parse_patterns.rs @@ -5,9 +5,9 @@ use crate::{ parser::{is_variable, parse_value}, }; use nu_protocol::{ + ParseError, Span, SyntaxShape, Type, VarId, ast::{MatchPattern, Pattern}, engine::StateWorkingSet, - ParseError, Span, SyntaxShape, Type, VarId, }; pub fn garbage(span: Span) -> MatchPattern { MatchPattern { diff --git a/crates/nu-parser/src/parse_shape_specs.rs b/crates/nu-parser/src/parse_shape_specs.rs index 627d567984..6fd26ebd4b 100644 --- a/crates/nu-parser/src/parse_shape_specs.rs +++ b/crates/nu-parser/src/parse_shape_specs.rs @@ -1,8 +1,8 @@ #![allow(clippy::byte_char_slices)] -use crate::{lex::lex_signature, parser::parse_value, trim_quotes, TokenContents}; +use crate::{TokenContents, lex::lex_signature, parser::parse_value, trim_quotes}; use nu_protocol::{ - engine::StateWorkingSet, IntoSpanned, ParseError, Span, Spanned, SyntaxShape, Type, + IntoSpanned, ParseError, Span, Spanned, SyntaxShape, Type, engine::StateWorkingSet, }; #[derive(Debug, Clone, Copy, PartialEq)] diff --git a/crates/nu-parser/src/parser.rs b/crates/nu-parser/src/parser.rs index 06a38afe7e..dc022a75df 100644 --- a/crates/nu-parser/src/parser.rs +++ b/crates/nu-parser/src/parser.rs @@ -1,21 +1,21 @@ #![allow(clippy::byte_char_slices)] use crate::{ - lex::{is_assignment_operator, lex, lex_n_tokens, lex_signature, LexState}, - lite_parser::{lite_parse, LiteCommand, LitePipeline, LiteRedirection, LiteRedirectionTarget}, + Token, TokenContents, + lex::{LexState, is_assignment_operator, lex, lex_n_tokens, lex_signature}, + lite_parser::{LiteCommand, LitePipeline, LiteRedirection, LiteRedirectionTarget, lite_parse}, parse_keywords::*, parse_patterns::parse_pattern, - parse_shape_specs::{parse_shape_name, parse_type, ShapeDescriptorUse}, + parse_shape_specs::{ShapeDescriptorUse, parse_shape_name, parse_type}, type_check::{self, check_range_types, math_result_type, type_compatible}, - Token, TokenContents, }; use itertools::Itertools; use log::trace; use nu_engine::DIR_VAR_PARSER_INFO; use nu_protocol::{ - ast::*, engine::StateWorkingSet, eval_const::eval_constant, BlockId, DeclId, DidYouMean, - FilesizeUnit, Flag, ParseError, PositionalArg, ShellError, Signature, Span, Spanned, - SyntaxShape, Type, Value, VarId, ENV_VARIABLE_ID, IN_VARIABLE_ID, + BlockId, DeclId, DidYouMean, ENV_VARIABLE_ID, FilesizeUnit, Flag, IN_VARIABLE_ID, ParseError, + PositionalArg, ShellError, Signature, Span, Spanned, SyntaxShape, Type, Value, VarId, ast::*, + engine::StateWorkingSet, eval_const::eval_constant, }; use std::{ collections::{HashMap, HashSet}, @@ -2328,12 +2328,8 @@ pub fn parse_cell_path( } else if bytes.len() == 1 && bytes[0] == b'?' { if let Some(last) = tail.last_mut() { match last { - PathMember::String { - ref mut optional, .. - } => *optional = true, - PathMember::Int { - ref mut optional, .. - } => *optional = true, + PathMember::String { optional, .. } => *optional = true, + PathMember::Int { optional, .. } => *optional = true, } } expected_token = TokenType::Dot; @@ -4199,8 +4195,8 @@ pub fn parse_signature_helper(working_set: &mut StateWorkingSet, span: Span) -> "Default value is the wrong type" .into(), format!( - "expected default value to be `{t}`" - ), + "expected default value to be `{t}`" + ), expression_span, ), ) diff --git a/crates/nu-parser/src/type_check.rs b/crates/nu-parser/src/type_check.rs index c04033047d..b55a3e146b 100644 --- a/crates/nu-parser/src/type_check.rs +++ b/crates/nu-parser/src/type_check.rs @@ -1,7 +1,7 @@ use nu_protocol::{ + ParseError, Span, Type, ast::{Block, Comparison, Expr, Expression, Math, Operator, Pipeline, Range}, engine::StateWorkingSet, - ParseError, Span, Type, }; fn type_error( @@ -370,7 +370,9 @@ pub fn math_result_type( let help = if matches!(lhs.ty, Type::List(_) | Type::Table(_)) || matches!(rhs.ty, Type::List(_) | Type::Table(_)) { - Some("if you meant to append a value to a list or a record to a table, use the `append` command or wrap the value in a list. For example: `$list ++ $value` should be `$list ++ [$value]` or `$list | append $value`.") + Some( + "if you meant to append a value to a list or a record to a table, use the `append` command or wrap the value in a list. For example: `$list ++ $value` should be `$list ++ [$value]` or `$list | append $value`.", + ) } else { None }; diff --git a/crates/nu-parser/tests/test_lex.rs b/crates/nu-parser/tests/test_lex.rs index 2c1cf85bd8..4b5a4315de 100644 --- a/crates/nu-parser/tests/test_lex.rs +++ b/crates/nu-parser/tests/test_lex.rs @@ -1,6 +1,6 @@ #![allow(clippy::byte_char_slices)] -use nu_parser::{lex, lex_n_tokens, lex_signature, LexState, Token, TokenContents}; +use nu_parser::{LexState, Token, TokenContents, lex, lex_n_tokens, lex_signature}; use nu_protocol::{ParseError, Span}; #[test] diff --git a/crates/nu-parser/tests/test_parser.rs b/crates/nu-parser/tests/test_parser.rs index 945190014e..5e204b38a2 100644 --- a/crates/nu-parser/tests/test_parser.rs +++ b/crates/nu-parser/tests/test_parser.rs @@ -1,8 +1,8 @@ use nu_parser::*; use nu_protocol::{ + DeclId, ParseError, Signature, Span, SyntaxShape, Type, ast::{Argument, Expr, Expression, ExternalArgument, PathMember, Range}, engine::{Command, EngineState, Stack, StateWorkingSet}, - DeclId, ParseError, Signature, Span, SyntaxShape, Type, }; use rstest::rstest; @@ -1998,7 +1998,7 @@ mod mock { use super::*; use nu_engine::CallExt; use nu_protocol::{ - engine::Call, Category, IntoPipelineData, PipelineData, ShellError, Type, Value, + Category, IntoPipelineData, PipelineData, ShellError, Type, Value, engine::Call, }; #[derive(Clone)] diff --git a/crates/nu-path/Cargo.toml b/crates/nu-path/Cargo.toml index b429db9a19..b029d9f351 100644 --- a/crates/nu-path/Cargo.toml +++ b/crates/nu-path/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Path handling library for Nushell" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-path" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-path" version = "0.104.1" diff --git a/crates/nu-path/fuzz/Cargo.toml b/crates/nu-path/fuzz/Cargo.toml index c55453dba9..7dbb070cdf 100644 --- a/crates/nu-path/fuzz/Cargo.toml +++ b/crates/nu-path/fuzz/Cargo.toml @@ -2,7 +2,7 @@ name = "nu-path-fuzz" version = "0.0.0" publish = false -edition = "2021" +edition = "2024" [package.metadata] cargo-fuzz = true @@ -24,4 +24,4 @@ debug = 1 name = "path" path = "fuzz_targets/path_fuzzer.rs" test = false -doc = false \ No newline at end of file +doc = false diff --git a/crates/nu-path/src/path.rs b/crates/nu-path/src/path.rs index 69b370a374..5670ae9657 100644 --- a/crates/nu-path/src/path.rs +++ b/crates/nu-path/src/path.rs @@ -2,7 +2,7 @@ use crate::form::{ Absolute, Any, Canonical, IsAbsolute, MaybeRelative, PathCast, PathForm, PathJoin, PathPush, PathSet, Relative, }; -use ref_cast::{ref_cast_custom, RefCastCustom}; +use ref_cast::{RefCastCustom, ref_cast_custom}; use std::{ borrow::{Borrow, Cow}, cmp::Ordering, diff --git a/crates/nu-plugin-core/Cargo.toml b/crates/nu-plugin-core/Cargo.toml index 32b82eb88c..55463a619a 100644 --- a/crates/nu-plugin-core/Cargo.toml +++ b/crates/nu-plugin-core/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Shared internal functionality to support Nushell plugins" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-plugin-core" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-plugin-core" version = "0.104.1" @@ -28,4 +28,4 @@ default = ["local-socket"] local-socket = ["interprocess", "nu-plugin-protocol/local-socket"] [target.'cfg(target_os = "windows")'.dependencies] -windows = { workspace = true } \ No newline at end of file +windows = { workspace = true } diff --git a/crates/nu-plugin-core/src/communication_mode/mod.rs b/crates/nu-plugin-core/src/communication_mode/mod.rs index 0e72712793..343be07b1d 100644 --- a/crates/nu-plugin-core/src/communication_mode/mod.rs +++ b/crates/nu-plugin-core/src/communication_mode/mod.rs @@ -2,8 +2,8 @@ use std::ffi::OsStr; use std::io::{Stdin, Stdout}; use std::process::{Child, ChildStdin, ChildStdout, Command, Stdio}; -use nu_protocol::shell_error::io::IoError; use nu_protocol::ShellError; +use nu_protocol::shell_error::io::IoError; #[cfg(feature = "local-socket")] mod local_socket; diff --git a/crates/nu-plugin-core/src/interface/mod.rs b/crates/nu-plugin-core/src/interface/mod.rs index cbbaaeb62c..4c0db1a32b 100644 --- a/crates/nu-plugin-core/src/interface/mod.rs +++ b/crates/nu-plugin-core/src/interface/mod.rs @@ -2,8 +2,8 @@ use nu_plugin_protocol::{ByteStreamInfo, ListStreamInfo, PipelineDataHeader, StreamMessage}; use nu_protocol::{ - engine::Sequence, shell_error::io::IoError, ByteStream, ListStream, PipelineData, Reader, - ShellError, Signals, + ByteStream, ListStream, PipelineData, Reader, ShellError, Signals, engine::Sequence, + shell_error::io::IoError, }; use std::{ io::{Read, Write}, diff --git a/crates/nu-plugin-core/src/interface/stream/mod.rs b/crates/nu-plugin-core/src/interface/stream/mod.rs index cfe44fabb4..bca92fc242 100644 --- a/crates/nu-plugin-core/src/interface/stream/mod.rs +++ b/crates/nu-plugin-core/src/interface/stream/mod.rs @@ -1,10 +1,10 @@ use nu_plugin_protocol::{StreamData, StreamId, StreamMessage}; use nu_protocol::{ShellError, Span, Value}; use std::{ - collections::{btree_map, BTreeMap}, + collections::{BTreeMap, btree_map}, iter::FusedIterator, marker::PhantomData, - sync::{mpsc, Arc, Condvar, Mutex, MutexGuard, Weak}, + sync::{Arc, Condvar, Mutex, MutexGuard, Weak, mpsc}, }; #[cfg(test)] diff --git a/crates/nu-plugin-core/src/interface/stream/tests.rs b/crates/nu-plugin-core/src/interface/stream/tests.rs index 9ec9ea0074..cc1604808a 100644 --- a/crates/nu-plugin-core/src/interface/stream/tests.rs +++ b/crates/nu-plugin-core/src/interface/stream/tests.rs @@ -1,7 +1,8 @@ use std::{ sync::{ + Arc, atomic::{AtomicBool, Ordering::Relaxed}, - mpsc, Arc, + mpsc, }, time::{Duration, Instant}, }; diff --git a/crates/nu-plugin-core/src/interface/tests.rs b/crates/nu-plugin-core/src/interface/tests.rs index 28093ecd62..ed9e6b2d47 100644 --- a/crates/nu-plugin-core/src/interface/tests.rs +++ b/crates/nu-plugin-core/src/interface/tests.rs @@ -1,15 +1,15 @@ use super::{ + Interface, InterfaceManager, PluginRead, PluginWrite, stream::{StreamManager, StreamManagerHandle}, test_util::TestCase, - Interface, InterfaceManager, PluginRead, PluginWrite, }; use nu_plugin_protocol::{ ByteStreamInfo, ListStreamInfo, PipelineDataHeader, PluginInput, PluginOutput, StreamData, StreamMessage, }; use nu_protocol::{ - engine::Sequence, shell_error::io::IoError, ByteStream, ByteStreamSource, ByteStreamType, - DataSource, ListStream, PipelineData, PipelineMetadata, ShellError, Signals, Span, Value, + ByteStream, ByteStreamSource, ByteStreamType, DataSource, ListStream, PipelineData, + PipelineMetadata, ShellError, Signals, Span, Value, engine::Sequence, shell_error::io::IoError, }; use std::{path::Path, sync::Arc}; diff --git a/crates/nu-plugin-core/src/lib.rs b/crates/nu-plugin-core/src/lib.rs index 55565448ea..f843e3d79f 100644 --- a/crates/nu-plugin-core/src/lib.rs +++ b/crates/nu-plugin-core/src/lib.rs @@ -13,11 +13,11 @@ pub use communication_mode::{ ClientCommunicationIo, CommunicationMode, PreparedServerCommunication, ServerCommunicationIo, }; pub use interface::{ - stream::{FromShellError, StreamManager, StreamManagerHandle, StreamReader, StreamWriter}, Interface, InterfaceManager, PipelineDataWriter, PluginRead, PluginWrite, + stream::{FromShellError, StreamManager, StreamManagerHandle, StreamReader, StreamWriter}, }; pub use serializers::{ - json::JsonSerializer, msgpack::MsgPackSerializer, Encoder, EncodingType, PluginEncoder, + Encoder, EncodingType, PluginEncoder, json::JsonSerializer, msgpack::MsgPackSerializer, }; #[doc(hidden)] diff --git a/crates/nu-plugin-core/src/serializers/json.rs b/crates/nu-plugin-core/src/serializers/json.rs index 8dfadac2d0..3a0756bd5c 100644 --- a/crates/nu-plugin-core/src/serializers/json.rs +++ b/crates/nu-plugin-core/src/serializers/json.rs @@ -1,5 +1,5 @@ use nu_plugin_protocol::{PluginInput, PluginOutput}; -use nu_protocol::{location, shell_error::io::IoError, ShellError}; +use nu_protocol::{ShellError, location, shell_error::io::IoError}; use serde::Deserialize; use crate::{Encoder, PluginEncoder}; diff --git a/crates/nu-plugin-core/src/serializers/msgpack.rs b/crates/nu-plugin-core/src/serializers/msgpack.rs index 372511631c..2378cbd5be 100644 --- a/crates/nu-plugin-core/src/serializers/msgpack.rs +++ b/crates/nu-plugin-core/src/serializers/msgpack.rs @@ -1,7 +1,7 @@ use std::io::ErrorKind; use nu_plugin_protocol::{PluginInput, PluginOutput}; -use nu_protocol::{shell_error::io::IoError, ShellError}; +use nu_protocol::{ShellError, shell_error::io::IoError}; use serde::Deserialize; use crate::{Encoder, PluginEncoder}; diff --git a/crates/nu-plugin-core/src/util/waitable.rs b/crates/nu-plugin-core/src/util/waitable.rs index 0f4cb30de3..c8d09ab8d3 100644 --- a/crates/nu-plugin-core/src/util/waitable.rs +++ b/crates/nu-plugin-core/src/util/waitable.rs @@ -1,6 +1,6 @@ use std::sync::{ - atomic::{AtomicBool, Ordering}, Arc, Condvar, Mutex, MutexGuard, PoisonError, + atomic::{AtomicBool, Ordering}, }; use nu_protocol::ShellError; diff --git a/crates/nu-plugin-engine/Cargo.toml b/crates/nu-plugin-engine/Cargo.toml index ed0686ac5e..61db8f6632 100644 --- a/crates/nu-plugin-engine/Cargo.toml +++ b/crates/nu-plugin-engine/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Functionality for running Nushell plugins from a Nushell engine" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-plugin-engine" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-plugin-engine" version = "0.104.1" @@ -35,4 +35,4 @@ local-socket = ["nu-plugin-core/local-socket"] windows = { workspace = true, features = [ # For setting process creation flags "Win32_System_Threading", -] } \ No newline at end of file +] } diff --git a/crates/nu-plugin-engine/src/context.rs b/crates/nu-plugin-engine/src/context.rs index 48600d7937..7bdc70f4d2 100644 --- a/crates/nu-plugin-engine/src/context.rs +++ b/crates/nu-plugin-engine/src/context.rs @@ -1,15 +1,16 @@ use crate::util::MutableCow; -use nu_engine::{get_eval_block_with_early_return, get_full_help, ClosureEvalOnce}; +use nu_engine::{ClosureEvalOnce, get_eval_block_with_early_return, get_full_help}; use nu_plugin_protocol::EvaluatedCall; use nu_protocol::{ + Config, DeclId, IntoSpanned, OutDest, PipelineData, PluginIdentity, ShellError, Signals, Span, + Spanned, Value, engine::{Call, Closure, EngineState, Redirection, Stack}, - ir, Config, DeclId, IntoSpanned, OutDest, PipelineData, PluginIdentity, ShellError, Signals, - Span, Spanned, Value, + ir, }; use std::{ borrow::Cow, collections::HashMap, - sync::{atomic::AtomicU32, Arc}, + sync::{Arc, atomic::AtomicU32}, }; /// Object safe trait for abstracting operations required of the plugin context. diff --git a/crates/nu-plugin-engine/src/declaration.rs b/crates/nu-plugin-engine/src/declaration.rs index 987835823f..9eaf44e6b3 100644 --- a/crates/nu-plugin-engine/src/declaration.rs +++ b/crates/nu-plugin-engine/src/declaration.rs @@ -1,6 +1,6 @@ use nu_engine::{command_prelude::*, get_eval_expression}; use nu_plugin_protocol::{CallInfo, EvaluatedCall}; -use nu_protocol::{engine::CommandType, PluginIdentity, PluginSignature}; +use nu_protocol::{PluginIdentity, PluginSignature, engine::CommandType}; use std::sync::Arc; use crate::{GetPlugin, PluginExecutionCommandContext, PluginSource}; diff --git a/crates/nu-plugin-engine/src/gc.rs b/crates/nu-plugin-engine/src/gc.rs index 6aed37292d..8b4155560e 100644 --- a/crates/nu-plugin-engine/src/gc.rs +++ b/crates/nu-plugin-engine/src/gc.rs @@ -1,7 +1,7 @@ use crate::PersistentPlugin; use nu_protocol::{PluginGcConfig, RegisteredPlugin}; use std::{ - sync::{mpsc, Arc, Weak}, + sync::{Arc, Weak, mpsc}, thread, time::{Duration, Instant}, }; diff --git a/crates/nu-plugin-engine/src/init.rs b/crates/nu-plugin-engine/src/init.rs index 67ca57245c..3aa1d31300 100644 --- a/crates/nu-plugin-engine/src/init.rs +++ b/crates/nu-plugin-engine/src/init.rs @@ -15,8 +15,8 @@ use nu_plugin_core::{ ServerCommunicationIo, }; use nu_protocol::{ - engine::StateWorkingSet, report_shell_error, PluginIdentity, PluginRegistryFile, - PluginRegistryItem, PluginRegistryItemData, RegisteredPlugin, ShellError, Span, + PluginIdentity, PluginRegistryFile, PluginRegistryItem, PluginRegistryItemData, + RegisteredPlugin, ShellError, Span, engine::StateWorkingSet, report_shell_error, }; use crate::{ diff --git a/crates/nu-plugin-engine/src/interface/mod.rs b/crates/nu-plugin-engine/src/interface/mod.rs index 9eebe6aaed..5244096ea9 100644 --- a/crates/nu-plugin-engine/src/interface/mod.rs +++ b/crates/nu-plugin-engine/src/interface/mod.rs @@ -1,9 +1,9 @@ //! Interface used by the engine to communicate with the plugin. use nu_plugin_core::{ - util::{with_custom_values_in, Waitable, WaitableMut}, Interface, InterfaceManager, PipelineDataWriter, PluginRead, PluginWrite, StreamManager, StreamManagerHandle, + util::{Waitable, WaitableMut, with_custom_values_in}, }; use nu_plugin_protocol::{ CallInfo, CustomValueOp, EngineCall, EngineCallId, EngineCallResponse, EvaluatedCall, Ordering, @@ -11,18 +11,18 @@ use nu_plugin_protocol::{ PluginOutput, ProtocolInfo, StreamId, StreamMessage, }; use nu_protocol::{ - ast::Operator, engine::Sequence, CustomValue, IntoSpanned, PipelineData, PluginMetadata, - PluginSignature, ShellError, SignalAction, Signals, Span, Spanned, Value, + CustomValue, IntoSpanned, PipelineData, PluginMetadata, PluginSignature, ShellError, + SignalAction, Signals, Span, Spanned, Value, ast::Operator, engine::Sequence, }; use nu_utils::SharedCow; use std::{ - collections::{btree_map, BTreeMap}, - sync::{mpsc, Arc, OnceLock}, + collections::{BTreeMap, btree_map}, + sync::{Arc, OnceLock, mpsc}, }; use crate::{ - process::PluginProcess, PluginCustomValueWithSource, PluginExecutionContext, PluginGc, - PluginSource, + PluginCustomValueWithSource, PluginExecutionContext, PluginGc, PluginSource, + process::PluginProcess, }; #[cfg(test)] diff --git a/crates/nu-plugin-engine/src/interface/tests.rs b/crates/nu-plugin-engine/src/interface/tests.rs index f3b0e5a2b6..8759a658af 100644 --- a/crates/nu-plugin-engine/src/interface/tests.rs +++ b/crates/nu-plugin-engine/src/interface/tests.rs @@ -2,29 +2,28 @@ use super::{ Context, PluginCallState, PluginInterface, PluginInterfaceManager, ReceivedPluginCallMessage, }; use crate::{ - context::PluginExecutionBogusContext, interface::CurrentCallState, - plugin_custom_value_with_source::WithSource, test_util::*, PluginCustomValueWithSource, - PluginSource, + PluginCustomValueWithSource, PluginSource, context::PluginExecutionBogusContext, + interface::CurrentCallState, plugin_custom_value_with_source::WithSource, test_util::*, }; use nu_engine::command_prelude::IoError; -use nu_plugin_core::{interface_test_util::TestCase, Interface, InterfaceManager}; +use nu_plugin_core::{Interface, InterfaceManager, interface_test_util::TestCase}; use nu_plugin_protocol::{ - test_util::{expected_test_custom_value, test_plugin_custom_value}, ByteStreamInfo, CallInfo, CustomValueOp, EngineCall, EngineCallResponse, EvaluatedCall, ListStreamInfo, PipelineDataHeader, PluginCall, PluginCallId, PluginCallResponse, PluginCustomValue, PluginInput, PluginOutput, Protocol, ProtocolInfo, StreamData, StreamMessage, + test_util::{expected_test_custom_value, test_plugin_custom_value}, }; use nu_protocol::{ - ast::{Math, Operator}, - engine::Closure, BlockId, ByteStreamType, CustomValue, DataSource, IntoInterruptiblePipelineData, IntoSpanned, PipelineData, PipelineMetadata, PluginMetadata, PluginSignature, ShellError, Signals, Span, Spanned, Value, + ast::{Math, Operator}, + engine::Closure, }; use serde::{Deserialize, Serialize}; use std::{ - sync::{mpsc, Arc}, + sync::{Arc, mpsc}, time::Duration, }; @@ -321,8 +320,8 @@ fn set_default_protocol_info(manager: &mut PluginInterfaceManager) -> Result<(), } #[test] -fn manager_consume_call_response_forwards_to_subscriber_with_pipeline_data( -) -> Result<(), ShellError> { +fn manager_consume_call_response_forwards_to_subscriber_with_pipeline_data() +-> Result<(), ShellError> { let mut manager = TestCase::new().plugin("test"); set_default_protocol_info(&mut manager)?; @@ -545,8 +544,8 @@ fn manager_handle_engine_call_after_response_received() -> Result<(), ShellError } #[test] -fn manager_send_plugin_call_response_removes_context_only_if_no_streams_to_read( -) -> Result<(), ShellError> { +fn manager_send_plugin_call_response_removes_context_only_if_no_streams_to_read() +-> Result<(), ShellError> { let mut manager = TestCase::new().plugin("test"); for n in [0, 1] { @@ -1244,27 +1243,31 @@ fn prepare_custom_value_verifies_source() { let source = Arc::new(PluginSource::new_fake("test")); let mut val: Box = Box::new(test_plugin_custom_value()); - assert!(CurrentCallState::default() - .prepare_custom_value( - Spanned { - item: &mut val, - span, - }, - &source - ) - .is_err()); + assert!( + CurrentCallState::default() + .prepare_custom_value( + Spanned { + item: &mut val, + span, + }, + &source + ) + .is_err() + ); let mut val: Box = Box::new(test_plugin_custom_value().with_source(source.clone())); - assert!(CurrentCallState::default() - .prepare_custom_value( - Spanned { - item: &mut val, - span, - }, - &source - ) - .is_ok()); + assert!( + CurrentCallState::default() + .prepare_custom_value( + Spanned { + item: &mut val, + span, + }, + &source + ) + .is_ok() + ); } #[derive(Debug, Serialize, Deserialize)] diff --git a/crates/nu-plugin-engine/src/persistent.rs b/crates/nu-plugin-engine/src/persistent.rs index 8bbd3d36b0..fbdcef52a8 100644 --- a/crates/nu-plugin-engine/src/persistent.rs +++ b/crates/nu-plugin-engine/src/persistent.rs @@ -1,15 +1,15 @@ use crate::{ - init::{create_command, make_plugin_interface}, PluginGc, + init::{create_command, make_plugin_interface}, }; use super::{PluginInterface, PluginSource}; use nu_plugin_core::CommunicationMode; use nu_protocol::{ - engine::{EngineState, Stack}, - shell_error::io::IoError, HandlerGuard, Handlers, PluginGcConfig, PluginIdentity, PluginMetadata, RegisteredPlugin, ShellError, + engine::{EngineState, Stack}, + shell_error::io::IoError, }; use std::{ collections::HashMap, @@ -111,9 +111,11 @@ impl PersistentPlugin { Some(PreferredCommunicationMode::Stdio) ) { - log::warn!("{}: Trying again with stdio communication because mode {:?} failed with {result:?}", + log::warn!( + "{}: Trying again with stdio communication because mode {:?} failed with {result:?}", self.identity.name(), - mutable.preferred_mode); + mutable.preferred_mode + ); // Reset to stdio and try again, but this time don't catch any error mutable.preferred_mode = Some(PreferredCommunicationMode::Stdio); self.clone().spawn(&envs, &mut mutable)?; @@ -171,7 +173,9 @@ impl PersistentPlugin { let error_msg = match err.kind() { std::io::ErrorKind::NotFound => match program_name { Ok(prog_name) => { - format!("Can't find {prog_name}, please make sure that {prog_name} is in PATH.") + format!( + "Can't find {prog_name}, please make sure that {prog_name} is in PATH." + ) } _ => { format!("Error spawning child process: {err}") diff --git a/crates/nu-plugin-engine/src/plugin_custom_value_with_source/mod.rs b/crates/nu-plugin-engine/src/plugin_custom_value_with_source/mod.rs index 01008a29e8..55861e1c52 100644 --- a/crates/nu-plugin-engine/src/plugin_custom_value_with_source/mod.rs +++ b/crates/nu-plugin-engine/src/plugin_custom_value_with_source/mod.rs @@ -2,7 +2,7 @@ use std::{cmp::Ordering, sync::Arc}; use nu_plugin_core::util::with_custom_values_in; use nu_plugin_protocol::PluginCustomValue; -use nu_protocol::{ast::Operator, CustomValue, IntoSpanned, ShellError, Span, Spanned, Value}; +use nu_protocol::{CustomValue, IntoSpanned, ShellError, Span, Spanned, Value, ast::Operator}; use serde::Serialize; use crate::{PluginInterface, PluginSource}; diff --git a/crates/nu-plugin-engine/src/plugin_custom_value_with_source/tests.rs b/crates/nu-plugin-engine/src/plugin_custom_value_with_source/tests.rs index 0c6e33c19e..3e5a0de055 100644 --- a/crates/nu-plugin-engine/src/plugin_custom_value_with_source/tests.rs +++ b/crates/nu-plugin-engine/src/plugin_custom_value_with_source/tests.rs @@ -1,12 +1,12 @@ use std::sync::Arc; -use nu_plugin_protocol::test_util::{test_plugin_custom_value, TestCustomValue}; +use nu_plugin_protocol::test_util::{TestCustomValue, test_plugin_custom_value}; use nu_protocol::{ - engine::Closure, record, BlockId, CustomValue, IntoSpanned, ShellError, Span, Value, VarId, + BlockId, CustomValue, IntoSpanned, ShellError, Span, Value, VarId, engine::Closure, record, }; use crate::{ - test_util::test_plugin_custom_value_with_source, PluginCustomValueWithSource, PluginSource, + PluginCustomValueWithSource, PluginSource, test_util::test_plugin_custom_value_with_source, }; use super::WithSource; diff --git a/crates/nu-plugin-engine/src/process.rs b/crates/nu-plugin-engine/src/process.rs index 130bf11079..41671cc5d8 100644 --- a/crates/nu-plugin-engine/src/process.rs +++ b/crates/nu-plugin-engine/src/process.rs @@ -1,4 +1,4 @@ -use std::sync::{atomic::AtomicU32, Arc, Mutex, MutexGuard}; +use std::sync::{Arc, Mutex, MutexGuard, atomic::AtomicU32}; use nu_protocol::{ShellError, Span}; use nu_system::ForegroundGuard; diff --git a/crates/nu-plugin-engine/src/test_util.rs b/crates/nu-plugin-engine/src/test_util.rs index 676d021185..7be0d9ae54 100644 --- a/crates/nu-plugin-engine/src/test_util.rs +++ b/crates/nu-plugin-engine/src/test_util.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use nu_plugin_core::interface_test_util::TestCase; -use nu_plugin_protocol::{test_util::test_plugin_custom_value, PluginInput, PluginOutput}; +use nu_plugin_protocol::{PluginInput, PluginOutput, test_util::test_plugin_custom_value}; use crate::{PluginCustomValueWithSource, PluginInterfaceManager, PluginSource}; diff --git a/crates/nu-plugin-protocol/Cargo.toml b/crates/nu-plugin-protocol/Cargo.toml index 68537b872b..130d4e26ae 100644 --- a/crates/nu-plugin-protocol/Cargo.toml +++ b/crates/nu-plugin-protocol/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Protocol type definitions for Nushell plugins" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-plugin-protocol" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-plugin-protocol" version = "0.104.1" @@ -24,4 +24,4 @@ typetag = "0.2" [features] default = ["local-socket"] -local-socket = [] \ No newline at end of file +local-socket = [] diff --git a/crates/nu-plugin-protocol/src/evaluated_call.rs b/crates/nu-plugin-protocol/src/evaluated_call.rs index c5cbcc5ba0..f62028c7d9 100644 --- a/crates/nu-plugin-protocol/src/evaluated_call.rs +++ b/crates/nu-plugin-protocol/src/evaluated_call.rs @@ -1,7 +1,8 @@ use nu_protocol::{ + FromValue, ShellError, Span, Spanned, Value, ast::{self, Expression}, engine::{Call, CallImpl, EngineState, Stack}, - ir, FromValue, ShellError, Span, Spanned, Value, + ir, }; use serde::{Deserialize, Serialize}; diff --git a/crates/nu-plugin-protocol/src/lib.rs b/crates/nu-plugin-protocol/src/lib.rs index ef574456a5..65bb95a55e 100644 --- a/crates/nu-plugin-protocol/src/lib.rs +++ b/crates/nu-plugin-protocol/src/lib.rs @@ -22,9 +22,9 @@ mod tests; pub mod test_util; use nu_protocol::{ - ast::Operator, engine::Closure, ByteStreamType, Config, DeclId, LabeledError, PipelineData, - PipelineMetadata, PluginMetadata, PluginSignature, ShellError, SignalAction, Span, Spanned, - Value, + ByteStreamType, Config, DeclId, LabeledError, PipelineData, PipelineMetadata, PluginMetadata, + PluginSignature, ShellError, SignalAction, Span, Spanned, Value, ast::Operator, + engine::Closure, }; use nu_utils::SharedCow; use serde::{Deserialize, Serialize}; diff --git a/crates/nu-plugin-protocol/src/plugin_custom_value/mod.rs b/crates/nu-plugin-protocol/src/plugin_custom_value/mod.rs index db7ea733d7..53d8970f56 100644 --- a/crates/nu-plugin-protocol/src/plugin_custom_value/mod.rs +++ b/crates/nu-plugin-protocol/src/plugin_custom_value/mod.rs @@ -1,6 +1,6 @@ use std::cmp::Ordering; -use nu_protocol::{ast::Operator, CustomValue, ShellError, Span, Value}; +use nu_protocol::{CustomValue, ShellError, Span, Value, ast::Operator}; use nu_utils::SharedCow; use serde::{Deserialize, Serialize}; @@ -169,7 +169,7 @@ impl PluginCustomValue { value.recurse_mut(&mut |value| { let span = value.span(); match value { - Value::Custom { ref val, .. } => { + Value::Custom { val, .. } => { if val.as_any().downcast_ref::().is_some() { // Already a PluginCustomValue Ok(()) @@ -190,7 +190,7 @@ impl PluginCustomValue { value.recurse_mut(&mut |value| { let span = value.span(); match value { - Value::Custom { ref val, .. } => { + Value::Custom { val, .. } => { if let Some(val) = val.as_any().downcast_ref::() { let deserialized = val.deserialize_to_custom_value(span)?; *value = Value::custom(deserialized, span); @@ -210,7 +210,7 @@ impl PluginCustomValue { value.recurse_mut(&mut |value| { let span = value.span(); match value { - Value::Custom { ref val, .. } => { + Value::Custom { val, .. } => { *value = val.to_base_value(span)?; Ok(()) } diff --git a/crates/nu-plugin-protocol/src/plugin_custom_value/tests.rs b/crates/nu-plugin-protocol/src/plugin_custom_value/tests.rs index a93e758723..1994f41047 100644 --- a/crates/nu-plugin-protocol/src/plugin_custom_value/tests.rs +++ b/crates/nu-plugin-protocol/src/plugin_custom_value/tests.rs @@ -1,7 +1,7 @@ -use crate::test_util::{expected_test_custom_value, test_plugin_custom_value, TestCustomValue}; +use crate::test_util::{TestCustomValue, expected_test_custom_value, test_plugin_custom_value}; use super::PluginCustomValue; -use nu_protocol::{engine::Closure, record, BlockId, CustomValue, ShellError, Span, Value, VarId}; +use nu_protocol::{BlockId, CustomValue, ShellError, Span, Value, VarId, engine::Closure, record}; fn check_record_custom_values( val: &Value, diff --git a/crates/nu-plugin-test-support/Cargo.toml b/crates/nu-plugin-test-support/Cargo.toml index b3708668fd..b934b9c20a 100644 --- a/crates/nu-plugin-test-support/Cargo.toml +++ b/crates/nu-plugin-test-support/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "nu-plugin-test-support" version = "0.104.1" -edition = "2021" +edition = "2024" license = "MIT" description = "Testing support for Nushell plugins" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-plugin-test-support" @@ -28,4 +28,4 @@ similar = "2.7" [dev-dependencies] typetag = "0.2" -serde = "1.0" \ No newline at end of file +serde = "1.0" diff --git a/crates/nu-plugin-test-support/src/fake_persistent_plugin.rs b/crates/nu-plugin-test-support/src/fake_persistent_plugin.rs index e316e85147..acb8f4f08d 100644 --- a/crates/nu-plugin-test-support/src/fake_persistent_plugin.rs +++ b/crates/nu-plugin-test-support/src/fake_persistent_plugin.rs @@ -5,8 +5,8 @@ use std::{ use nu_plugin_engine::{GetPlugin, PluginInterface}; use nu_protocol::{ - engine::{EngineState, Stack}, PluginGcConfig, PluginIdentity, PluginMetadata, RegisteredPlugin, ShellError, + engine::{EngineState, Stack}, }; pub struct FakePersistentPlugin { diff --git a/crates/nu-plugin-test-support/src/fake_register.rs b/crates/nu-plugin-test-support/src/fake_register.rs index cb667b034e..b2b31bd2c1 100644 --- a/crates/nu-plugin-test-support/src/fake_register.rs +++ b/crates/nu-plugin-test-support/src/fake_register.rs @@ -1,8 +1,8 @@ use std::{ops::Deref, sync::Arc}; -use nu_plugin::{create_plugin_signature, Plugin}; +use nu_plugin::{Plugin, create_plugin_signature}; use nu_plugin_engine::PluginDeclaration; -use nu_protocol::{engine::StateWorkingSet, RegisteredPlugin, ShellError}; +use nu_protocol::{RegisteredPlugin, ShellError, engine::StateWorkingSet}; use crate::{fake_persistent_plugin::FakePersistentPlugin, spawn_fake_plugin::spawn_fake_plugin}; diff --git a/crates/nu-plugin-test-support/src/plugin_test.rs b/crates/nu-plugin-test-support/src/plugin_test.rs index 6fcdf47619..abbcc005ff 100644 --- a/crates/nu-plugin-test-support/src/plugin_test.rs +++ b/crates/nu-plugin-test-support/src/plugin_test.rs @@ -8,10 +8,11 @@ use nu_plugin::{Plugin, PluginCommand}; use nu_plugin_engine::{PluginCustomValueWithSource, PluginSource, WithSource}; use nu_plugin_protocol::PluginCustomValue; use nu_protocol::{ + CustomValue, Example, IntoSpanned as _, LabeledError, PipelineData, ShellError, Signals, Span, + Value, debugger::WithoutDebug, engine::{EngineState, Stack, StateWorkingSet}, - report_shell_error, CustomValue, Example, IntoSpanned as _, LabeledError, PipelineData, - ShellError, Signals, Span, Value, + report_shell_error, }; use crate::{diff::diff_by_line, fake_register::fake_register}; diff --git a/crates/nu-plugin-test-support/src/spawn_fake_plugin.rs b/crates/nu-plugin-test-support/src/spawn_fake_plugin.rs index 710332fbec..06357a7396 100644 --- a/crates/nu-plugin-test-support/src/spawn_fake_plugin.rs +++ b/crates/nu-plugin-test-support/src/spawn_fake_plugin.rs @@ -1,10 +1,10 @@ -use std::sync::{mpsc, Arc}; +use std::sync::{Arc, mpsc}; use nu_plugin::Plugin; use nu_plugin_core::{InterfaceManager, PluginRead, PluginWrite}; use nu_plugin_engine::{PluginInterfaceManager, PluginSource}; use nu_plugin_protocol::{PluginInput, PluginOutput}; -use nu_protocol::{shell_error::io::IoError, PluginIdentity, ShellError}; +use nu_protocol::{PluginIdentity, ShellError, shell_error::io::IoError}; use crate::fake_persistent_plugin::FakePersistentPlugin; diff --git a/crates/nu-plugin/Cargo.toml b/crates/nu-plugin/Cargo.toml index 31a748fdc9..eb715c1a32 100644 --- a/crates/nu-plugin/Cargo.toml +++ b/crates/nu-plugin/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Functionality for building Nushell plugins" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-plugin" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-plugin" version = "0.104.1" diff --git a/crates/nu-plugin/src/lib.rs b/crates/nu-plugin/src/lib.rs index 98b88e1359..3c22041b06 100644 --- a/crates/nu-plugin/src/lib.rs +++ b/crates/nu-plugin/src/lib.rs @@ -72,7 +72,7 @@ mod plugin; #[cfg(test)] mod test_util; -pub use plugin::{serve_plugin, EngineInterface, Plugin, PluginCommand, SimplePluginCommand}; +pub use plugin::{EngineInterface, Plugin, PluginCommand, SimplePluginCommand, serve_plugin}; // Re-exports. Consider semver implications carefully. pub use nu_plugin_core::{JsonSerializer, MsgPackSerializer, PluginEncoder}; diff --git a/crates/nu-plugin/src/plugin/interface/mod.rs b/crates/nu-plugin/src/plugin/interface/mod.rs index c3052448b1..2969fd50a2 100644 --- a/crates/nu-plugin/src/plugin/interface/mod.rs +++ b/crates/nu-plugin/src/plugin/interface/mod.rs @@ -1,9 +1,9 @@ //! Interface used by the plugin to communicate with the engine. use nu_plugin_core::{ - util::{Waitable, WaitableMut}, Interface, InterfaceManager, PipelineDataWriter, PluginRead, PluginWrite, StreamManager, StreamManagerHandle, + util::{Waitable, WaitableMut}, }; use nu_plugin_protocol::{ CallInfo, CustomValueOp, EngineCall, EngineCallId, EngineCallResponse, EvaluatedCall, Ordering, @@ -11,14 +11,14 @@ use nu_plugin_protocol::{ PluginOutput, ProtocolInfo, }; use nu_protocol::{ - engine::{Closure, Sequence}, Config, DeclId, Handler, HandlerGuard, Handlers, LabeledError, PipelineData, PluginMetadata, PluginSignature, ShellError, SignalAction, Signals, Span, Spanned, Value, + engine::{Closure, Sequence}, }; use nu_utils::SharedCow; use std::{ - collections::{btree_map, BTreeMap, HashMap}, - sync::{atomic::AtomicBool, mpsc, Arc}, + collections::{BTreeMap, HashMap, btree_map}, + sync::{Arc, atomic::AtomicBool, mpsc}, }; /// Plugin calls that are received by the [`EngineInterfaceManager`] for handling. @@ -1044,7 +1044,7 @@ impl ForegroundGuard { // On Unix, we need to put ourselves back in our own process group #[cfg(unix)] { - use nix::unistd::{setpgid, Pid}; + use nix::unistd::{Pid, setpgid}; // This should always succeed, frankly, but handle the error just in case setpgid(Pid::from_raw(0), Pid::from_raw(0)).map_err(|err| { nu_protocol::shell_error::io::IoError::new_internal( @@ -1075,7 +1075,7 @@ impl Drop for ForegroundGuard { #[cfg(unix)] fn set_pgrp_from_enter_foreground(pgrp: i64) -> Result<(), ShellError> { - use nix::unistd::{setpgid, Pid}; + use nix::unistd::{Pid, setpgid}; if let Ok(pgrp) = pgrp.try_into() { setpgid(Pid::from_raw(0), Pid::from_raw(pgrp)).map_err(|err| ShellError::GenericError { error: "Failed to set process group for foreground".into(), diff --git a/crates/nu-plugin/src/plugin/interface/tests.rs b/crates/nu-plugin/src/plugin/interface/tests.rs index b6bf267dcb..a9535a3eee 100644 --- a/crates/nu-plugin/src/plugin/interface/tests.rs +++ b/crates/nu-plugin/src/plugin/interface/tests.rs @@ -2,22 +2,23 @@ use crate::test_util::TestCaseExt; use super::{EngineInterfaceManager, ReceivedPluginCall}; use nu_engine::command_prelude::IoError; -use nu_plugin_core::{interface_test_util::TestCase, Interface, InterfaceManager}; +use nu_plugin_core::{Interface, InterfaceManager, interface_test_util::TestCase}; use nu_plugin_protocol::{ - test_util::{expected_test_custom_value, test_plugin_custom_value, TestCustomValue}, ByteStreamInfo, CallInfo, CustomValueOp, EngineCall, EngineCallId, EngineCallResponse, EvaluatedCall, ListStreamInfo, PipelineDataHeader, PluginCall, PluginCallResponse, PluginCustomValue, PluginInput, PluginOutput, Protocol, ProtocolInfo, StreamData, + test_util::{TestCustomValue, expected_test_custom_value, test_plugin_custom_value}, }; use nu_protocol::{ - engine::Closure, BlockId, ByteStreamType, Config, CustomValue, IntoInterruptiblePipelineData, - LabeledError, PipelineData, PluginSignature, ShellError, Signals, Span, Spanned, Value, VarId, + BlockId, ByteStreamType, Config, CustomValue, IntoInterruptiblePipelineData, LabeledError, + PipelineData, PluginSignature, ShellError, Signals, Span, Spanned, Value, VarId, + engine::Closure, }; use std::{ collections::HashMap, sync::{ - mpsc::{self, TryRecvError}, Arc, + mpsc::{self, TryRecvError}, }, }; @@ -542,8 +543,8 @@ fn manager_consume_call_custom_value_op_forwards_to_receiver_with_context() -> R } #[test] -fn manager_consume_engine_call_response_forwards_to_subscriber_with_pipeline_data( -) -> Result<(), ShellError> { +fn manager_consume_engine_call_response_forwards_to_subscriber_with_pipeline_data() +-> Result<(), ShellError> { let mut manager = TestCase::new().engine(); set_default_protocol_info(&mut manager)?; diff --git a/crates/nu-plugin/src/plugin/mod.rs b/crates/nu-plugin/src/plugin/mod.rs index d01a0e2600..323ff84a7c 100644 --- a/crates/nu-plugin/src/plugin/mod.rs +++ b/crates/nu-plugin/src/plugin/mod.rs @@ -9,15 +9,15 @@ use std::{ thread, }; -use nu_engine::documentation::{get_flags_section, HelpStyle}; +use nu_engine::documentation::{HelpStyle, get_flags_section}; use nu_plugin_core::{ ClientCommunicationIo, CommunicationMode, InterfaceManager, PluginEncoder, PluginRead, PluginWrite, }; use nu_plugin_protocol::{CallInfo, CustomValueOp, PluginCustomValue, PluginInput, PluginOutput}; use nu_protocol::{ - ast::Operator, CustomValue, IntoSpanned, LabeledError, PipelineData, PluginMetadata, - ShellError, Spanned, Value, + CustomValue, IntoSpanned, LabeledError, PipelineData, PluginMetadata, ShellError, Spanned, + Value, ast::Operator, }; use thiserror::Error; @@ -26,7 +26,7 @@ use self::{command::render_examples, interface::ReceivedPluginCall}; mod command; mod interface; -pub use command::{create_plugin_signature, PluginCommand, SimplePluginCommand}; +pub use command::{PluginCommand, SimplePluginCommand, create_plugin_signature}; pub use interface::{EngineInterface, EngineInterfaceManager}; /// This should be larger than the largest commonly sent message to avoid excessive fragmentation. diff --git a/crates/nu-pretty-hex/Cargo.toml b/crates/nu-pretty-hex/Cargo.toml index 19e43782fd..f5ba33a032 100644 --- a/crates/nu-pretty-hex/Cargo.toml +++ b/crates/nu-pretty-hex/Cargo.toml @@ -2,7 +2,7 @@ authors = ["Andrei Volnin ", "The Nushell Project Developers"] description = "Pretty hex dump of bytes slice in the common style." repository = "https://github.com/nushell/nushell/tree/main/crates/nu-pretty-hex" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-pretty-hex" version = "0.104.1" @@ -21,4 +21,4 @@ nu-ansi-term = { workspace = true } [dev-dependencies] heapless = { version = "0.8", default-features = false } -rand = "0.8" \ No newline at end of file +rand = "0.8" diff --git a/crates/nu-protocol/Cargo.toml b/crates/nu-protocol/Cargo.toml index 09cedc0aea..7d1efab177 100644 --- a/crates/nu-protocol/Cargo.toml +++ b/crates/nu-protocol/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Nushell's internal protocols, including its abstract syntax tree" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-protocol" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-protocol" version = "0.104.1" diff --git a/crates/nu-protocol/src/alias.rs b/crates/nu-protocol/src/alias.rs index 2da569b8ea..9265f01515 100644 --- a/crates/nu-protocol/src/alias.rs +++ b/crates/nu-protocol/src/alias.rs @@ -1,7 +1,7 @@ use crate::{ + PipelineData, ShellError, Signature, ast::Expression, engine::{Call, Command, CommandType, EngineState, Stack}, - PipelineData, ShellError, Signature, }; /// Command wrapper of an alias. diff --git a/crates/nu-protocol/src/ast/block.rs b/crates/nu-protocol/src/ast/block.rs index ab603da0da..a01f7eb8a4 100644 --- a/crates/nu-protocol/src/ast/block.rs +++ b/crates/nu-protocol/src/ast/block.rs @@ -1,5 +1,5 @@ use super::Pipeline; -use crate::{engine::StateWorkingSet, ir::IrBlock, OutDest, Signature, Span, Type, VarId}; +use crate::{OutDest, Signature, Span, Type, VarId, engine::StateWorkingSet, ir::IrBlock}; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/crates/nu-protocol/src/ast/call.rs b/crates/nu-protocol/src/ast/call.rs index 7a0d2b0cb4..5407ee5fa4 100644 --- a/crates/nu-protocol/src/ast/call.rs +++ b/crates/nu-protocol/src/ast/call.rs @@ -3,8 +3,8 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; use crate::{ - ast::Expression, engine::StateWorkingSet, eval_const::eval_constant, DeclId, FromValue, - ShellError, Span, Spanned, Value, + DeclId, FromValue, ShellError, Span, Spanned, Value, ast::Expression, engine::StateWorkingSet, + eval_const::eval_constant, }; /// Parsed command arguments diff --git a/crates/nu-protocol/src/ast/cell_path.rs b/crates/nu-protocol/src/ast/cell_path.rs index a1c66ddd7e..a050468d6c 100644 --- a/crates/nu-protocol/src/ast/cell_path.rs +++ b/crates/nu-protocol/src/ast/cell_path.rs @@ -60,12 +60,8 @@ impl PathMember { pub fn make_optional(&mut self) { match self { - PathMember::String { - ref mut optional, .. - } => *optional = true, - PathMember::Int { - ref mut optional, .. - } => *optional = true, + PathMember::String { optional, .. } => *optional = true, + PathMember::Int { optional, .. } => *optional = true, } } diff --git a/crates/nu-protocol/src/ast/expr.rs b/crates/nu-protocol/src/ast/expr.rs index 1f9579de20..6a3adb5eb5 100644 --- a/crates/nu-protocol/src/ast/expr.rs +++ b/crates/nu-protocol/src/ast/expr.rs @@ -6,7 +6,7 @@ use super::{ MatchPattern, Operator, Range, Table, ValueWithUnit, }; use crate::{ - ast::ImportPattern, engine::StateWorkingSet, BlockId, ModuleId, OutDest, Signature, Span, VarId, + BlockId, ModuleId, OutDest, Signature, Span, VarId, ast::ImportPattern, engine::StateWorkingSet, }; /// An [`Expression`] AST node diff --git a/crates/nu-protocol/src/ast/expression.rs b/crates/nu-protocol/src/ast/expression.rs index 5ffa3aab8b..c05dd2b813 100644 --- a/crates/nu-protocol/src/ast/expression.rs +++ b/crates/nu-protocol/src/ast/expression.rs @@ -1,7 +1,7 @@ use crate::{ + BlockId, DeclId, GetSpan, IN_VARIABLE_ID, Signature, Span, SpanId, Type, VarId, ast::{Argument, Block, Expr, ExternalArgument, ImportPattern, MatchPattern, RecordItem}, engine::StateWorkingSet, - BlockId, DeclId, GetSpan, Signature, Span, SpanId, Type, VarId, IN_VARIABLE_ID, }; use serde::{Deserialize, Serialize}; use std::sync::Arc; diff --git a/crates/nu-protocol/src/ast/pipeline.rs b/crates/nu-protocol/src/ast/pipeline.rs index 0ed02c700b..5573d7682b 100644 --- a/crates/nu-protocol/src/ast/pipeline.rs +++ b/crates/nu-protocol/src/ast/pipeline.rs @@ -1,4 +1,4 @@ -use crate::{ast::Expression, engine::StateWorkingSet, OutDest, Span, VarId}; +use crate::{OutDest, Span, VarId, ast::Expression, engine::StateWorkingSet}; use serde::{Deserialize, Serialize}; use std::fmt::Display; diff --git a/crates/nu-protocol/src/config/ansi_coloring.rs b/crates/nu-protocol/src/config/ansi_coloring.rs index 4cbc893faa..97439b1291 100644 --- a/crates/nu-protocol/src/config/ansi_coloring.rs +++ b/crates/nu-protocol/src/config/ansi_coloring.rs @@ -1,5 +1,5 @@ use super::{ConfigErrors, ConfigPath, IntoValue, ShellError, UpdateFromValue, Value}; -use crate::{self as nu_protocol, engine::EngineState, FromValue}; +use crate::{self as nu_protocol, FromValue, engine::EngineState}; use serde::{Deserialize, Serialize}; use std::io::IsTerminal; @@ -136,31 +136,41 @@ mod tests { .into(); // explicit `True` ignores environment variables - assert!(engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); set_env(&mut engine_state, "clicolor", false); - assert!(engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); set_env(&mut engine_state, "clicolor", true); - assert!(engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); set_env(&mut engine_state, "no_color", true); - assert!(engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); set_env(&mut engine_state, "force_color", true); - assert!(engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); } #[test] @@ -173,31 +183,41 @@ mod tests { .into(); // explicit `False` ignores environment variables - assert!(!engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + !engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); set_env(&mut engine_state, "clicolor", false); - assert!(!engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + !engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); set_env(&mut engine_state, "clicolor", true); - assert!(!engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + !engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); set_env(&mut engine_state, "no_color", true); - assert!(!engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + !engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); set_env(&mut engine_state, "force_color", true); - assert!(!engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + !engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); } #[test] @@ -221,29 +241,37 @@ mod tests { // `clicolor` determines ANSI behavior if no higher-priority variables are set set_env(&mut engine_state, "clicolor", true); - assert!(engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); set_env(&mut engine_state, "clicolor", false); - assert!(!engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + !engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); // `no_color` overrides `clicolor` and terminal state set_env(&mut engine_state, "no_color", true); - assert!(!engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + !engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); // `force_color` overrides everything set_env(&mut engine_state, "force_color", true); - assert!(engine_state - .get_config() - .use_ansi_coloring - .get(&engine_state)); + assert!( + engine_state + .get_config() + .use_ansi_coloring + .get(&engine_state) + ); } } diff --git a/crates/nu-protocol/src/config/plugin_gc.rs b/crates/nu-protocol/src/config/plugin_gc.rs index 94e4b5aee4..52d170cd36 100644 --- a/crates/nu-protocol/src/config/plugin_gc.rs +++ b/crates/nu-protocol/src/config/plugin_gc.rs @@ -106,7 +106,7 @@ impl UpdateFromValue for PluginGcConfig { #[cfg(test)] mod tests { use super::*; - use crate::{record, Config, Span}; + use crate::{Config, Span, record}; fn test_pair() -> (PluginGcConfigs, Value) { ( diff --git a/crates/nu-protocol/src/config/prelude.rs b/crates/nu-protocol/src/config/prelude.rs index 5b2266557d..10adca616a 100644 --- a/crates/nu-protocol/src/config/prelude.rs +++ b/crates/nu-protocol/src/config/prelude.rs @@ -1,4 +1,4 @@ -pub(super) use super::{error::ConfigErrors, ConfigPath, UpdateFromValue}; -pub use crate::{record, IntoValue, ShellError, Span, Type, Value}; +pub(super) use super::{ConfigPath, UpdateFromValue, error::ConfigErrors}; +pub use crate::{IntoValue, ShellError, Span, Type, Value, record}; pub use serde::{Deserialize, Serialize}; pub use std::str::FromStr; diff --git a/crates/nu-protocol/src/config/reedline.rs b/crates/nu-protocol/src/config/reedline.rs index 1694619e99..e946f67c9f 100644 --- a/crates/nu-protocol/src/config/reedline.rs +++ b/crates/nu-protocol/src/config/reedline.rs @@ -1,6 +1,6 @@ use super::{config_update_string_enum, prelude::*}; use crate as nu_protocol; -use crate::{engine::Closure, FromValue}; +use crate::{FromValue, engine::Closure}; /// Definition of a parsed keybinding from the config object #[derive(Clone, Debug, FromValue, IntoValue, Serialize, Deserialize)] @@ -41,14 +41,16 @@ impl FromStr for NuCursorShape { fn from_str(s: &str) -> Result { match s.to_ascii_lowercase().as_str() { - "line" => Ok(NuCursorShape::Line), - "block" => Ok(NuCursorShape::Block), - "underscore" => Ok(NuCursorShape::Underscore), - "blink_line" => Ok(NuCursorShape::BlinkLine), - "blink_block" => Ok(NuCursorShape::BlinkBlock), - "blink_underscore" => Ok(NuCursorShape::BlinkUnderscore), - "inherit" => Ok(NuCursorShape::Inherit), - _ => Err("'line', 'block', 'underscore', 'blink_line', 'blink_block', 'blink_underscore' or 'inherit'"), + "line" => Ok(NuCursorShape::Line), + "block" => Ok(NuCursorShape::Block), + "underscore" => Ok(NuCursorShape::Underscore), + "blink_line" => Ok(NuCursorShape::BlinkLine), + "blink_block" => Ok(NuCursorShape::BlinkBlock), + "blink_underscore" => Ok(NuCursorShape::BlinkUnderscore), + "inherit" => Ok(NuCursorShape::Inherit), + _ => Err( + "'line', 'block', 'underscore', 'blink_line', 'blink_block', 'blink_underscore' or 'inherit'", + ), } } } diff --git a/crates/nu-protocol/src/config/table.rs b/crates/nu-protocol/src/config/table.rs index 74893cd9c7..c89ce9d6f2 100644 --- a/crates/nu-protocol/src/config/table.rs +++ b/crates/nu-protocol/src/config/table.rs @@ -46,7 +46,9 @@ impl FromStr for TableMode { "ascii_rounded" => Ok(Self::AsciiRounded), "basic_compact" => Ok(Self::BasicCompact), "single" => Ok(Self::Single), - _ => Err("'basic', 'thin', 'light', 'compact', 'with_love', 'compact_double', 'rounded', 'reinforced', 'heavy', 'none', 'psql', 'markdown', 'dots', 'restructured', 'ascii_rounded', 'basic_compact' or 'single'"), + _ => Err( + "'basic', 'thin', 'light', 'compact', 'with_love', 'compact_double', 'rounded', 'reinforced', 'heavy', 'none', 'psql', 'markdown', 'dots', 'restructured', 'ascii_rounded', 'basic_compact' or 'single'", + ), } } } diff --git a/crates/nu-protocol/src/debugger/debugger_trait.rs b/crates/nu-protocol/src/debugger/debugger_trait.rs index 88cc753548..68a3cde7e2 100644 --- a/crates/nu-protocol/src/debugger/debugger_trait.rs +++ b/crates/nu-protocol/src/debugger/debugger_trait.rs @@ -14,10 +14,10 @@ //! `Debugger::report()` to get some output from the debugger, if necessary. use crate::{ + PipelineData, ShellError, Span, Value, ast::{Block, PipelineElement}, engine::EngineState, ir::IrBlock, - PipelineData, ShellError, Span, Value, }; use std::{fmt::Debug, ops::DerefMut}; diff --git a/crates/nu-protocol/src/debugger/profiler.rs b/crates/nu-protocol/src/debugger/profiler.rs index 6f8df16905..95bce68be8 100644 --- a/crates/nu-protocol/src/debugger/profiler.rs +++ b/crates/nu-protocol/src/debugger/profiler.rs @@ -4,11 +4,12 @@ //! profiling Nushell code. use crate::{ + PipelineData, ShellError, Span, Value, ast::{Block, Expr, PipelineElement}, debugger::Debugger, engine::EngineState, ir::IrBlock, - record, PipelineData, ShellError, Span, Value, + record, }; use std::{borrow::Borrow, io::BufRead}; use web_time::Instant; diff --git a/crates/nu-protocol/src/did_you_mean.rs b/crates/nu-protocol/src/did_you_mean.rs index 793d26becd..e66e0e51c7 100644 --- a/crates/nu-protocol/src/did_you_mean.rs +++ b/crates/nu-protocol/src/did_you_mean.rs @@ -33,18 +33,34 @@ mod tests { None, "Not helpful to suggest an arbitrary choice when none are close", ), - ("ccccccccccccccccccccccc", None, "Not helpful to suggest an arbitrary choice when none are close"), + ( + "ccccccccccccccccccccccc", + None, + "Not helpful to suggest an arbitrary choice when none are close", + ), ], ), ( vec!["OS", "PWD", "PWDPWDPWDPWD"], vec![ - ("pwd", Some("PWD"), "Exact case insensitive match yields a match"), - ("pwdpwdpwdpwd", Some("PWDPWDPWDPWD"), "Exact case insensitive match yields a match"), + ( + "pwd", + Some("PWD"), + "Exact case insensitive match yields a match", + ), + ( + "pwdpwdpwdpwd", + Some("PWDPWDPWDPWD"), + "Exact case insensitive match yields a match", + ), ("PWF", Some("PWD"), "One-letter typo yields a match"), ("pwf", None, "Case difference plus typo yields no match"), - ("Xwdpwdpwdpwd", None, "Case difference plus typo yields no match"), - ] + ( + "Xwdpwdpwdpwd", + None, + "Case difference plus typo yields no match", + ), + ], ), ( vec!["foo", "bar", "baz"], @@ -67,11 +83,27 @@ mod tests { ( vec!["aaaaaa"], vec![ - ("XXaaaa", Some("aaaaaa"), "Distance of 2 out of 6 chars: close enough to meet rustc's rule"), - ("XXXaaa", None, "Distance of 3 out of 6 chars: not close enough to meet rustc's rule"), - ("XaaaaX", Some("aaaaaa"), "Distance of 2 out of 6 chars: close enough to meet rustc's rule"), - ("XXaaaaXX", None, "Distance of 4 out of 6 chars: not close enough to meet rustc's rule") - ] + ( + "XXaaaa", + Some("aaaaaa"), + "Distance of 2 out of 6 chars: close enough to meet rustc's rule", + ), + ( + "XXXaaa", + None, + "Distance of 3 out of 6 chars: not close enough to meet rustc's rule", + ), + ( + "XaaaaX", + Some("aaaaaa"), + "Distance of 2 out of 6 chars: close enough to meet rustc's rule", + ), + ( + "XXaaaaXX", + None, + "Distance of 4 out of 6 chars: not close enough to meet rustc's rule", + ), + ], ), ]; for (possibilities, cases) in all_cases { diff --git a/crates/nu-protocol/src/engine/argument.rs b/crates/nu-protocol/src/engine/argument.rs index 178e5fd22d..e10faa9ba1 100644 --- a/crates/nu-protocol/src/engine/argument.rs +++ b/crates/nu-protocol/src/engine/argument.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use crate::{ast::Expression, ir::DataSlice, Span, Value}; +use crate::{Span, Value, ast::Expression, ir::DataSlice}; /// Represents a fully evaluated argument to a call. #[derive(Debug, Clone)] diff --git a/crates/nu-protocol/src/engine/call.rs b/crates/nu-protocol/src/engine/call.rs index eebf4860cd..ebcd6d67c6 100644 --- a/crates/nu-protocol/src/engine/call.rs +++ b/crates/nu-protocol/src/engine/call.rs @@ -1,6 +1,7 @@ use crate::{ + DeclId, FromValue, ShellError, Span, Value, ast::{self, Expression}, - ir, DeclId, FromValue, ShellError, Span, Value, + ir, }; use super::{EngineState, Stack, StateWorkingSet}; diff --git a/crates/nu-protocol/src/engine/call_info.rs b/crates/nu-protocol/src/engine/call_info.rs index 36455243e5..7908ec8256 100644 --- a/crates/nu-protocol/src/engine/call_info.rs +++ b/crates/nu-protocol/src/engine/call_info.rs @@ -1,4 +1,4 @@ -use crate::{ast::Call, Span}; +use crate::{Span, ast::Call}; #[derive(Debug, Clone)] pub struct UnevaluatedCallInfo { diff --git a/crates/nu-protocol/src/engine/closure.rs b/crates/nu-protocol/src/engine/closure.rs index a10867fc5b..ae83dbcdc1 100644 --- a/crates/nu-protocol/src/engine/closure.rs +++ b/crates/nu-protocol/src/engine/closure.rs @@ -1,6 +1,6 @@ use std::borrow::Cow; -use crate::{engine::EngineState, BlockId, ShellError, Span, Value, VarId}; +use crate::{BlockId, ShellError, Span, Value, VarId, engine::EngineState}; use serde::{Deserialize, Serialize}; diff --git a/crates/nu-protocol/src/engine/command.rs b/crates/nu-protocol/src/engine/command.rs index d10a6210a9..167e05f3ac 100644 --- a/crates/nu-protocol/src/engine/command.rs +++ b/crates/nu-protocol/src/engine/command.rs @@ -1,6 +1,6 @@ use super::{EngineState, Stack, StateWorkingSet}; use crate::{ - engine::Call, Alias, BlockId, Example, OutDest, PipelineData, ShellError, Signature, Value, + Alias, BlockId, Example, OutDest, PipelineData, ShellError, Signature, Value, engine::Call, }; use std::fmt::Display; diff --git a/crates/nu-protocol/src/engine/engine_state.rs b/crates/nu-protocol/src/engine/engine_state.rs index 3099b33f20..9add1813f6 100644 --- a/crates/nu-protocol/src/engine/engine_state.rs +++ b/crates/nu-protocol/src/engine/engine_state.rs @@ -1,16 +1,16 @@ use crate::{ - ast::Block, - debugger::{Debugger, NoopDebugger}, - engine::{ - description::{build_desc, Doccomments}, - CachedFile, Command, CommandType, EnvVars, OverlayFrame, ScopeFrame, Stack, StateDelta, - Variable, Visibility, DEFAULT_OVERLAY_NAME, - }, - eval_const::create_nu_constant, - shell_error::io::IoError, BlockId, Category, Config, DeclId, FileId, GetSpan, Handlers, HistoryConfig, JobId, Module, ModuleId, OverlayId, ShellError, SignalAction, Signals, Signature, Span, SpanId, Type, Value, VarId, VirtualPathId, + ast::Block, + debugger::{Debugger, NoopDebugger}, + engine::{ + CachedFile, Command, CommandType, DEFAULT_OVERLAY_NAME, EnvVars, OverlayFrame, ScopeFrame, + Stack, StateDelta, Variable, Visibility, + description::{Doccomments, build_desc}, + }, + eval_const::create_nu_constant, + shell_error::io::IoError, }; use fancy_regex::Regex; use lru::LruCache; @@ -21,10 +21,10 @@ use std::{ num::NonZeroUsize, path::PathBuf, sync::{ - atomic::{AtomicBool, AtomicU32, Ordering}, - mpsc::channel, - mpsc::Sender, Arc, Mutex, MutexGuard, PoisonError, + atomic::{AtomicBool, AtomicU32, Ordering}, + mpsc::Sender, + mpsc::channel, }, }; @@ -1120,7 +1120,7 @@ impl Default for EngineState { #[cfg(test)] mod engine_state_tests { use crate::engine::StateWorkingSet; - use std::str::{from_utf8, Utf8Error}; + use std::str::{Utf8Error, from_utf8}; use super::*; @@ -1227,10 +1227,10 @@ mod test_cwd { //! PWD should NOT point to non-existent entities in the filesystem. use crate::{ - engine::{EngineState, Stack}, Value, + engine::{EngineState, Stack}, }; - use nu_path::{assert_path_eq, AbsolutePath, Path}; + use nu_path::{AbsolutePath, Path, assert_path_eq}; use tempfile::{NamedTempFile, TempDir}; /// Creates a symlink. Works on both Unix and Windows. diff --git a/crates/nu-protocol/src/engine/jobs.rs b/crates/nu-protocol/src/engine/jobs.rs index d0ef1ecda3..48150ae899 100644 --- a/crates/nu-protocol/src/engine/jobs.rs +++ b/crates/nu-protocol/src/engine/jobs.rs @@ -1,15 +1,15 @@ use std::{ collections::{BTreeMap, BTreeSet, HashMap, HashSet}, sync::{ - mpsc::{Receiver, RecvTimeoutError, Sender, TryRecvError}, Arc, Mutex, + mpsc::{Receiver, RecvTimeoutError, Sender, TryRecvError}, }, }; #[cfg(not(target_family = "wasm"))] use std::time::{Duration, Instant}; -use nu_system::{kill_by_pid, UnfreezeHandle}; +use nu_system::{UnfreezeHandle, kill_by_pid}; use crate::{PipelineData, Signals}; diff --git a/crates/nu-protocol/src/engine/pattern_match.rs b/crates/nu-protocol/src/engine/pattern_match.rs index bac2fd8d17..61e1c3d006 100644 --- a/crates/nu-protocol/src/engine/pattern_match.rs +++ b/crates/nu-protocol/src/engine/pattern_match.rs @@ -1,6 +1,6 @@ use crate::{ - ast::{Expr, MatchPattern, Pattern, RangeInclusion}, Span, Value, VarId, + ast::{Expr, MatchPattern, Pattern, RangeInclusion}, }; pub trait Matcher { diff --git a/crates/nu-protocol/src/engine/stack.rs b/crates/nu-protocol/src/engine/stack.rs index 2c6422f503..a04968887c 100644 --- a/crates/nu-protocol/src/engine/stack.rs +++ b/crates/nu-protocol/src/engine/stack.rs @@ -1,9 +1,9 @@ use crate::{ + Config, ENV_VARIABLE_ID, IntoValue, NU_VARIABLE_ID, OutDest, ShellError, Span, Value, VarId, engine::{ - ArgumentStack, EngineState, ErrorHandlerStack, Redirection, StackCallArgGuard, - StackCollectValueGuard, StackIoGuard, StackOutDest, DEFAULT_OVERLAY_NAME, + ArgumentStack, DEFAULT_OVERLAY_NAME, EngineState, ErrorHandlerStack, Redirection, + StackCallArgGuard, StackCollectValueGuard, StackIoGuard, StackOutDest, }, - Config, IntoValue, OutDest, ShellError, Span, Value, VarId, ENV_VARIABLE_ID, NU_VARIABLE_ID, }; use nu_utils::IgnoreCaseExt; use std::{ @@ -774,7 +774,7 @@ impl Stack { mod test { use std::sync::Arc; - use crate::{engine::EngineState, Span, Value, VarId}; + use crate::{Span, Value, VarId, engine::EngineState}; use super::Stack; diff --git a/crates/nu-protocol/src/engine/stack_out_dest.rs b/crates/nu-protocol/src/engine/stack_out_dest.rs index 8153c8ec68..6de3000bff 100644 --- a/crates/nu-protocol/src/engine/stack_out_dest.rs +++ b/crates/nu-protocol/src/engine/stack_out_dest.rs @@ -1,4 +1,4 @@ -use crate::{engine::Stack, OutDest}; +use crate::{OutDest, engine::Stack}; use std::{ fs::File, mem, diff --git a/crates/nu-protocol/src/engine/state_delta.rs b/crates/nu-protocol/src/engine/state_delta.rs index d6f699e3a5..50be868784 100644 --- a/crates/nu-protocol/src/engine/state_delta.rs +++ b/crates/nu-protocol/src/engine/state_delta.rs @@ -1,10 +1,10 @@ use crate::{ + Module, Span, ast::Block, engine::{ - description::Doccomments, CachedFile, Command, EngineState, OverlayFrame, ScopeFrame, - Variable, VirtualPath, + CachedFile, Command, EngineState, OverlayFrame, ScopeFrame, Variable, VirtualPath, + description::Doccomments, }, - Module, Span, }; use std::sync::Arc; diff --git a/crates/nu-protocol/src/engine/state_working_set.rs b/crates/nu-protocol/src/engine/state_working_set.rs index a12109f41a..5fb8e15bc0 100644 --- a/crates/nu-protocol/src/engine/state_working_set.rs +++ b/crates/nu-protocol/src/engine/state_working_set.rs @@ -1,12 +1,12 @@ use crate::{ - ast::Block, - engine::{ - description::build_desc, CachedFile, Command, CommandType, EngineState, OverlayFrame, - StateDelta, Variable, VirtualPath, Visibility, - }, BlockId, Category, CompileError, Config, DeclId, FileId, GetSpan, Module, ModuleId, OverlayId, ParseError, ParseWarning, ResolvedImportPattern, Signature, Span, SpanId, Type, Value, VarId, VirtualPathId, + ast::Block, + engine::{ + CachedFile, Command, CommandType, EngineState, OverlayFrame, StateDelta, Variable, + VirtualPath, Visibility, description::build_desc, + }, }; use core::panic; use std::{ diff --git a/crates/nu-protocol/src/errors/cli_error.rs b/crates/nu-protocol/src/errors/cli_error.rs index 7439d1df79..fa17f89043 100644 --- a/crates/nu-protocol/src/errors/cli_error.rs +++ b/crates/nu-protocol/src/errors/cli_error.rs @@ -2,8 +2,8 @@ //! //! Relies on the `miette` crate for pretty layout use crate::{ - engine::{EngineState, StateWorkingSet}, CompileError, ErrorStyle, ParseError, ParseWarning, ShellError, + engine::{EngineState, StateWorkingSet}, }; use miette::{ LabeledSpan, MietteHandlerOpts, NarratableReportHandler, ReportHandler, RgbColors, Severity, diff --git a/crates/nu-protocol/src/errors/compile_error.rs b/crates/nu-protocol/src/errors/compile_error.rs index cc805a73ed..a3e48af3ae 100644 --- a/crates/nu-protocol/src/errors/compile_error.rs +++ b/crates/nu-protocol/src/errors/compile_error.rs @@ -17,14 +17,18 @@ pub enum CompileError { #[error("Register {reg_id} was uninitialized when used, possibly reused.")] #[diagnostic( code(nu::compile::register_uninitialized), - help("this is a compiler bug. Please report it at https://github.com/nushell/nushell/issues/new\nfrom: {caller}"), + help( + "this is a compiler bug. Please report it at https://github.com/nushell/nushell/issues/new\nfrom: {caller}" + ) )] RegisterUninitialized { reg_id: RegId, caller: String }, #[error("Register {reg_id} was uninitialized when used, possibly reused.")] #[diagnostic( code(nu::compile::register_uninitialized), - help("this is a compiler bug. Please report it at https://github.com/nushell/nushell/issues/new\nfrom: {caller}"), + help( + "this is a compiler bug. Please report it at https://github.com/nushell/nushell/issues/new\nfrom: {caller}" + ) )] RegisterUninitializedWhilePushingInstruction { reg_id: RegId, @@ -57,7 +61,9 @@ pub enum CompileError { #[error("Invalid redirect mode: File should not be specified by commands.")] #[diagnostic( code(nu::compile::invalid_redirect_mode), - help("this is a command bug. Please report it at https://github.com/nushell/nushell/issues/new") + help( + "this is a command bug. Please report it at https://github.com/nushell/nushell/issues/new" + ) )] InvalidRedirectMode { #[label("while compiling this expression")] @@ -96,7 +102,9 @@ pub enum CompileError { #[error("Attempted to set branch target of non-branch instruction.")] #[diagnostic( code(nu::compile::set_branch_target_of_non_branch_instruction), - help("this is a compiler bug. Please report it at https://github.com/nushell/nushell/issues/new"), + help( + "this is a compiler bug. Please report it at https://github.com/nushell/nushell/issues/new" + ) )] SetBranchTargetOfNonBranchInstruction { instruction: String, @@ -218,7 +226,9 @@ pub enum CompileError { #[error("Incoherent loop state: the loop that ended was not the one we were expecting.")] #[diagnostic( code(nu::compile::incoherent_loop_state), - help("this is a compiler bug. Please report it at https://github.com/nushell/nushell/issues/new"), + help( + "this is a compiler bug. Please report it at https://github.com/nushell/nushell/issues/new" + ) )] IncoherentLoopState { #[label("while compiling this block")] @@ -228,7 +238,9 @@ pub enum CompileError { #[error("Undefined label `{label_id}`.")] #[diagnostic( code(nu::compile::undefined_label), - help("this is a compiler bug. Please report it at https://github.com/nushell/nushell/issues/new"), + help( + "this is a compiler bug. Please report it at https://github.com/nushell/nushell/issues/new" + ) )] UndefinedLabel { label_id: usize, diff --git a/crates/nu-protocol/src/errors/labeled_error.rs b/crates/nu-protocol/src/errors/labeled_error.rs index 810ec5a880..adde650f40 100644 --- a/crates/nu-protocol/src/errors/labeled_error.rs +++ b/crates/nu-protocol/src/errors/labeled_error.rs @@ -1,4 +1,4 @@ -use super::{shell_error::io::IoError, ShellError}; +use super::{ShellError, shell_error::io::IoError}; use crate::Span; use miette::Diagnostic; use serde::{Deserialize, Serialize}; diff --git a/crates/nu-protocol/src/errors/parse_error.rs b/crates/nu-protocol/src/errors/parse_error.rs index 34a481a113..3f4c02a30c 100644 --- a/crates/nu-protocol/src/errors/parse_error.rs +++ b/crates/nu-protocol/src/errors/parse_error.rs @@ -1,9 +1,9 @@ -use crate::{ast::RedirectionSource, did_you_mean, Span, Type}; +use crate::{Span, Type, ast::RedirectionSource, did_you_mean}; use miette::Diagnostic; use serde::{Deserialize, Serialize}; use std::{ fmt::Display, - str::{from_utf8, Utf8Error}, + str::{Utf8Error, from_utf8}, }; use thiserror::Error; @@ -245,14 +245,18 @@ pub enum ParseError { #[error("Module not found.")] #[diagnostic( code(nu::parser::module_not_found), - help("module files and their paths must be available before your script is run as parsing occurs before anything is evaluated") + help( + "module files and their paths must be available before your script is run as parsing occurs before anything is evaluated" + ) )] ModuleNotFound(#[label = "module {1} not found"] Span, String), #[error("Missing mod.nu file.")] #[diagnostic( code(nu::parser::module_missing_mod_nu_file), - help("Directory {0} is missing a mod.nu file.\n\nWhen importing a directory as a Nushell module, it needs to contain a mod.nu file (can be empty). Alternatively, you can use .nu files in the directory as modules individually.") + help( + "Directory {0} is missing a mod.nu file.\n\nWhen importing a directory as a Nushell module, it needs to contain a mod.nu file (can be empty). Alternatively, you can use .nu files in the directory as modules individually." + ) )] ModuleMissingModNuFile( String, @@ -266,7 +270,9 @@ pub enum ParseError { #[error("Can't export {0} named same as the module.")] #[diagnostic( code(nu::parser::named_as_module), - help("Module {1} can't export {0} named the same as the module. Either change the module name, or export `{2}` {0}.") + help( + "Module {1} can't export {0} named the same as the module. Either change the module name, or export `{2}` {0}." + ) )] NamedAsModule( String, @@ -288,7 +294,9 @@ pub enum ParseError { #[error("Can't export alias defined as 'main'.")] #[diagnostic( code(nu::parser::export_main_alias_not_allowed), - help("Exporting aliases as 'main' is not allowed. Either rename the alias or convert it to a custom command.") + help( + "Exporting aliases as 'main' is not allowed. Either rename the alias or convert it to a custom command." + ) )] ExportMainAliasNotAllowed(#[label = "can't export from module"] Span), @@ -299,7 +307,9 @@ pub enum ParseError { #[error("Overlay prefix mismatch.")] #[diagnostic( code(nu::parser::overlay_prefix_mismatch), - help("Overlay {0} already exists {1} a prefix. To add it again, do it {1} the --prefix flag.") + help( + "Overlay {0} already exists {1} a prefix. To add it again, do it {1} the --prefix flag." + ) )] OverlayPrefixMismatch( String, @@ -310,7 +320,9 @@ pub enum ParseError { #[error("Module or overlay not found.")] #[diagnostic( code(nu::parser::module_or_overlay_not_found), - help("Requires either an existing overlay, a module, or an import pattern defining a module.") + help( + "Requires either an existing overlay, a module, or an import pattern defining a module." + ) )] ModuleOrOverlayNotFound(#[label = "not a module or an overlay"] Span), @@ -474,7 +486,9 @@ pub enum ParseError { #[error("Plugin not found")] #[diagnostic( code(nu::parser::plugin_not_found), - help("plugins need to be added to the plugin registry file before your script is run (see `plugin add`)"), + help( + "plugins need to be added to the plugin registry file before your script is run (see `plugin add`)" + ) )] PluginNotFound { name: String, @@ -513,7 +527,9 @@ pub enum ParseError { #[error("This command does not have a ...rest parameter")] #[diagnostic( code(nu::parser::unexpected_spread_arg), - help("To spread arguments, the command needs to define a multi-positional parameter in its signature, such as ...rest") + help( + "To spread arguments, the command needs to define a multi-positional parameter in its signature, such as ...rest" + ) )] UnexpectedSpreadArg(String, #[label = "unexpected spread argument"] Span), diff --git a/crates/nu-protocol/src/errors/parse_warning.rs b/crates/nu-protocol/src/errors/parse_warning.rs index 5f34deb20c..6fa4ee790d 100644 --- a/crates/nu-protocol/src/errors/parse_warning.rs +++ b/crates/nu-protocol/src/errors/parse_warning.rs @@ -10,7 +10,9 @@ pub enum ParseWarning { DeprecatedWarning { old_command: String, new_suggestion: String, - #[label("`{old_command}` is deprecated and will be removed in a future release. Please {new_suggestion} instead.")] + #[label( + "`{old_command}` is deprecated and will be removed in a future release. Please {new_suggestion} instead." + )] span: Span, url: String, }, diff --git a/crates/nu-protocol/src/errors/shell_error/io.rs b/crates/nu-protocol/src/errors/shell_error/io.rs index 6ad8935685..69427ef5c5 100644 --- a/crates/nu-protocol/src/errors/shell_error/io.rs +++ b/crates/nu-protocol/src/errors/shell_error/io.rs @@ -8,7 +8,7 @@ use thiserror::Error; use crate::Span; -use super::{location::Location, ShellError}; +use super::{ShellError, location::Location}; /// Represents an I/O error in the [`ShellError::Io`] variant. /// diff --git a/crates/nu-protocol/src/errors/shell_error/mod.rs b/crates/nu-protocol/src/errors/shell_error/mod.rs index 9ff49f36d8..e38c95065d 100644 --- a/crates/nu-protocol/src/errors/shell_error/mod.rs +++ b/crates/nu-protocol/src/errors/shell_error/mod.rs @@ -1,7 +1,7 @@ use super::chained_error::ChainedError; use crate::{ - ast::Operator, engine::StateWorkingSet, format_shell_error, record, ConfigError, LabeledError, - ParseError, Span, Spanned, Type, Value, + ConfigError, LabeledError, ParseError, Span, Spanned, Type, Value, ast::Operator, + engine::StateWorkingSet, format_shell_error, record, }; use miette::Diagnostic; use serde::{Deserialize, Serialize}; @@ -312,8 +312,9 @@ pub enum ShellError { #[diagnostic( code(nu::shell::nushell_failed), help( - "This shouldn't happen. Please file an issue: https://github.com/nushell/nushell/issues" - ))] + "This shouldn't happen. Please file an issue: https://github.com/nushell/nushell/issues" + ) + )] // Only use this one if Nushell completely falls over and hits a state that isn't possible or isn't recoverable NushellFailed { msg: String }, @@ -326,8 +327,9 @@ pub enum ShellError { #[diagnostic( code(nu::shell::nushell_failed_spanned), help( - "This shouldn't happen. Please file an issue: https://github.com/nushell/nushell/issues" - ))] + "This shouldn't happen. Please file an issue: https://github.com/nushell/nushell/issues" + ) + )] // Only use this one if Nushell completely falls over and hits a state that isn't possible or isn't recoverable NushellFailedSpanned { msg: String, @@ -823,7 +825,9 @@ pub enum ShellError { plugin_name: String, #[label("plugin `{plugin_name}` loaded here")] span: Option, - #[help("the format in the plugin registry file is not compatible with this version of Nushell.\n\nTry adding the plugin again with `{}`")] + #[help( + "the format in the plugin registry file is not compatible with this version of Nushell.\n\nTry adding the plugin again with `{}`" + )] add_command: String, }, @@ -893,9 +897,7 @@ pub enum ShellError { /// creation of the custom value and its use. #[error("Custom value failed to decode")] #[diagnostic(code(nu::shell::custom_value_failed_to_decode))] - #[diagnostic(help( - "the plugin may have been updated and no longer support this custom value" - ))] + #[diagnostic(help("the plugin may have been updated and no longer support this custom value"))] CustomValueFailedToDecode { msg: String, #[label("{msg}")] @@ -1167,7 +1169,9 @@ This is an internal Nushell error, please file an issue https://github.com/nushe #[error("Not a constant.")] #[diagnostic( code(nu::shell::not_a_constant), - help("Only a subset of expressions are allowed constants during parsing. Try using the 'const' command or typing the value literally.") + help( + "Only a subset of expressions are allowed constants during parsing. Try using the 'const' command or typing the value literally." + ) )] NotAConstant { #[label("Value is not a parse-time constant")] @@ -1183,7 +1187,9 @@ This is an internal Nushell error, please file an issue https://github.com/nushe #[error("Not a const command.")] #[diagnostic( code(nu::shell::not_a_const_command), - help("Only a subset of builtin commands, and custom commands built only from those commands, can run at parse time.") + help( + "Only a subset of builtin commands, and custom commands built only from those commands, can run at parse time." + ) )] NotAConstCommand { #[label("This command cannot run at parse time.")] @@ -1240,7 +1246,9 @@ This is an internal Nushell error, please file an issue https://github.com/nushe #[error("Not a list")] #[diagnostic( code(nu::shell::cannot_spread_as_list), - help("Only lists can be spread inside lists and command calls. Try converting the value to a list before spreading.") + help( + "Only lists can be spread inside lists and command calls. Try converting the value to a list before spreading." + ) )] CannotSpreadAsList { #[label = "cannot spread value"] @@ -1255,7 +1263,9 @@ This is an internal Nushell error, please file an issue https://github.com/nushe #[error("Not a record")] #[diagnostic( code(nu::shell::cannot_spread_as_record), - help("Only records can be spread inside records. Try converting the value to a record before spreading.") + help( + "Only records can be spread inside records. Try converting the value to a record before spreading." + ) )] CannotSpreadAsRecord { #[label = "cannot spread value"] @@ -1310,7 +1320,9 @@ On Windows, this would be %USERPROFILE%\AppData\Roaming"# }, /// XDG_CONFIG_HOME was set to an invalid path - #[error("$env.XDG_CONFIG_HOME ({xdg}) is invalid, using default config directory instead: {default}")] + #[error( + "$env.XDG_CONFIG_HOME ({xdg}) is invalid, using default config directory instead: {default}" + )] #[diagnostic( code(nu::shell::xdg_config_home_invalid), help("Set XDG_CONFIG_HOME to an absolute path, or set it to an empty string to ignore it") @@ -1326,7 +1338,9 @@ On Windows, this would be %USERPROFILE%\AppData\Roaming"# #[error("IR evaluation error: {msg}")] #[diagnostic( code(nu::shell::ir_eval_error), - help("this is a bug, please report it at https://github.com/nushell/nushell/issues/new along with the code you were running if able") + help( + "this is a bug, please report it at https://github.com/nushell/nushell/issues/new along with the code you were running if able" + ) )] IrEvalError { msg: String, @@ -1568,19 +1582,25 @@ mod test { impl From for ShellError { fn from(_: std::io::Error) -> ShellError { - unimplemented!("This implementation is defined in the test module to ensure no other implementation exists.") + unimplemented!( + "This implementation is defined in the test module to ensure no other implementation exists." + ) } } impl From> for ShellError { fn from(_: Spanned) -> Self { - unimplemented!("This implementation is defined in the test module to ensure no other implementation exists.") + unimplemented!( + "This implementation is defined in the test module to ensure no other implementation exists." + ) } } impl From for std::io::Error { fn from(_: ShellError) -> Self { - unimplemented!("This implementation is defined in the test module to ensure no other implementation exists.") + unimplemented!( + "This implementation is defined in the test module to ensure no other implementation exists." + ) } } } diff --git a/crates/nu-protocol/src/eval_base.rs b/crates/nu-protocol/src/eval_base.rs index 65c9b5f82b..574723d912 100644 --- a/crates/nu-protocol/src/eval_base.rs +++ b/crates/nu-protocol/src/eval_base.rs @@ -1,11 +1,11 @@ //! Foundational [`Eval`] trait allowing dispatch between const-eval and regular evaluation use crate::{ + BlockId, Config, ENV_VARIABLE_ID, GetSpan, Range, Record, ShellError, Span, Value, VarId, ast::{ - eval_operator, Assignment, Bits, Boolean, Call, Comparison, Expr, Expression, - ExternalArgument, ListItem, Math, Operator, RecordItem, + Assignment, Bits, Boolean, Call, Comparison, Expr, Expression, ExternalArgument, ListItem, + Math, Operator, RecordItem, eval_operator, }, debugger::DebugContext, - BlockId, Config, GetSpan, Range, Record, ShellError, Span, Value, VarId, ENV_VARIABLE_ID, }; use std::{borrow::Cow, collections::HashMap, sync::Arc}; diff --git a/crates/nu-protocol/src/eval_const.rs b/crates/nu-protocol/src/eval_const.rs index b387de4120..7e8cf11b2b 100644 --- a/crates/nu-protocol/src/eval_const.rs +++ b/crates/nu-protocol/src/eval_const.rs @@ -3,12 +3,12 @@ //! This enables you to assign `const`-constants and execute parse-time code dependent on this. //! e.g. `source $my_const` use crate::{ + BlockId, Config, HistoryFileFormat, PipelineData, Record, ShellError, Span, Value, VarId, ast::{Assignment, Block, Call, Expr, Expression, ExternalArgument}, debugger::{DebugContext, WithoutDebug}, engine::{EngineState, StateWorkingSet}, eval_base::Eval, - record, BlockId, Config, HistoryFileFormat, PipelineData, Record, ShellError, Span, Value, - VarId, + record, }; use nu_system::os_info::{get_kernel_version, get_os_arch, get_os_family, get_os_name}; use std::{ diff --git a/crates/nu-protocol/src/ir/call.rs b/crates/nu-protocol/src/ir/call.rs index b931373017..6f65c4edc5 100644 --- a/crates/nu-protocol/src/ir/call.rs +++ b/crates/nu-protocol/src/ir/call.rs @@ -1,9 +1,9 @@ use std::sync::Arc; use crate::{ + DeclId, ShellError, Span, Spanned, Value, ast::Expression, engine::{self, Argument, Stack}, - DeclId, ShellError, Span, Spanned, Value, }; use super::DataSlice; @@ -191,7 +191,7 @@ impl Call { _ => { return Err(ShellError::CannotSpreadAsList { span: rest_val.span(), - }) + }); } } } else { diff --git a/crates/nu-protocol/src/ir/display.rs b/crates/nu-protocol/src/ir/display.rs index 89891db403..9b259c5d82 100644 --- a/crates/nu-protocol/src/ir/display.rs +++ b/crates/nu-protocol/src/ir/display.rs @@ -1,5 +1,5 @@ use super::{DataSlice, Instruction, IrBlock, Literal, RedirectMode}; -use crate::{ast::Pattern, engine::EngineState, DeclId, VarId}; +use crate::{DeclId, VarId, ast::Pattern, engine::EngineState}; use std::fmt::{self}; pub struct FmtIrBlock<'a> { diff --git a/crates/nu-protocol/src/ir/mod.rs b/crates/nu-protocol/src/ir/mod.rs index 9d657ba080..6cb2840874 100644 --- a/crates/nu-protocol/src/ir/mod.rs +++ b/crates/nu-protocol/src/ir/mod.rs @@ -1,7 +1,7 @@ use crate::{ + BlockId, DeclId, Filesize, RegId, Span, Value, VarId, ast::{CellPath, Expression, Operator, Pattern, RangeInclusion}, engine::EngineState, - BlockId, DeclId, Filesize, RegId, Span, Value, VarId, }; use chrono::{DateTime, FixedOffset}; use serde::{Deserialize, Serialize}; diff --git a/crates/nu-protocol/src/lev_distance.rs b/crates/nu-protocol/src/lev_distance.rs index 77bc20fd65..3e65d6e437 100644 --- a/crates/nu-protocol/src/lev_distance.rs +++ b/crates/nu-protocol/src/lev_distance.rs @@ -94,11 +94,7 @@ pub fn lev_distance_with_substrings(a: &str, b: &str, limit: usize) -> Option [, ]`", String::from_utf8_lossy(name)), + format!( + "Trying to import something but the parent `{}` is not a module, maybe you want to try `use [, ]`", + String::from_utf8_lossy(name) + ), rest[0].span(), )] } else { diff --git a/crates/nu-protocol/src/parser_path.rs b/crates/nu-protocol/src/parser_path.rs index 09e90475f9..c49ee42ba6 100644 --- a/crates/nu-protocol/src/parser_path.rs +++ b/crates/nu-protocol/src/parser_path.rs @@ -1,6 +1,6 @@ use crate::{ - engine::{StateWorkingSet, VirtualPath}, FileId, + engine::{StateWorkingSet, VirtualPath}, }; use std::{ ffi::OsStr, diff --git a/crates/nu-protocol/src/pipeline/byte_stream.rs b/crates/nu-protocol/src/pipeline/byte_stream.rs index 2a7c79e128..ac85ea1645 100644 --- a/crates/nu-protocol/src/pipeline/byte_stream.rs +++ b/crates/nu-protocol/src/pipeline/byte_stream.rs @@ -5,8 +5,8 @@ #[cfg(feature = "os")] use crate::process::{ChildPipe, ChildProcess}; use crate::{ - shell_error::{bridge::ShellErrorBridge, io::IoError}, IntRange, PipelineData, ShellError, Signals, Span, Type, Value, + shell_error::{bridge::ShellErrorBridge, io::IoError}, }; use serde::{Deserialize, Serialize}; use std::ops::Bound; diff --git a/crates/nu-protocol/src/pipeline/handlers.rs b/crates/nu-protocol/src/pipeline/handlers.rs index 3c1b1b820a..202eb0a12e 100644 --- a/crates/nu-protocol/src/pipeline/handlers.rs +++ b/crates/nu-protocol/src/pipeline/handlers.rs @@ -1,7 +1,7 @@ use std::fmt::Debug; use std::sync::{Arc, Mutex}; -use crate::{engine::Sequence, ShellError, SignalAction}; +use crate::{ShellError, SignalAction, engine::Sequence}; /// Handler is a closure that can be sent across threads and shared. pub type Handler = Box; diff --git a/crates/nu-protocol/src/pipeline/pipeline_data.rs b/crates/nu-protocol/src/pipeline/pipeline_data.rs index a0ea603dc1..0cb4b6f6a4 100644 --- a/crates/nu-protocol/src/pipeline/pipeline_data.rs +++ b/crates/nu-protocol/src/pipeline/pipeline_data.rs @@ -1,10 +1,10 @@ use crate::{ + ByteStream, ByteStreamType, Config, ListStream, OutDest, PipelineMetadata, Range, ShellError, + Signals, Span, Type, Value, ast::{Call, PathMember}, engine::{EngineState, Stack}, location, shell_error::{io::IoError, location::Location}, - ByteStream, ByteStreamType, Config, ListStream, OutDest, PipelineMetadata, Range, ShellError, - Signals, Span, Type, Value, }; use std::{borrow::Cow, io::Write}; @@ -347,7 +347,7 @@ impl PipelineData { wrong_type: other.get_type().to_string(), dst_span: span, src_span: val_span, - }) + }); } } } @@ -360,7 +360,7 @@ impl PipelineData { wrong_type: "null".into(), dst_span: span, src_span: span, - }) + }); } PipelineData::ByteStream(stream, ..) => { if let Some(chunks) = stream.chunks() { diff --git a/crates/nu-protocol/src/pipeline/signals.rs b/crates/nu-protocol/src/pipeline/signals.rs index 1d60ac103c..f9a00329e7 100644 --- a/crates/nu-protocol/src/pipeline/signals.rs +++ b/crates/nu-protocol/src/pipeline/signals.rs @@ -2,8 +2,8 @@ use crate::{ShellError, Span}; use nu_glob::Interruptible; use serde::{Deserialize, Serialize}; use std::sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }; /// Used to check for signals to suspend or terminate the execution of Nushell code. diff --git a/crates/nu-protocol/src/process/child.rs b/crates/nu-protocol/src/process/child.rs index b431a11df8..d419b808d5 100644 --- a/crates/nu-protocol/src/process/child.rs +++ b/crates/nu-protocol/src/process/child.rs @@ -1,8 +1,8 @@ use crate::{ + ShellError, Span, byte_stream::convert_file, engine::{EngineState, FrozenJob, Job}, shell_error::io::IoError, - ShellError, Span, }; use nu_system::{ExitStatus, ForegroundChild, ForegroundWaitStatus}; diff --git a/crates/nu-protocol/src/signature.rs b/crates/nu-protocol/src/signature.rs index 8405846eb2..ba576dc7b6 100644 --- a/crates/nu-protocol/src/signature.rs +++ b/crates/nu-protocol/src/signature.rs @@ -1,6 +1,6 @@ use crate::{ - engine::{Call, Command, CommandType, EngineState, Stack}, BlockId, Example, PipelineData, ShellError, SyntaxShape, Type, Value, VarId, + engine::{Call, Command, CommandType, EngineState, Stack}, }; use nu_derive_value::FromValue; use serde::{Deserialize, Serialize}; diff --git a/crates/nu-protocol/src/value/custom_value.rs b/crates/nu-protocol/src/value/custom_value.rs index fbfc4ee911..2f02af1aac 100644 --- a/crates/nu-protocol/src/value/custom_value.rs +++ b/crates/nu-protocol/src/value/custom_value.rs @@ -1,6 +1,6 @@ use std::{cmp::Ordering, fmt}; -use crate::{ast::Operator, ShellError, Span, Type, Value}; +use crate::{ShellError, Span, Type, Value, ast::Operator}; /// Trait definition for a custom [`Value`](crate::Value) type #[typetag::serde(tag = "type")] diff --git a/crates/nu-protocol/src/value/from_value.rs b/crates/nu-protocol/src/value/from_value.rs index f617270d1d..c9f71a782d 100644 --- a/crates/nu-protocol/src/value/from_value.rs +++ b/crates/nu-protocol/src/value/from_value.rs @@ -1,7 +1,7 @@ use crate::{ + NuGlob, Range, Record, ShellError, Span, Spanned, Type, Value, ast::{CellPath, PathMember}, engine::Closure, - NuGlob, Range, Record, ShellError, Span, Spanned, Type, Value, }; use chrono::{DateTime, FixedOffset}; use std::{ @@ -771,7 +771,7 @@ fn int_too_large_error(int: impl fmt::Display, max: impl fmt::Display, span: Spa #[cfg(test)] mod tests { - use crate::{engine::Closure, FromValue, IntoValue, Record, Span, Type, Value}; + use crate::{FromValue, IntoValue, Record, Span, Type, Value, engine::Closure}; use std::ops::Deref; #[test] diff --git a/crates/nu-protocol/src/value/into_value.rs b/crates/nu-protocol/src/value/into_value.rs index 0cebd2e481..eec66ca86d 100644 --- a/crates/nu-protocol/src/value/into_value.rs +++ b/crates/nu-protocol/src/value/into_value.rs @@ -1,4 +1,4 @@ -use crate::{ast::CellPath, engine::Closure, Range, Record, ShellError, Span, Value}; +use crate::{Range, Record, ShellError, Span, Value, ast::CellPath, engine::Closure}; use chrono::{DateTime, FixedOffset}; use std::{borrow::Borrow, collections::HashMap}; diff --git a/crates/nu-protocol/src/value/mod.rs b/crates/nu-protocol/src/value/mod.rs index 7ff9218eea..9bfe568a6b 100644 --- a/crates/nu-protocol/src/value/mod.rs +++ b/crates/nu-protocol/src/value/mod.rs @@ -20,18 +20,17 @@ pub use range::{FloatRange, IntRange, Range}; pub use record::Record; use crate::{ + BlockId, Config, ShellError, Signals, Span, Type, ast::{Bits, Boolean, CellPath, Comparison, Math, Operator, PathMember}, did_you_mean, engine::{Closure, EngineState}, - BlockId, Config, ShellError, Signals, Span, Type, }; use chrono::{DateTime, Datelike, Duration, FixedOffset, Local, Locale, TimeZone}; use chrono_humanize::HumanTime; use fancy_regex::Regex; use nu_utils::{ - contains_emoji, - locale::{get_system_locale_string, LOCALE_OVERRIDE_ENV_VAR}, - IgnoreCaseExt, SharedCow, + IgnoreCaseExt, SharedCow, contains_emoji, + locale::{LOCALE_OVERRIDE_ENV_VAR, get_system_locale_string}, }; use serde::{Deserialize, Serialize}; use std::{ @@ -1001,7 +1000,7 @@ impl Value { Some(format) => self.format_datetime(val, format), None => human_time_from_now(val).to_string(), }, - Value::List { ref vals, .. } => { + Value::List { vals, .. } => { if !vals.is_empty() && vals.iter().all(|x| matches!(x, Value::Record { .. })) { format!( "[table {} row{}]", @@ -1677,16 +1676,16 @@ impl Value { f(self)?; // Check for contained values match self { - Value::Record { ref mut val, .. } => val + Value::Record { val, .. } => val .to_mut() .iter_mut() .try_for_each(|(_, rec_value)| rec_value.recurse_mut(f)), - Value::List { ref mut vals, .. } => vals + Value::List { vals, .. } => vals .iter_mut() .try_for_each(|list_value| list_value.recurse_mut(f)), // Closure captures are visited. Maybe these don't have to be if they are changed to // more opaque references. - Value::Closure { ref mut val, .. } => val + Value::Closure { val, .. } => val .captures .iter_mut() .map(|(_, captured_value)| captured_value) @@ -2048,7 +2047,7 @@ fn get_value_member<'a>( }) } } - Value::Range { ref val, .. } => { + Value::Range { val, .. } => { if let Some(item) = val .into_range_iter(current.span(), Signals::empty()) .nth(*count) @@ -2063,7 +2062,7 @@ fn get_value_member<'a>( }) } } - Value::Custom { ref val, .. } => { + Value::Custom { val, .. } => { match val.follow_path_int(current.span(), *count, *origin_span) { Ok(val) => Ok(ControlFlow::Continue(Cow::Owned(val))), @@ -2169,7 +2168,7 @@ fn get_value_member<'a>( Ok(ControlFlow::Continue(Cow::Owned(Value::list(list, span)))) } - Value::Custom { ref val, .. } => { + Value::Custom { val, .. } => { match val.follow_path_string(current.span(), column_name.clone(), *origin_span) { Ok(val) => Ok(ControlFlow::Continue(Cow::Owned(val))), @@ -3341,7 +3340,9 @@ impl Value { let help = if matches!(self, Value::List { .. }) || matches!(rhs, Value::List { .. }) { - Some("if you meant to append a value to a list or a record to a table, use the `append` command or wrap the value in a list. For example: `$list ++ $value` should be `$list ++ [$value]` or `$list | append $value`.") + Some( + "if you meant to append a value to a list or a record to a table, use the `append` command or wrap the value in a list. For example: `$list ++ $value` should be `$list ++ [$value]` or `$list | append $value`.", + ) } else { None }; @@ -4501,14 +4502,18 @@ mod tests { // complex values returning None assert!(Value::test_record(Record::default()).coerce_bool().is_err()); - assert!(Value::test_list(vec![Value::test_int(1)]) + assert!( + Value::test_list(vec![Value::test_int(1)]) + .coerce_bool() + .is_err() + ); + assert!( + Value::test_date( + chrono::DateTime::parse_from_rfc3339("2024-01-01T12:00:00+00:00").unwrap(), + ) .coerce_bool() - .is_err()); - assert!(Value::test_date( - chrono::DateTime::parse_from_rfc3339("2024-01-01T12:00:00+00:00").unwrap(), - ) - .coerce_bool() - .is_err()); + .is_err() + ); assert!(Value::test_glob("*.rs").coerce_bool().is_err()); assert!(Value::test_binary(vec![1, 2, 3]).coerce_bool().is_err()); assert!(Value::test_duration(3600).coerce_bool().is_err()); diff --git a/crates/nu-protocol/src/value/range.rs b/crates/nu-protocol/src/value/range.rs index c07bfbe78e..8b001b4b2d 100644 --- a/crates/nu-protocol/src/value/range.rs +++ b/crates/nu-protocol/src/value/range.rs @@ -1,12 +1,12 @@ //! A Range is an iterator over integers or floats. -use crate::{ast::RangeInclusion, ShellError, Signals, Span, Value}; +use crate::{ShellError, Signals, Span, Value, ast::RangeInclusion}; use core::ops::Bound; use serde::{Deserialize, Serialize}; use std::{cmp::Ordering, fmt::Display}; mod int_range { - use crate::{ast::RangeInclusion, FromValue, ShellError, Signals, Span, Value}; + use crate::{FromValue, ShellError, Signals, Span, Value, ast::RangeInclusion}; use serde::{Deserialize, Serialize}; use std::{cmp::Ordering, fmt::Display, ops::Bound}; @@ -209,11 +209,7 @@ mod int_range { (Bound::Included(l), Bound::Included(r)) | (Bound::Excluded(l), Bound::Excluded(r)) => { let ord = l.cmp(&r); - if self.step < 0 { - ord.reverse() - } else { - ord - } + if self.step < 0 { ord.reverse() } else { ord } } (Bound::Included(l), Bound::Excluded(r)) => match l.cmp(&r) { Ordering::Equal => Ordering::Greater, @@ -312,8 +308,8 @@ mod int_range { mod float_range { use crate::{ - ast::RangeInclusion, format::ObviousFloat, IntRange, Range, ShellError, Signals, Span, - Value, + IntRange, Range, ShellError, Signals, Span, Value, ast::RangeInclusion, + format::ObviousFloat, }; use serde::{Deserialize, Serialize}; use std::{cmp::Ordering, fmt::Display, ops::Bound}; @@ -479,11 +475,7 @@ mod float_range { (Bound::Included(l), Bound::Included(r)) | (Bound::Excluded(l), Bound::Excluded(r)) => { let ord = float_cmp(l, r); - if self.step < 0.0 { - ord.reverse() - } else { - ord - } + if self.step < 0.0 { ord.reverse() } else { ord } } (Bound::Included(l), Bound::Excluded(r)) => match float_cmp(l, r) { Ordering::Equal => Ordering::Greater, diff --git a/crates/nu-protocol/src/value/record.rs b/crates/nu-protocol/src/value/record.rs index 2b667a7cf0..212e598ce6 100644 --- a/crates/nu-protocol/src/value/record.rs +++ b/crates/nu-protocol/src/value/record.rs @@ -3,7 +3,7 @@ use std::{iter::FusedIterator, ops::RangeBounds}; use crate::{ShellError, Span, Value}; -use serde::{de::Visitor, ser::SerializeMap, Deserialize, Serialize}; +use serde::{Deserialize, Serialize, de::Visitor, ser::SerializeMap}; #[derive(Debug, Clone, Default)] pub struct Record { diff --git a/crates/nu-protocol/src/value/test_derive.rs b/crates/nu-protocol/src/value/test_derive.rs index cbb9ccbadf..bdf8c058fa 100644 --- a/crates/nu-protocol/src/value/test_derive.rs +++ b/crates/nu-protocol/src/value/test_derive.rs @@ -1,4 +1,4 @@ -use crate::{record, FromValue, IntoValue, Record, Span, Value}; +use crate::{FromValue, IntoValue, Record, Span, Value, record}; use bytes::Bytes; use std::collections::HashMap; diff --git a/crates/nu-protocol/tests/into_config.rs b/crates/nu-protocol/tests/into_config.rs index eae14141cf..4badbc91cd 100644 --- a/crates/nu-protocol/tests/into_config.rs +++ b/crates/nu-protocol/tests/into_config.rs @@ -50,9 +50,11 @@ fn config_add_unsupported_key() { r#"$env.config.foo = 2"#, r#";"#])); - assert!(actual - .err - .contains("Unknown config option: $env.config.foo")); + assert!( + actual + .err + .contains("Unknown config option: $env.config.foo") + ); } #[test] diff --git a/crates/nu-protocol/tests/pipeline/byte_stream.rs b/crates/nu-protocol/tests/pipeline/byte_stream.rs index 7478d8184a..d1054bdd37 100644 --- a/crates/nu-protocol/tests/pipeline/byte_stream.rs +++ b/crates/nu-protocol/tests/pipeline/byte_stream.rs @@ -1,4 +1,4 @@ -use nu_protocol::{ast::RangeInclusion, ByteStream, IntRange, Signals, Span, Value}; +use nu_protocol::{ByteStream, IntRange, Signals, Span, Value, ast::RangeInclusion}; #[test] pub fn test_simple_positive_slice_exclusive() { diff --git a/crates/nu-protocol/tests/test_value.rs b/crates/nu-protocol/tests/test_value.rs index fb26bea0e2..419b3f57d3 100644 --- a/crates/nu-protocol/tests/test_value.rs +++ b/crates/nu-protocol/tests/test_value.rs @@ -1,6 +1,6 @@ use nu_protocol::{ - engine::{EngineState, Stack}, Config, Span, Value, + engine::{EngineState, Stack}, }; use rstest::rstest; diff --git a/crates/nu-std/Cargo.toml b/crates/nu-std/Cargo.toml index 8a46966059..ea094fdf29 100644 --- a/crates/nu-std/Cargo.toml +++ b/crates/nu-std/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "The standard library of Nushell" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-std" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-std" version = "0.104.1" diff --git a/crates/nu-std/src/lib.rs b/crates/nu-std/src/lib.rs index cf14140ca1..894c468498 100644 --- a/crates/nu-std/src/lib.rs +++ b/crates/nu-std/src/lib.rs @@ -2,8 +2,9 @@ use log::trace; use nu_parser::parse; use nu_protocol::{ + VirtualPathId, engine::{FileStack, StateWorkingSet, VirtualPath}, - report_parse_error, VirtualPathId, + report_parse_error, }; use std::path::PathBuf; diff --git a/crates/nu-system/Cargo.toml b/crates/nu-system/Cargo.toml index 2d318ab85b..21a7ee69fe 100644 --- a/crates/nu-system/Cargo.toml +++ b/crates/nu-system/Cargo.toml @@ -4,7 +4,7 @@ description = "Nushell system querying" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-system" name = "nu-system" version = "0.104.1" -edition = "2021" +edition = "2024" license = "MIT" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -48,4 +48,4 @@ windows = { workspace = true, features = [ "Win32_System_SystemInformation", "Win32_System_Threading", "Win32_UI_Shell", -]} \ No newline at end of file +]} diff --git a/crates/nu-system/src/foreground.rs b/crates/nu-system/src/foreground.rs index 224d96df55..22890dfb52 100644 --- a/crates/nu-system/src/foreground.rs +++ b/crates/nu-system/src/foreground.rs @@ -1,4 +1,4 @@ -use std::sync::{atomic::AtomicU32, Arc}; +use std::sync::{Arc, atomic::AtomicU32}; use std::io; @@ -274,11 +274,7 @@ impl ForegroundGuard { } else if pcnt .fetch_update(Ordering::SeqCst, Ordering::SeqCst, |count| { // Avoid a race condition: only increment if count is > 0 - if count > 0 { - Some(count + 1) - } else { - None - } + if count > 0 { Some(count + 1) } else { None } }) .is_ok() { @@ -349,7 +345,7 @@ impl Drop for ForegroundGuard { #[cfg(unix)] mod child_pgroup { use nix::{ - sys::signal::{sigaction, SaFlags, SigAction, SigHandler, SigSet, Signal}, + sys::signal::{SaFlags, SigAction, SigHandler, SigSet, Signal, sigaction}, unistd::{self, Pid}, }; use std::{ diff --git a/crates/nu-system/src/freebsd.rs b/crates/nu-system/src/freebsd.rs index 4a556762e4..6c91f66ba2 100644 --- a/crates/nu-system/src/freebsd.rs +++ b/crates/nu-system/src/freebsd.rs @@ -1,7 +1,7 @@ use itertools::{EitherOrBoth, Itertools}; use libc::{ - c_char, kinfo_proc, sysctl, CTL_HW, CTL_KERN, KERN_PROC, KERN_PROC_ALL, KERN_PROC_ARGS, - TDF_IDLETD, + CTL_HW, CTL_KERN, KERN_PROC, KERN_PROC_ALL, KERN_PROC_ARGS, TDF_IDLETD, c_char, kinfo_proc, + sysctl, }; use std::{ ffi::CStr, diff --git a/crates/nu-system/src/linux.rs b/crates/nu-system/src/linux.rs index 14229b8fac..82c1b9ae7b 100644 --- a/crates/nu-system/src/linux.rs +++ b/crates/nu-system/src/linux.rs @@ -97,7 +97,9 @@ pub fn collect_proc(interval: Duration, _with_thread: bool) -> Vec let curr_proc = if let Ok(p) = Process::new(curr_proc_pid) { p } else { - info!("failed to retrieve info for pid={curr_proc_pid}, process probably died between snapshots"); + info!( + "failed to retrieve info for pid={curr_proc_pid}, process probably died between snapshots" + ); continue; }; let cwd = curr_proc.cwd().unwrap_or_default(); diff --git a/crates/nu-system/src/macos.rs b/crates/nu-system/src/macos.rs index 4978f50e7f..37ade4e0ab 100644 --- a/crates/nu-system/src/macos.rs +++ b/crates/nu-system/src/macos.rs @@ -1,12 +1,12 @@ use libc::{c_int, c_void, size_t}; use libproc::libproc::bsd_info::BSDInfo; -use libproc::libproc::file_info::{pidfdinfo, ListFDs, ProcFDType}; +use libproc::libproc::file_info::{ListFDs, ProcFDType, pidfdinfo}; use libproc::libproc::net_info::{InSockInfo, SocketFDInfo, SocketInfoKind, TcpSockInfo}; -use libproc::libproc::pid_rusage::{pidrusage, RUsageInfoV2}; -use libproc::libproc::proc_pid::{listpidinfo, pidinfo, ListThreads}; +use libproc::libproc::pid_rusage::{RUsageInfoV2, pidrusage}; +use libproc::libproc::proc_pid::{ListThreads, listpidinfo, pidinfo}; use libproc::libproc::task_info::{TaskAllInfo, TaskInfo}; use libproc::libproc::thread_info::ThreadInfo; -use libproc::processes::{pids_by_type, ProcFilter}; +use libproc::processes::{ProcFilter, pids_by_type}; use mach2::mach_time; use std::cmp; use std::path::{Path, PathBuf}; @@ -155,9 +155,11 @@ pub struct PathInfo { } unsafe fn get_unchecked_str(cp: *mut u8, start: *mut u8) -> String { - let len = (cp as usize).saturating_sub(start as usize); - let part = std::slice::from_raw_parts(start, len); - String::from_utf8_unchecked(part.to_vec()) + unsafe { + let len = (cp as usize).saturating_sub(start as usize); + let part = std::slice::from_raw_parts(start, len); + String::from_utf8_unchecked(part.to_vec()) + } } fn get_path_info(pid: i32, mut size: size_t) -> Option { diff --git a/crates/nu-system/src/netbsd.rs b/crates/nu-system/src/netbsd.rs index 04f69b35fe..7b05d9e1d1 100644 --- a/crates/nu-system/src/netbsd.rs +++ b/crates/nu-system/src/netbsd.rs @@ -1,7 +1,7 @@ //! This is used for both NetBSD and OpenBSD, because they are fairly similar. use itertools::{EitherOrBoth, Itertools}; -use libc::{sysctl, CTL_HW, CTL_KERN, KERN_PROC_ALL, KERN_PROC_ARGS, KERN_PROC_ARGV}; +use libc::{CTL_HW, CTL_KERN, KERN_PROC_ALL, KERN_PROC_ARGS, KERN_PROC_ARGV, sysctl}; use std::{ io, mem::{self, MaybeUninit}, diff --git a/crates/nu-system/src/windows.rs b/crates/nu-system/src/windows.rs index 77b5b8834e..28ec5986e6 100644 --- a/crates/nu-system/src/windows.rs +++ b/crates/nu-system/src/windows.rs @@ -11,7 +11,7 @@ use ntapi::ntwow64::{PEB32, RTL_USER_PROCESS_PARAMETERS32}; use std::cell::RefCell; use std::collections::HashMap; use std::ffi::OsString; -use std::mem::{size_of, zeroed, MaybeUninit}; +use std::mem::{MaybeUninit, size_of, zeroed}; use std::os::windows::ffi::OsStringExt; use std::path::PathBuf; use std::ptr; @@ -25,27 +25,27 @@ use windows::core::{PCWSTR, PWSTR}; use windows::Wdk::System::SystemServices::RtlGetVersion; use windows::Wdk::System::Threading::{ - NtQueryInformationProcess, ProcessBasicInformation, ProcessCommandLineInformation, - ProcessWow64Information, PROCESSINFOCLASS, + NtQueryInformationProcess, PROCESSINFOCLASS, ProcessBasicInformation, + ProcessCommandLineInformation, ProcessWow64Information, }; use windows::Win32::Foundation::{ - CloseHandle, LocalFree, FALSE, FILETIME, HANDLE, HLOCAL, HMODULE, MAX_PATH, PSID, + CloseHandle, FALSE, FILETIME, HANDLE, HLOCAL, HMODULE, LocalFree, MAX_PATH, PSID, STATUS_BUFFER_OVERFLOW, STATUS_BUFFER_TOO_SMALL, STATUS_INFO_LENGTH_MISMATCH, UNICODE_STRING, }; use windows::Win32::Security::{ AdjustTokenPrivileges, GetTokenInformation, LookupAccountSidW, LookupPrivilegeValueW, - TokenGroups, TokenUser, SE_DEBUG_NAME, SE_PRIVILEGE_ENABLED, SID, SID_NAME_USE, - TOKEN_ADJUST_PRIVILEGES, TOKEN_GROUPS, TOKEN_PRIVILEGES, TOKEN_QUERY, TOKEN_USER, + SE_DEBUG_NAME, SE_PRIVILEGE_ENABLED, SID, SID_NAME_USE, TOKEN_ADJUST_PRIVILEGES, TOKEN_GROUPS, + TOKEN_PRIVILEGES, TOKEN_QUERY, TOKEN_USER, TokenGroups, TokenUser, }; use windows::Win32::System::Diagnostics::Debug::ReadProcessMemory; use windows::Win32::System::Diagnostics::ToolHelp::{ - CreateToolhelp32Snapshot, Process32First, Process32Next, PROCESSENTRY32, TH32CS_SNAPPROCESS, + CreateToolhelp32Snapshot, PROCESSENTRY32, Process32First, Process32Next, TH32CS_SNAPPROCESS, }; -use windows::Win32::System::Memory::{VirtualQueryEx, MEMORY_BASIC_INFORMATION}; +use windows::Win32::System::Memory::{MEMORY_BASIC_INFORMATION, VirtualQueryEx}; use windows::Win32::System::ProcessStatus::{ GetModuleBaseNameW, GetProcessMemoryInfo, K32EnumProcesses, PROCESS_MEMORY_COUNTERS, @@ -55,8 +55,8 @@ use windows::Win32::System::ProcessStatus::{ use windows::Win32::System::SystemInformation::OSVERSIONINFOEXW; use windows::Win32::System::Threading::{ - GetCurrentProcess, GetPriorityClass, GetProcessIoCounters, GetProcessTimes, OpenProcess, - OpenProcessToken, IO_COUNTERS, PEB, PROCESS_BASIC_INFORMATION, PROCESS_QUERY_INFORMATION, + GetCurrentProcess, GetPriorityClass, GetProcessIoCounters, GetProcessTimes, IO_COUNTERS, + OpenProcess, OpenProcessToken, PEB, PROCESS_BASIC_INFORMATION, PROCESS_QUERY_INFORMATION, PROCESS_VM_READ, }; @@ -364,10 +364,10 @@ fn get_times(handle: HANDLE) -> Option<(u64, u64, u64, u64)> { &mut user as *mut FILETIME, ); - let start = u64::from(start.dwHighDateTime) << 32 | u64::from(start.dwLowDateTime); - let exit = u64::from(exit.dwHighDateTime) << 32 | u64::from(exit.dwLowDateTime); - let sys = u64::from(sys.dwHighDateTime) << 32 | u64::from(sys.dwLowDateTime); - let user = u64::from(user.dwHighDateTime) << 32 | u64::from(user.dwLowDateTime); + let start = (u64::from(start.dwHighDateTime) << 32) | u64::from(start.dwLowDateTime); + let exit = (u64::from(exit.dwHighDateTime) << 32) | u64::from(exit.dwLowDateTime); + let sys = (u64::from(sys.dwHighDateTime) << 32) | u64::from(sys.dwLowDateTime); + let user = (u64::from(user.dwHighDateTime) << 32) | u64::from(user.dwLowDateTime); if ret.is_ok() { Some((start, exit, sys, user)) @@ -480,217 +480,227 @@ unsafe fn get_process_data( let mut buffer: Vec = Vec::with_capacity(size / 2 + 1); let mut bytes_read = 0; - if ReadProcessMemory( - handle, - ptr, - buffer.as_mut_ptr().cast(), - size, - Some(&mut bytes_read), - ) - .is_err() - { - return Err("Unable to read process data"); - } + unsafe { + if ReadProcessMemory( + handle, + ptr, + buffer.as_mut_ptr().cast(), + size, + Some(&mut bytes_read), + ) + .is_err() + { + return Err("Unable to read process data"); + } - // Documentation states that the function fails if not all data is accessible. - if bytes_read != size { - return Err("ReadProcessMemory returned unexpected number of bytes read"); - } + // Documentation states that the function fails if not all data is accessible. + if bytes_read != size { + return Err("ReadProcessMemory returned unexpected number of bytes read"); + } - buffer.set_len(size / 2); - buffer.push(0); + buffer.set_len(size / 2); + buffer.push(0); + } Ok(buffer) } unsafe fn get_region_size(handle: HANDLE, ptr: *const c_void) -> Result { - let mut meminfo = MaybeUninit::::uninit(); - if VirtualQueryEx( - handle, - Some(ptr), - meminfo.as_mut_ptr().cast(), - size_of::(), - ) == 0 - { - return Err("Unable to read process memory information"); + unsafe { + let mut meminfo = MaybeUninit::::uninit(); + if VirtualQueryEx( + handle, + Some(ptr), + meminfo.as_mut_ptr().cast(), + size_of::(), + ) == 0 + { + return Err("Unable to read process memory information"); + } + let meminfo = meminfo.assume_init(); + Ok((meminfo.RegionSize as isize - ptr.offset_from(meminfo.BaseAddress)) as usize) } - let meminfo = meminfo.assume_init(); - Ok((meminfo.RegionSize as isize - ptr.offset_from(meminfo.BaseAddress)) as usize) } unsafe fn ph_query_process_variable_size( process_handle: HANDLE, process_information_class: PROCESSINFOCLASS, ) -> Option> { - let mut return_length = MaybeUninit::::uninit(); + unsafe { + let mut return_length = MaybeUninit::::uninit(); - if let Err(err) = NtQueryInformationProcess( - process_handle, - process_information_class, - std::ptr::null_mut(), - 0, - return_length.as_mut_ptr() as *mut _, - ) - .ok() - { - if ![ - STATUS_BUFFER_OVERFLOW.into(), - STATUS_BUFFER_TOO_SMALL.into(), - STATUS_INFO_LENGTH_MISMATCH.into(), - ] - .contains(&err.code()) + if let Err(err) = NtQueryInformationProcess( + process_handle, + process_information_class, + std::ptr::null_mut(), + 0, + return_length.as_mut_ptr() as *mut _, + ) + .ok() + { + if ![ + STATUS_BUFFER_OVERFLOW.into(), + STATUS_BUFFER_TOO_SMALL.into(), + STATUS_INFO_LENGTH_MISMATCH.into(), + ] + .contains(&err.code()) + { + return None; + } + } + + let mut return_length = return_length.assume_init(); + let buf_len = (return_length as usize) / 2; + let mut buffer: Vec = Vec::with_capacity(buf_len + 1); + if NtQueryInformationProcess( + process_handle, + process_information_class, + buffer.as_mut_ptr() as *mut _, + return_length, + &mut return_length as *mut _, + ) + .is_err() { return None; } + buffer.set_len(buf_len); + buffer.push(0); + Some(buffer) } - - let mut return_length = return_length.assume_init(); - let buf_len = (return_length as usize) / 2; - let mut buffer: Vec = Vec::with_capacity(buf_len + 1); - if NtQueryInformationProcess( - process_handle, - process_information_class, - buffer.as_mut_ptr() as *mut _, - return_length, - &mut return_length as *mut _, - ) - .is_err() - { - return None; - } - buffer.set_len(buf_len); - buffer.push(0); - Some(buffer) } unsafe fn get_cmdline_from_buffer(buffer: PCWSTR) -> Vec { - // Get argc and argv from the command line - let mut argc = MaybeUninit::::uninit(); - let argv_p = CommandLineToArgvW(buffer, argc.as_mut_ptr()); - if argv_p.is_null() { - return Vec::new(); + unsafe { + // Get argc and argv from the command line + let mut argc = MaybeUninit::::uninit(); + let argv_p = CommandLineToArgvW(buffer, argc.as_mut_ptr()); + if argv_p.is_null() { + return Vec::new(); + } + let argc = argc.assume_init(); + let argv = std::slice::from_raw_parts(argv_p, argc as usize); + + let mut res = Vec::new(); + for arg in argv { + res.push(String::from_utf16_lossy(arg.as_wide())); + } + + let _err = LocalFree(HLOCAL(argv_p as _)); + + res } - let argc = argc.assume_init(); - let argv = std::slice::from_raw_parts(argv_p, argc as usize); - - let mut res = Vec::new(); - for arg in argv { - res.push(String::from_utf16_lossy(arg.as_wide())); - } - - let _err = LocalFree(HLOCAL(argv_p as _)); - - res } unsafe fn get_process_params( handle: HANDLE, ) -> Result<(Vec, Vec, PathBuf), &'static str> { - if !cfg!(target_pointer_width = "64") { - return Err("Non 64 bit targets are not supported"); - } + unsafe { + if !cfg!(target_pointer_width = "64") { + return Err("Non 64 bit targets are not supported"); + } - // First check if target process is running in wow64 compatibility emulator - let mut pwow32info = MaybeUninit::<*const c_void>::uninit(); - if NtQueryInformationProcess( - handle, - ProcessWow64Information, - pwow32info.as_mut_ptr().cast(), - size_of::<*const c_void>() as u32, - null_mut(), - ) - .is_err() - { - return Err("Unable to check WOW64 information about the process"); - } - let pwow32info = pwow32info.assume_init(); - - if pwow32info.is_null() { - // target is a 64 bit process - - let mut pbasicinfo = MaybeUninit::::uninit(); + // First check if target process is running in wow64 compatibility emulator + let mut pwow32info = MaybeUninit::<*const c_void>::uninit(); if NtQueryInformationProcess( handle, - ProcessBasicInformation, - pbasicinfo.as_mut_ptr().cast(), - size_of::() as u32, + ProcessWow64Information, + pwow32info.as_mut_ptr().cast(), + size_of::<*const c_void>() as u32, null_mut(), ) .is_err() { - return Err("Unable to get basic process information"); + return Err("Unable to check WOW64 information about the process"); } - let pinfo = pbasicinfo.assume_init(); + let pwow32info = pwow32info.assume_init(); - let mut peb = MaybeUninit::::uninit(); + if pwow32info.is_null() { + // target is a 64 bit process + + let mut pbasicinfo = MaybeUninit::::uninit(); + if NtQueryInformationProcess( + handle, + ProcessBasicInformation, + pbasicinfo.as_mut_ptr().cast(), + size_of::() as u32, + null_mut(), + ) + .is_err() + { + return Err("Unable to get basic process information"); + } + let pinfo = pbasicinfo.assume_init(); + + let mut peb = MaybeUninit::::uninit(); + if ReadProcessMemory( + handle, + pinfo.PebBaseAddress.cast(), + peb.as_mut_ptr().cast(), + size_of::(), + None, + ) + .is_err() + { + return Err("Unable to read process PEB"); + } + + let peb = peb.assume_init(); + + let mut proc_params = MaybeUninit::::uninit(); + if ReadProcessMemory( + handle, + peb.ProcessParameters.cast(), + proc_params.as_mut_ptr().cast(), + size_of::(), + None, + ) + .is_err() + { + return Err("Unable to read process parameters"); + } + + let proc_params = proc_params.assume_init(); + return Ok(( + get_cmd_line(&proc_params, handle), + get_proc_env(&proc_params, handle), + get_cwd(&proc_params, handle), + )); + } + // target is a 32 bit process in wow64 mode + + let mut peb32 = MaybeUninit::::uninit(); if ReadProcessMemory( handle, - pinfo.PebBaseAddress.cast(), - peb.as_mut_ptr().cast(), - size_of::(), + pwow32info, + peb32.as_mut_ptr().cast(), + size_of::(), None, ) .is_err() { - return Err("Unable to read process PEB"); + return Err("Unable to read PEB32"); } + let peb32 = peb32.assume_init(); - let peb = peb.assume_init(); - - let mut proc_params = MaybeUninit::::uninit(); + let mut proc_params = MaybeUninit::::uninit(); if ReadProcessMemory( handle, - peb.ProcessParameters.cast(), + peb32.ProcessParameters as *mut _, proc_params.as_mut_ptr().cast(), - size_of::(), + size_of::(), None, ) .is_err() { - return Err("Unable to read process parameters"); + return Err("Unable to read 32 bit process parameters"); } - let proc_params = proc_params.assume_init(); - return Ok(( + Ok(( get_cmd_line(&proc_params, handle), get_proc_env(&proc_params, handle), get_cwd(&proc_params, handle), - )); + )) } - // target is a 32 bit process in wow64 mode - - let mut peb32 = MaybeUninit::::uninit(); - if ReadProcessMemory( - handle, - pwow32info, - peb32.as_mut_ptr().cast(), - size_of::(), - None, - ) - .is_err() - { - return Err("Unable to read PEB32"); - } - let peb32 = peb32.assume_init(); - - let mut proc_params = MaybeUninit::::uninit(); - if ReadProcessMemory( - handle, - peb32.ProcessParameters as *mut _, - proc_params.as_mut_ptr().cast(), - size_of::(), - None, - ) - .is_err() - { - return Err("Unable to read 32 bit process parameters"); - } - let proc_params = proc_params.assume_init(); - Ok(( - get_cmd_line(&proc_params, handle), - get_proc_env(&proc_params, handle), - get_cwd(&proc_params, handle), - )) } static WINDOWS_8_1_OR_NEWER: LazyLock = LazyLock::new(|| unsafe { diff --git a/crates/nu-table/Cargo.toml b/crates/nu-table/Cargo.toml index e109472fa2..69a63142b0 100644 --- a/crates/nu-table/Cargo.toml +++ b/crates/nu-table/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Nushell table printing" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-table" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-table" version = "0.104.1" @@ -23,4 +23,4 @@ fancy-regex = { workspace = true } tabled = { workspace = true, features = ["ansi"], default-features = false } [dev-dependencies] -# nu-test-support = { path="../nu-test-support", version = "0.104.1" } \ No newline at end of file +# nu-test-support = { path="../nu-test-support", version = "0.104.1" } diff --git a/crates/nu-table/src/common.rs b/crates/nu-table/src/common.rs index 6176cd2670..c53d5bb3a3 100644 --- a/crates/nu-table/src/common.rs +++ b/crates/nu-table/src/common.rs @@ -1,4 +1,4 @@ -use crate::{clean_charset, colorize_space_str, string_wrap, TableOutput, TableTheme}; +use crate::{TableOutput, TableTheme, clean_charset, colorize_space_str, string_wrap}; use nu_color_config::{Alignment, StyleComputer, TextStyle}; use nu_protocol::{Config, FooterMode, ShellError, Span, TableMode, TrimStrategy, Value}; use nu_utils::terminal_size; diff --git a/crates/nu-table/src/table.rs b/crates/nu-table/src/table.rs index 8ebe165221..5b961a0000 100644 --- a/crates/nu-table/src/table.rs +++ b/crates/nu-table/src/table.rs @@ -10,6 +10,7 @@ use nu_color_config::TextStyle; use nu_protocol::{TableIndent, TrimStrategy}; use tabled::{ + Table, builder::Builder, grid::{ ansi::ANSIBuf, @@ -19,18 +20,17 @@ use tabled::{ }, dimension::{CompleteDimensionVecRecords, SpannedGridDimension}, records::{ - vec_records::{Cell, Text, VecRecords}, IntoRecords, IterRecords, Records, + vec_records::{Cell, Text, VecRecords}, }, }, settings::{ + Alignment, CellOption, Color, Padding, TableOption, Width, formatting::AlignmentStrategy, object::{Columns, Rows}, themes::ColumnNames, width::Truncate, - Alignment, CellOption, Color, Padding, TableOption, Width, }, - Table, }; use crate::{convert_style, is_color_empty, table_theme::TableTheme}; diff --git a/crates/nu-table/src/types/collapse.rs b/crates/nu-table/src/types/collapse.rs index 4b4ebed172..fcd56fe11b 100644 --- a/crates/nu-table/src/types/collapse.rs +++ b/crates/nu-table/src/types/collapse.rs @@ -4,8 +4,8 @@ use nu_protocol::{Config, Value}; use nu_utils::SharedCow; use crate::{ - common::{get_index_style, load_theme, nu_value_to_string_clean}, StringResult, TableOpts, UnstructuredTable, + common::{get_index_style, load_theme, nu_value_to_string_clean}, }; pub struct CollapsedTable; @@ -36,7 +36,7 @@ fn colorize_value(value: &mut Value, config: &Config, style_computer: &StyleComp // todo: Remove recursion? match value { - Value::Record { ref mut val, .. } => { + Value::Record { val, .. } => { let style = get_index_style(style_computer); // Take ownership of the record and reassign to &mut // We do this to have owned keys through `.into_iter` diff --git a/crates/nu-table/src/types/expanded.rs b/crates/nu-table/src/types/expanded.rs index 61e4b2069b..669a357343 100644 --- a/crates/nu-table/src/types/expanded.rs +++ b/crates/nu-table/src/types/expanded.rs @@ -5,14 +5,14 @@ use nu_engine::column::get_columns; use nu_protocol::{Config, Record, ShellError, Span, Value}; use crate::{ + NuTable, TableOpts, TableOutput, common::{ - check_value, configure_table, error_sign, get_header_style, get_index_style, load_theme, - nu_value_to_string, nu_value_to_string_clean, nu_value_to_string_colored, wrap_text, - NuText, StringResult, TableResult, INDEX_COLUMN_NAME, + INDEX_COLUMN_NAME, NuText, StringResult, TableResult, check_value, configure_table, + error_sign, get_header_style, get_index_style, load_theme, nu_value_to_string, + nu_value_to_string_clean, nu_value_to_string_colored, wrap_text, }, string_width, types::has_index, - NuTable, TableOpts, TableOutput, }; #[derive(Debug, Clone)] diff --git a/crates/nu-table/src/types/general.rs b/crates/nu-table/src/types/general.rs index 403f515370..ebae8660c7 100644 --- a/crates/nu-table/src/types/general.rs +++ b/crates/nu-table/src/types/general.rs @@ -3,13 +3,13 @@ use nu_engine::column::get_columns; use nu_protocol::{Config, Record, ShellError, Value}; use crate::{ - clean_charset, colorize_space, + NuRecordsValue, NuTable, StringResult, TableOpts, TableOutput, TableResult, clean_charset, + colorize_space, common::{ - check_value, configure_table, get_empty_style, get_header_style, get_index_style, - get_value_style, nu_value_to_string_colored, NuText, INDEX_COLUMN_NAME, + INDEX_COLUMN_NAME, NuText, check_value, configure_table, get_empty_style, get_header_style, + get_index_style, get_value_style, nu_value_to_string_colored, }, types::has_index, - NuRecordsValue, NuTable, StringResult, TableOpts, TableOutput, TableResult, }; pub struct JustTable; diff --git a/crates/nu-table/src/types/mod.rs b/crates/nu-table/src/types/mod.rs index 16a1e85796..80ef639c3a 100644 --- a/crates/nu-table/src/types/mod.rs +++ b/crates/nu-table/src/types/mod.rs @@ -1,7 +1,7 @@ use nu_color_config::StyleComputer; use nu_protocol::{Config, Signals, Span, TableIndexMode, TableMode}; -use crate::{common::INDEX_COLUMN_NAME, NuTable}; +use crate::{NuTable, common::INDEX_COLUMN_NAME}; mod collapse; mod expanded; diff --git a/crates/nu-table/src/unstructured_table.rs b/crates/nu-table/src/unstructured_table.rs index 1ce5f164ee..9e5ba4cf1d 100644 --- a/crates/nu-table/src/unstructured_table.rs +++ b/crates/nu-table/src/unstructured_table.rs @@ -11,7 +11,7 @@ use tabled::{ tables::{PoolTable, TableValue}, }; -use crate::{is_color_empty, string_width, string_wrap, TableTheme}; +use crate::{TableTheme, is_color_empty, string_width, string_wrap}; /// UnstructuredTable has a recursive table representation of nu_protocol::Value. /// diff --git a/crates/nu-table/src/util.rs b/crates/nu-table/src/util.rs index 7ae7b61c76..c3d0c1744f 100644 --- a/crates/nu-table/src/util.rs +++ b/crates/nu-table/src/util.rs @@ -7,8 +7,8 @@ use tabled::{ util::string::get_text_width, }, settings::{ - width::{Truncate, Wrap}, Color, + width::{Truncate, Wrap}, }, }; diff --git a/crates/nu-table/tests/common.rs b/crates/nu-table/tests/common.rs index 1215a70ae7..4f207ddbdb 100644 --- a/crates/nu-table/tests/common.rs +++ b/crates/nu-table/tests/common.rs @@ -1,7 +1,7 @@ #![allow(dead_code)] use nu_protocol::TrimStrategy; -use nu_table::{string_width, NuTable, TableTheme}; +use nu_table::{NuTable, TableTheme, string_width}; use tabled::grid::records::vec_records::Text; #[derive(Debug, Clone)] diff --git a/crates/nu-table/tests/constrains.rs b/crates/nu-table/tests/constrains.rs index c0c057acfd..3b16dcf487 100644 --- a/crates/nu-table/tests/constrains.rs +++ b/crates/nu-table/tests/constrains.rs @@ -3,7 +3,7 @@ mod common; use nu_protocol::TrimStrategy; use nu_table::{NuTable, TableTheme as theme}; -use common::{create_row, test_table, TestCase}; +use common::{TestCase, create_row, test_table}; use tabled::grid::records::vec_records::Text; @@ -79,10 +79,30 @@ fn wrap_test() { } let tests = [ - (15, Some("┏━━━━━━━┳━━━━━┓\n┃ 123 4 ┃ ... ┃\n┃ 5678 ┃ ┃\n┣━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━┻━━━━━┛")), - (21, Some("┏━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━┛")), - (29, Some("┏━━━━━━━━━━━┳━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw e ┃ ... ┃\n┃ ┃ qwe ┃ ┃\n┣━━━━━━━━━━━╋━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ ... ┃\n┃ 0 ┃ 1 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━┻━━━━━┛")), - (49, Some("┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw eqwe ┃ xxx xx xx x xx ┃ ... ┃\n┃ ┃ ┃ x xx xx ┃ ┃\n┣━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┻━━━━━┛")), + ( + 15, + Some( + "┏━━━━━━━┳━━━━━┓\n┃ 123 4 ┃ ... ┃\n┃ 5678 ┃ ┃\n┣━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━┻━━━━━┛", + ), + ), + ( + 21, + Some( + "┏━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━┛", + ), + ), + ( + 29, + Some( + "┏━━━━━━━━━━━┳━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw e ┃ ... ┃\n┃ ┃ qwe ┃ ┃\n┣━━━━━━━━━━━╋━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ ... ┃\n┃ 0 ┃ 1 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━┻━━━━━┛", + ), + ), + ( + 49, + Some( + "┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw eqwe ┃ xxx xx xx x xx ┃ ... ┃\n┃ ┃ ┃ x xx xx ┃ ┃\n┣━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┻━━━━━┛", + ), + ), ]; test_trim(&tests, TrimStrategy::wrap(false)); @@ -95,10 +115,30 @@ fn wrap_keep_words_test() { } let tests = [ - (15, Some("┏━━━━━━━┳━━━━━┓\n┃ 123 ┃ ... ┃\n┃ 45678 ┃ ┃\n┣━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━┻━━━━━┛")), - (21, Some("┏━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━┛")), - (29, Some("┏━━━━━━━━━━━┳━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw ┃ ... ┃\n┃ ┃ eqwe ┃ ┃\n┣━━━━━━━━━━━╋━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ ... ┃\n┃ 0 ┃ 1 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━┻━━━━━┛")), - (49, Some("┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw eqwe ┃ xxx xx xx x xx ┃ ... ┃\n┃ ┃ ┃ x xx xx ┃ ┃\n┣━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┻━━━━━┛")), + ( + 15, + Some( + "┏━━━━━━━┳━━━━━┓\n┃ 123 ┃ ... ┃\n┃ 45678 ┃ ┃\n┣━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━┻━━━━━┛", + ), + ), + ( + 21, + Some( + "┏━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━┛", + ), + ), + ( + 29, + Some( + "┏━━━━━━━━━━━┳━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw ┃ ... ┃\n┃ ┃ eqwe ┃ ┃\n┣━━━━━━━━━━━╋━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ ... ┃\n┃ 0 ┃ 1 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━┻━━━━━┛", + ), + ), + ( + 49, + Some( + "┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw eqwe ┃ xxx xx xx x xx ┃ ... ┃\n┃ ┃ ┃ x xx xx ┃ ┃\n┣━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┻━━━━━┛", + ), + ), ]; test_trim(&tests, TrimStrategy::wrap(true)); @@ -111,10 +151,30 @@ fn truncate_test() { } let tests = [ - (15, Some("┏━━━━━━━┳━━━━━┓\n┃ 123 4 ┃ ... ┃\n┣━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━┻━━━━━┛")), - (21, Some("┏━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━┛")), - (29, Some("┏━━━━━━━━━━━┳━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw e ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ ... ┃\n┃ 0 ┃ 1 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━┻━━━━━┛")), - (49, Some("┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw eqwe ┃ xxx xx xx x xx ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┻━━━━━┛")), + ( + 15, + Some( + "┏━━━━━━━┳━━━━━┓\n┃ 123 4 ┃ ... ┃\n┣━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━┻━━━━━┛", + ), + ), + ( + 21, + Some( + "┏━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━┛", + ), + ), + ( + 29, + Some( + "┏━━━━━━━━━━━┳━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw e ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ ... ┃\n┃ 0 ┃ 1 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━┻━━━━━┛", + ), + ), + ( + 49, + Some( + "┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw eqwe ┃ xxx xx xx x xx ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┻━━━━━┛", + ), + ), ]; test_trim(&tests, TrimStrategy::truncate(None)); @@ -127,10 +187,30 @@ fn truncate_with_suffix_test() { } let tests = [ - (15, Some("┏━━━━━━━┳━━━━━┓\n┃ 12... ┃ ... ┃\n┣━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━┻━━━━━┛")), - (21, Some("┏━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━┛")), - (29, Some("┏━━━━━━━━━━━┳━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweq... ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ ... ┃\n┃ 0 ┃ 1 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━┻━━━━━┛")), - (49, Some("┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw eqwe ┃ xxx xx xx x... ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┻━━━━━┛")), + ( + 15, + Some( + "┏━━━━━━━┳━━━━━┓\n┃ 12... ┃ ... ┃\n┣━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━┻━━━━━┛", + ), + ), + ( + 21, + Some( + "┏━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ ... ┃\n┃ 0 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━┛", + ), + ), + ( + 29, + Some( + "┏━━━━━━━━━━━┳━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweq... ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ ... ┃\n┃ 0 ┃ 1 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━┻━━━━━┛", + ), + ), + ( + 49, + Some( + "┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━┓\n┃ 123 45678 ┃ qweqw eqwe ┃ xxx xx xx x... ┃ ... ┃\n┣━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━╋━━━━━┫\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┃ 0 ┃ 1 ┃ 2 ┃ ... ┃\n┗━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┻━━━━━┛", + ), + ), ]; test_trim(&tests, TrimStrategy::truncate(Some(String::from("...")))); @@ -139,18 +219,51 @@ fn truncate_with_suffix_test() { #[test] fn width_control_test_0() { let data = vec![ - vec![common::cell("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); 16], - vec![common::cell("yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"); 16], - vec![common::cell("zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"); 16], + vec![ + common::cell( + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + ); + 16 + ], + vec![ + common::cell( + "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy" + ); + 16 + ], + vec![ + common::cell( + "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" + ); + 16 + ], ]; let tests = [ - (20, "┏━━━━━━━━━━━━┳━━━━━┓\n┃ xxxxxxx... ┃ ... ┃\n┣━━━━━━━━━━━━╋━━━━━┫\n┃ yyyyyyy... ┃ ... ┃\n┃ zzzzzzz... ┃ ... ┃\n┗━━━━━━━━━━━━┻━━━━━┛"), - (119, "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━┓\n┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... ┃ ... ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━┫\n┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy... ┃ ... ┃\n┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz... ┃ ... ┃\n┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━┛"), - (120, "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━┓\n┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... ┃ ... ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━┫\n┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy... ┃ ... ┃\n┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz... ┃ ... ┃\n┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━┛"), - (121, "┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━┓\n┃ xxxxxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ ... ┃\n┣━━━━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━┫\n┃ yyyyyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ ... ┃\n┃ zzzzzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ ... ┃\n┗━━━━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━┛"), - (150, "┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━┓\n┃ xxxxxxxxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ ... ┃\n┣━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━┫\n┃ yyyyyyyyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ ... ┃\n┃ zzzzzzzzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ ... ┃\n┗━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━┛"), - (usize::MAX, "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫\n┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃\n┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃\n┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛"), + ( + 20, + "┏━━━━━━━━━━━━┳━━━━━┓\n┃ xxxxxxx... ┃ ... ┃\n┣━━━━━━━━━━━━╋━━━━━┫\n┃ yyyyyyy... ┃ ... ┃\n┃ zzzzzzz... ┃ ... ┃\n┗━━━━━━━━━━━━┻━━━━━┛", + ), + ( + 119, + "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━┓\n┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... ┃ ... ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━┫\n┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy... ┃ ... ┃\n┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz... ┃ ... ┃\n┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━┛", + ), + ( + 120, + "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━┓\n┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... ┃ ... ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━┫\n┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy... ┃ ... ┃\n┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz... ┃ ... ┃\n┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━┛", + ), + ( + 121, + "┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━┓\n┃ xxxxxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ ... ┃\n┣━━━━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━┫\n┃ yyyyyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ ... ┃\n┃ zzzzzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ ... ┃\n┗━━━━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━┛", + ), + ( + 150, + "┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━┓\n┃ xxxxxxxxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ xxxxxxx... ┃ ... ┃\n┣━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━━━━━━━━╋━━━━━┫\n┃ yyyyyyyyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ yyyyyyy... ┃ ... ┃\n┃ zzzzzzzzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ zzzzzzz... ┃ ... ┃\n┗━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━━┻━━━━━┛", + ), + ( + usize::MAX, + "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫\n┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃ yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy ┃\n┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz ┃\n┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛", + ), ]; test_width(data, &tests); diff --git a/crates/nu-table/tests/expand.rs b/crates/nu-table/tests/expand.rs index bf60f93852..6b25a3a7ac 100644 --- a/crates/nu-table/tests/expand.rs +++ b/crates/nu-table/tests/expand.rs @@ -1,6 +1,6 @@ mod common; -use common::{create_row, create_table, TestCase}; +use common::{TestCase, create_row, create_table}; use nu_table::TableTheme as theme; diff --git a/crates/nu-table/tests/style.rs b/crates/nu-table/tests/style.rs index 9bb57fa676..a8add06017 100644 --- a/crates/nu-table/tests/style.rs +++ b/crates/nu-table/tests/style.rs @@ -1,6 +1,6 @@ mod common; -use common::{create_row as row, TestCase}; +use common::{TestCase, create_row as row}; use nu_table::{NuTable, TableTheme as theme}; use tabled::grid::records::vec_records::Text; diff --git a/crates/nu-term-grid/Cargo.toml b/crates/nu-term-grid/Cargo.toml index 2876fa391e..4959c5a23e 100644 --- a/crates/nu-term-grid/Cargo.toml +++ b/crates/nu-term-grid/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Nushell grid printing" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-term-grid" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-term-grid" version = "0.104.1" @@ -16,4 +16,4 @@ workspace = true [dependencies] nu-utils = { path = "../nu-utils", version = "0.104.1", default-features = false } -unicode-width = { workspace = true } \ No newline at end of file +unicode-width = { workspace = true } diff --git a/crates/nu-term-grid/src/grid.rs b/crates/nu-term-grid/src/grid.rs index f7881a3383..cfbdc307d1 100644 --- a/crates/nu-term-grid/src/grid.rs +++ b/crates/nu-term-grid/src/grid.rs @@ -492,7 +492,7 @@ impl fmt::Display for Display<'_> { s )?; } - (Filling::Text(ref t), _) => { + (Filling::Text(t), _) => { let extra_spaces = self.dimensions.widths[x] - cell.width; write!( f, diff --git a/crates/nu-test-support/Cargo.toml b/crates/nu-test-support/Cargo.toml index a5ea752045..ed2cbc7c83 100644 --- a/crates/nu-test-support/Cargo.toml +++ b/crates/nu-test-support/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Support for writing Nushell tests" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-test-support" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-test-support" version = "0.104.1" @@ -21,4 +21,4 @@ nu-utils = { path = "../nu-utils", version = "0.104.1" } num-format = { workspace = true } which = { workspace = true } -tempfile = { workspace = true } \ No newline at end of file +tempfile = { workspace = true } diff --git a/crates/nu-test-support/src/commands.rs b/crates/nu-test-support/src/commands.rs index 6939c9bc11..3963568d40 100644 --- a/crates/nu-test-support/src/commands.rs +++ b/crates/nu-test-support/src/commands.rs @@ -2,8 +2,8 @@ use std::{ io::Read, process::{Command, Stdio}, sync::{ - atomic::{AtomicBool, Ordering::Relaxed}, Mutex, + atomic::{AtomicBool, Ordering::Relaxed}, }, }; diff --git a/crates/nu-test-support/src/locale_override.rs b/crates/nu-test-support/src/locale_override.rs index f00dd826e9..b267c22bdb 100644 --- a/crates/nu-test-support/src/locale_override.rs +++ b/crates/nu-test-support/src/locale_override.rs @@ -23,17 +23,18 @@ pub fn with_locale_override(locale_string: &str, func: fn() -> T) -> T { .expect("Failed to get mutex lock for locale override"); let saved = std::env::var(LOCALE_OVERRIDE_ENV_VAR).ok(); - std::env::set_var(LOCALE_OVERRIDE_ENV_VAR, locale_string); + unsafe { + std::env::set_var(LOCALE_OVERRIDE_ENV_VAR, locale_string); - let result = std::panic::catch_unwind(func); + let result = std::panic::catch_unwind(func); - if let Some(locale_str) = saved { - std::env::set_var(LOCALE_OVERRIDE_ENV_VAR, locale_str); - } else { - std::env::remove_var(LOCALE_OVERRIDE_ENV_VAR); + if let Some(locale_str) = saved { + std::env::set_var(LOCALE_OVERRIDE_ENV_VAR, locale_str); + } else { + std::env::remove_var(LOCALE_OVERRIDE_ENV_VAR); + } + result } - - result }; result.unwrap_or_else(|err| std::panic::resume_unwind(err)) } diff --git a/crates/nu-test-support/src/macros.rs b/crates/nu-test-support/src/macros.rs index f41c8cbc9d..f165d1656b 100644 --- a/crates/nu-test-support/src/macros.rs +++ b/crates/nu-test-support/src/macros.rs @@ -233,7 +233,7 @@ macro_rules! nu_with_plugins { } -use crate::{Outcome, NATIVE_PATH_ENV_VAR}; +use crate::{NATIVE_PATH_ENV_VAR, Outcome}; use nu_path::{AbsolutePath, AbsolutePathBuf, Path, PathBuf}; use nu_utils::escape_quote_string; use std::{ diff --git a/crates/nu-test-support/src/playground/director.rs b/crates/nu-test-support/src/playground/director.rs index a361342495..78b2871385 100644 --- a/crates/nu-test-support/src/playground/director.rs +++ b/crates/nu-test-support/src/playground/director.rs @@ -1,5 +1,5 @@ -use super::nu_process::*; use super::EnvironmentVariable; +use super::nu_process::*; use std::ffi::OsString; use std::fmt; use std::fmt::Write; diff --git a/crates/nu-test-support/src/playground/play.rs b/crates/nu-test-support/src/playground/play.rs index 5ff1fd5977..4887542dce 100644 --- a/crates/nu-test-support/src/playground/play.rs +++ b/crates/nu-test-support/src/playground/play.rs @@ -1,11 +1,11 @@ use super::Director; use crate::fs::{self, Stub}; -use nu_glob::{glob, Uninterruptible}; +use nu_glob::{Uninterruptible, glob}; #[cfg(not(target_arch = "wasm32"))] use nu_path::Path; use nu_path::{AbsolutePath, AbsolutePathBuf}; use std::str; -use tempfile::{tempdir, TempDir}; +use tempfile::{TempDir, tempdir}; #[derive(Default, Clone, Debug)] pub struct EnvironmentVariable { diff --git a/crates/nu-utils/Cargo.toml b/crates/nu-utils/Cargo.toml index f6530b3535..4b18208258 100644 --- a/crates/nu-utils/Cargo.toml +++ b/crates/nu-utils/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["The Nushell Project Developers"] description = "Nushell utility functions" -edition = "2021" +edition = "2024" license = "MIT" name = "nu-utils" repository = "https://github.com/nushell/nushell/tree/main/crates/nu-utils" @@ -39,4 +39,4 @@ crossterm_winapi = "0.9" nix = { workspace = true, default-features = false, features = ["user", "fs"] } [lints] -workspace = true \ No newline at end of file +workspace = true diff --git a/crates/nu-utils/src/filesystem.rs b/crates/nu-utils/src/filesystem.rs index 4552d73ec3..6766e0cb9b 100644 --- a/crates/nu-utils/src/filesystem.rs +++ b/crates/nu-utils/src/filesystem.rs @@ -1,5 +1,5 @@ #[cfg(unix)] -use nix::unistd::{access, AccessFlags}; +use nix::unistd::{AccessFlags, access}; #[cfg(any(windows, unix))] use std::path::Path; diff --git a/crates/nu-utils/src/flatten_json.rs b/crates/nu-utils/src/flatten_json.rs index 6176f3c18f..58c8b327c4 100644 --- a/crates/nu-utils/src/flatten_json.rs +++ b/crates/nu-utils/src/flatten_json.rs @@ -1,4 +1,4 @@ -use serde_json::{json, Map, Value as SerdeValue}; +use serde_json::{Map, Value as SerdeValue, json}; /// JsonFlattener is the main driver when flattening JSON /// # Examples diff --git a/crates/nu_plugin_custom_values/Cargo.toml b/crates/nu_plugin_custom_values/Cargo.toml index 06d463c32d..d86ef40662 100644 --- a/crates/nu_plugin_custom_values/Cargo.toml +++ b/crates/nu_plugin_custom_values/Cargo.toml @@ -2,7 +2,7 @@ name = "nu_plugin_custom_values" repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_custom_values" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [[bin]] @@ -16,4 +16,4 @@ serde = { workspace = true } typetag = "0.2" [dev-dependencies] -nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.104.1" } \ No newline at end of file +nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.104.1" } diff --git a/crates/nu_plugin_custom_values/src/cool_custom_value.rs b/crates/nu_plugin_custom_values/src/cool_custom_value.rs index a6ee6f4168..634f716717 100644 --- a/crates/nu_plugin_custom_values/src/cool_custom_value.rs +++ b/crates/nu_plugin_custom_values/src/cool_custom_value.rs @@ -1,6 +1,6 @@ use nu_protocol::{ - ast::{self, Math, Operator}, CustomValue, ShellError, Span, Type, Value, + ast::{self, Math, Operator}, }; use serde::{Deserialize, Serialize}; use std::cmp::Ordering; diff --git a/crates/nu_plugin_custom_values/src/drop_check.rs b/crates/nu_plugin_custom_values/src/drop_check.rs index 2881e59ad5..9f71bd774e 100644 --- a/crates/nu_plugin_custom_values/src/drop_check.rs +++ b/crates/nu_plugin_custom_values/src/drop_check.rs @@ -1,7 +1,7 @@ use crate::CustomValuePlugin; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{ - record, Category, CustomValue, LabeledError, ShellError, Signature, Span, SyntaxShape, Value, + Category, CustomValue, LabeledError, ShellError, Signature, Span, SyntaxShape, Value, record, }; use serde::{Deserialize, Serialize}; diff --git a/crates/nu_plugin_custom_values/src/generate.rs b/crates/nu_plugin_custom_values/src/generate.rs index 264208d8ab..3988291c18 100644 --- a/crates/nu_plugin_custom_values/src/generate.rs +++ b/crates/nu_plugin_custom_values/src/generate.rs @@ -1,4 +1,4 @@ -use crate::{cool_custom_value::CoolCustomValue, CustomValuePlugin}; +use crate::{CustomValuePlugin, cool_custom_value::CoolCustomValue}; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{Category, Example, LabeledError, Signature, Span, Value}; diff --git a/crates/nu_plugin_custom_values/src/generate2.rs b/crates/nu_plugin_custom_values/src/generate2.rs index 1aa69d2715..1a70b93601 100644 --- a/crates/nu_plugin_custom_values/src/generate2.rs +++ b/crates/nu_plugin_custom_values/src/generate2.rs @@ -1,4 +1,4 @@ -use crate::{second_custom_value::SecondCustomValue, CustomValuePlugin}; +use crate::{CustomValuePlugin, second_custom_value::SecondCustomValue}; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{Category, Example, LabeledError, Signature, Span, SyntaxShape, Value}; diff --git a/crates/nu_plugin_custom_values/src/handle_get.rs b/crates/nu_plugin_custom_values/src/handle_get.rs index 826248aad3..95a227b2c6 100644 --- a/crates/nu_plugin_custom_values/src/handle_get.rs +++ b/crates/nu_plugin_custom_values/src/handle_get.rs @@ -1,7 +1,7 @@ use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{LabeledError, ShellError, Signature, Type, Value}; -use crate::{handle_custom_value::HandleCustomValue, CustomValuePlugin}; +use crate::{CustomValuePlugin, handle_custom_value::HandleCustomValue}; pub struct HandleGet; diff --git a/crates/nu_plugin_custom_values/src/handle_make.rs b/crates/nu_plugin_custom_values/src/handle_make.rs index e485ad3ced..bf1b9c3cab 100644 --- a/crates/nu_plugin_custom_values/src/handle_make.rs +++ b/crates/nu_plugin_custom_values/src/handle_make.rs @@ -3,7 +3,7 @@ use std::sync::atomic; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{LabeledError, Signature, Type, Value}; -use crate::{handle_custom_value::HandleCustomValue, CustomValuePlugin}; +use crate::{CustomValuePlugin, handle_custom_value::HandleCustomValue}; pub struct HandleMake; diff --git a/crates/nu_plugin_custom_values/src/handle_update.rs b/crates/nu_plugin_custom_values/src/handle_update.rs index 230522732a..6a4a0245ee 100644 --- a/crates/nu_plugin_custom_values/src/handle_update.rs +++ b/crates/nu_plugin_custom_values/src/handle_update.rs @@ -2,10 +2,10 @@ use std::sync::atomic; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{ - engine::Closure, LabeledError, ShellError, Signature, Spanned, SyntaxShape, Type, Value, + LabeledError, ShellError, Signature, Spanned, SyntaxShape, Type, Value, engine::Closure, }; -use crate::{handle_custom_value::HandleCustomValue, CustomValuePlugin}; +use crate::{CustomValuePlugin, handle_custom_value::HandleCustomValue}; pub struct HandleUpdate; diff --git a/crates/nu_plugin_custom_values/src/main.rs b/crates/nu_plugin_custom_values/src/main.rs index 65cc0b500f..3455673e77 100644 --- a/crates/nu_plugin_custom_values/src/main.rs +++ b/crates/nu_plugin_custom_values/src/main.rs @@ -1,10 +1,10 @@ use std::{ collections::BTreeMap, - sync::{atomic::AtomicU64, Mutex}, + sync::{Mutex, atomic::AtomicU64}, }; use handle_custom_value::HandleCustomValue; -use nu_plugin::{serve_plugin, EngineInterface, MsgPackSerializer, Plugin, PluginCommand}; +use nu_plugin::{EngineInterface, MsgPackSerializer, Plugin, PluginCommand, serve_plugin}; mod cool_custom_value; mod handle_custom_value; diff --git a/crates/nu_plugin_custom_values/src/update.rs b/crates/nu_plugin_custom_values/src/update.rs index 41d9c9a6f7..18f621ae9f 100644 --- a/crates/nu_plugin_custom_values/src/update.rs +++ b/crates/nu_plugin_custom_values/src/update.rs @@ -1,5 +1,5 @@ use crate::{ - cool_custom_value::CoolCustomValue, second_custom_value::SecondCustomValue, CustomValuePlugin, + CustomValuePlugin, cool_custom_value::CoolCustomValue, second_custom_value::SecondCustomValue, }; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{Category, Example, LabeledError, ShellError, Signature, Span, Value}; diff --git a/crates/nu_plugin_custom_values/src/update_arg.rs b/crates/nu_plugin_custom_values/src/update_arg.rs index bac07e150a..7ea22e9b17 100644 --- a/crates/nu_plugin_custom_values/src/update_arg.rs +++ b/crates/nu_plugin_custom_values/src/update_arg.rs @@ -1,4 +1,4 @@ -use crate::{update::Update, CustomValuePlugin}; +use crate::{CustomValuePlugin, update::Update}; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{Category, LabeledError, Signature, SyntaxShape, Value}; diff --git a/crates/nu_plugin_example/Cargo.toml b/crates/nu_plugin_example/Cargo.toml index ea9076c4ef..b0e8af8817 100644 --- a/crates/nu_plugin_example/Cargo.toml +++ b/crates/nu_plugin_example/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "A version incrementer plugin for Nushell" repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_example" -edition = "2021" +edition = "2024" license = "MIT" name = "nu_plugin_example" version = "0.104.1" @@ -20,4 +20,4 @@ nu-protocol = { path = "../nu-protocol", version = "0.104.1", features = ["plugi [dev-dependencies] nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.104.1" } -nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.104.1" } \ No newline at end of file +nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.104.1" } diff --git a/crates/nu_plugin_example/src/commands/sum.rs b/crates/nu_plugin_example/src/commands/sum.rs index afa46e1f62..c4d4af53d0 100644 --- a/crates/nu_plugin_example/src/commands/sum.rs +++ b/crates/nu_plugin_example/src/commands/sum.rs @@ -72,10 +72,10 @@ enum IntOrFloat { impl IntOrFloat { pub(crate) fn add_i64(&mut self, n: i64) { match self { - IntOrFloat::Int(ref mut v) => { + IntOrFloat::Int(v) => { *v += n; } - IntOrFloat::Float(ref mut v) => { + IntOrFloat::Float(v) => { *v += n as f64; } } @@ -86,7 +86,7 @@ impl IntOrFloat { IntOrFloat::Int(v) => { *self = IntOrFloat::Float(*v as f64 + n); } - IntOrFloat::Float(ref mut v) => { + IntOrFloat::Float(v) => { *v += n; } } diff --git a/crates/nu_plugin_example/src/main.rs b/crates/nu_plugin_example/src/main.rs index 27b6f8e672..615aa49517 100644 --- a/crates/nu_plugin_example/src/main.rs +++ b/crates/nu_plugin_example/src/main.rs @@ -1,4 +1,4 @@ -use nu_plugin::{serve_plugin, MsgPackSerializer}; +use nu_plugin::{MsgPackSerializer, serve_plugin}; use nu_plugin_example::ExamplePlugin; fn main() { diff --git a/crates/nu_plugin_formats/Cargo.toml b/crates/nu_plugin_formats/Cargo.toml index 1b83ace260..1f36b214af 100644 --- a/crates/nu_plugin_formats/Cargo.toml +++ b/crates/nu_plugin_formats/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "An I/O plugin for a set of file formats for Nushell" repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_formats" -edition = "2021" +edition = "2024" license = "MIT" name = "nu_plugin_formats" version = "0.104.1" @@ -20,4 +20,4 @@ plist = "1.7" chrono = "0.4" [dev-dependencies] -nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.104.1" } \ No newline at end of file +nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.104.1" } diff --git a/crates/nu_plugin_formats/src/from/eml.rs b/crates/nu_plugin_formats/src/from/eml.rs index 5d6324e1eb..6f9bbe2865 100644 --- a/crates/nu_plugin_formats/src/from/eml.rs +++ b/crates/nu_plugin_formats/src/from/eml.rs @@ -1,10 +1,10 @@ use crate::FormatCmdsPlugin; -use eml_parser::eml::*; use eml_parser::EmlParser; +use eml_parser::eml::*; use indexmap::IndexMap; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, ShellError, Signature, Span, SyntaxShape, Type, Value, + Category, Example, LabeledError, ShellError, Signature, Span, SyntaxShape, Type, Value, record, }; const DEFAULT_BODY_PREVIEW: usize = 50; diff --git a/crates/nu_plugin_formats/src/from/ics.rs b/crates/nu_plugin_formats/src/from/ics.rs index 482807ba29..f136c750b5 100644 --- a/crates/nu_plugin_formats/src/from/ics.rs +++ b/crates/nu_plugin_formats/src/from/ics.rs @@ -4,7 +4,7 @@ use ical::{parser::ical::component::*, property::Property}; use indexmap::IndexMap; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, ShellError, Signature, Span, Type, Value, + Category, Example, LabeledError, ShellError, Signature, Span, Type, Value, record, }; use std::io::BufReader; diff --git a/crates/nu_plugin_formats/src/from/ini.rs b/crates/nu_plugin_formats/src/from/ini.rs index ec1168f6f6..6bd6263a38 100644 --- a/crates/nu_plugin_formats/src/from/ini.rs +++ b/crates/nu_plugin_formats/src/from/ini.rs @@ -2,7 +2,7 @@ use crate::FormatCmdsPlugin; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, Record, ShellError, Signature, Type, Value, + Category, Example, LabeledError, Record, ShellError, Signature, Type, Value, record, }; pub struct FromIni; diff --git a/crates/nu_plugin_formats/src/from/plist.rs b/crates/nu_plugin_formats/src/from/plist.rs index 113714e4c4..2e56c497eb 100644 --- a/crates/nu_plugin_formats/src/from/plist.rs +++ b/crates/nu_plugin_formats/src/from/plist.rs @@ -3,7 +3,7 @@ use std::time::SystemTime; use chrono::{DateTime, FixedOffset, Offset, Utc}; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand, SimplePluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, Record, Signature, Span, Value as NuValue, + Category, Example, LabeledError, Record, Signature, Span, Value as NuValue, record, }; use plist::{Date as PlistDate, Dictionary, Value as PlistValue}; diff --git a/crates/nu_plugin_formats/src/from/vcf.rs b/crates/nu_plugin_formats/src/from/vcf.rs index 9bf99e02af..2fda936243 100644 --- a/crates/nu_plugin_formats/src/from/vcf.rs +++ b/crates/nu_plugin_formats/src/from/vcf.rs @@ -4,7 +4,7 @@ use ical::{parser::vcard::component::*, property::Property}; use indexmap::IndexMap; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, ShellError, Signature, Span, Type, Value, + Category, Example, LabeledError, ShellError, Signature, Span, Type, Value, record, }; pub struct FromVcf; diff --git a/crates/nu_plugin_formats/src/main.rs b/crates/nu_plugin_formats/src/main.rs index f36ba3364a..ccf0e986bc 100644 --- a/crates/nu_plugin_formats/src/main.rs +++ b/crates/nu_plugin_formats/src/main.rs @@ -1,4 +1,4 @@ -use nu_plugin::{serve_plugin, MsgPackSerializer}; +use nu_plugin::{MsgPackSerializer, serve_plugin}; use nu_plugin_formats::FormatCmdsPlugin; fn main() { diff --git a/crates/nu_plugin_gstat/Cargo.toml b/crates/nu_plugin_gstat/Cargo.toml index 1381904053..5f289aab49 100644 --- a/crates/nu_plugin_gstat/Cargo.toml +++ b/crates/nu_plugin_gstat/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "A git status plugin for Nushell" repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_gstat" -edition = "2021" +edition = "2024" license = "MIT" name = "nu_plugin_gstat" version = "0.104.1" @@ -19,4 +19,4 @@ bench = false nu-plugin = { path = "../nu-plugin", version = "0.104.1" } nu-protocol = { path = "../nu-protocol", version = "0.104.1" } -git2 = "0.20" \ No newline at end of file +git2 = "0.20" diff --git a/crates/nu_plugin_gstat/src/gstat.rs b/crates/nu_plugin_gstat/src/gstat.rs index 5c1ab0e248..92c2bc45ed 100644 --- a/crates/nu_plugin_gstat/src/gstat.rs +++ b/crates/nu_plugin_gstat/src/gstat.rs @@ -1,5 +1,5 @@ use git2::{Branch, BranchType, DescribeOptions, Repository}; -use nu_protocol::{record, IntoSpanned, LabeledError, Span, Spanned, Value}; +use nu_protocol::{IntoSpanned, LabeledError, Span, Spanned, Value, record}; use std::{fmt::Write, ops::BitAnd, path::Path}; // git status diff --git a/crates/nu_plugin_gstat/src/main.rs b/crates/nu_plugin_gstat/src/main.rs index fe1ad625c0..e567fb8bd5 100644 --- a/crates/nu_plugin_gstat/src/main.rs +++ b/crates/nu_plugin_gstat/src/main.rs @@ -1,4 +1,4 @@ -use nu_plugin::{serve_plugin, MsgPackSerializer}; +use nu_plugin::{MsgPackSerializer, serve_plugin}; use nu_plugin_gstat::GStatPlugin; fn main() { diff --git a/crates/nu_plugin_inc/Cargo.toml b/crates/nu_plugin_inc/Cargo.toml index 724fbe74be..1acf3c0b14 100644 --- a/crates/nu_plugin_inc/Cargo.toml +++ b/crates/nu_plugin_inc/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "A version incrementer plugin for Nushell" repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_inc" -edition = "2021" +edition = "2024" license = "MIT" name = "nu_plugin_inc" version = "0.104.1" @@ -19,4 +19,4 @@ bench = false nu-plugin = { path = "../nu-plugin", version = "0.104.1" } nu-protocol = { path = "../nu-protocol", version = "0.104.1", features = ["plugin"] } -semver = "1.0" \ No newline at end of file +semver = "1.0" diff --git a/crates/nu_plugin_inc/src/inc.rs b/crates/nu_plugin_inc/src/inc.rs index c479cd4457..78f02431ad 100644 --- a/crates/nu_plugin_inc/src/inc.rs +++ b/crates/nu_plugin_inc/src/inc.rs @@ -1,4 +1,4 @@ -use nu_protocol::{ast::CellPath, LabeledError, Span, Value}; +use nu_protocol::{LabeledError, Span, Value, ast::CellPath}; use semver::{BuildMetadata, Prerelease, Version}; #[derive(Debug, Eq, PartialEq, Clone, Copy)] @@ -126,8 +126,8 @@ mod tests { mod semver { use nu_protocol::{Span, Value}; - use crate::inc::SemVerAction; use crate::Inc; + use crate::inc::SemVerAction; #[test] fn major() { diff --git a/crates/nu_plugin_inc/src/main.rs b/crates/nu_plugin_inc/src/main.rs index 4b8719dbc7..688d6af3f7 100644 --- a/crates/nu_plugin_inc/src/main.rs +++ b/crates/nu_plugin_inc/src/main.rs @@ -1,4 +1,4 @@ -use nu_plugin::{serve_plugin, JsonSerializer}; +use nu_plugin::{JsonSerializer, serve_plugin}; use nu_plugin_inc::IncPlugin; fn main() { diff --git a/crates/nu_plugin_inc/src/nu/mod.rs b/crates/nu_plugin_inc/src/nu/mod.rs index 82a5fa978e..7097a2db78 100644 --- a/crates/nu_plugin_inc/src/nu/mod.rs +++ b/crates/nu_plugin_inc/src/nu/mod.rs @@ -1,6 +1,6 @@ -use crate::{inc::SemVerAction, Inc}; +use crate::{Inc, inc::SemVerAction}; use nu_plugin::{EngineInterface, EvaluatedCall, Plugin, PluginCommand, SimplePluginCommand}; -use nu_protocol::{ast::CellPath, LabeledError, Signature, SyntaxShape, Value}; +use nu_protocol::{LabeledError, Signature, SyntaxShape, Value, ast::CellPath}; pub struct IncPlugin; diff --git a/crates/nu_plugin_polars/Cargo.toml b/crates/nu_plugin_polars/Cargo.toml index fdf12f902a..af45e031f4 100644 --- a/crates/nu_plugin_polars/Cargo.toml +++ b/crates/nu_plugin_polars/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["The Nushell Project Developers"] description = "Nushell dataframe plugin commands based on polars." -edition = "2021" +edition = "2024" license = "MIT" name = "nu_plugin_polars" repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_polars" diff --git a/crates/nu_plugin_polars/src/cache/get.rs b/crates/nu_plugin_polars/src/cache/get.rs index b034b38c3f..bb948d2cfb 100644 --- a/crates/nu_plugin_polars/src/cache/get.rs +++ b/crates/nu_plugin_polars/src/cache/get.rs @@ -7,8 +7,8 @@ use polars::{prelude::NamedFrom, series::Series}; use uuid::Uuid; use crate::{ - values::{CustomValueSupport, NuDataFrame}, PolarsPlugin, + values::{CustomValueSupport, NuDataFrame}, }; #[derive(Clone)] diff --git a/crates/nu_plugin_polars/src/cache/list.rs b/crates/nu_plugin_polars/src/cache/list.rs index fc599dedd7..02af95a126 100644 --- a/crates/nu_plugin_polars/src/cache/list.rs +++ b/crates/nu_plugin_polars/src/cache/list.rs @@ -1,9 +1,9 @@ use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ - record, Category, Example, IntoPipelineData, LabeledError, PipelineData, Signature, Value, + Category, Example, IntoPipelineData, LabeledError, PipelineData, Signature, Value, record, }; -use crate::{values::PolarsPluginObject, PolarsPlugin}; +use crate::{PolarsPlugin, values::PolarsPluginObject}; #[derive(Clone)] pub struct ListDF; diff --git a/crates/nu_plugin_polars/src/cache/mod.rs b/crates/nu_plugin_polars/src/cache/mod.rs index 49a76927e5..b5c959e2d0 100644 --- a/crates/nu_plugin_polars/src/cache/mod.rs +++ b/crates/nu_plugin_polars/src/cache/mod.rs @@ -13,7 +13,7 @@ use nu_plugin::{EngineInterface, PluginCommand}; use nu_protocol::{LabeledError, ShellError, Span}; use uuid::Uuid; -use crate::{values::PolarsPluginObject, EngineWrapper, PolarsPlugin}; +use crate::{EngineWrapper, PolarsPlugin, values::PolarsPluginObject}; use log::debug; diff --git a/crates/nu_plugin_polars/src/cloud/aws.rs b/crates/nu_plugin_polars/src/cloud/aws.rs index 09bd2f609e..8de822b077 100644 --- a/crates/nu_plugin_polars/src/cloud/aws.rs +++ b/crates/nu_plugin_polars/src/cloud/aws.rs @@ -1,7 +1,7 @@ use std::error::Error; use aws_config::{BehaviorVersion, SdkConfig}; -use aws_credential_types::{provider::ProvideCredentials, Credentials}; +use aws_credential_types::{Credentials, provider::ProvideCredentials}; use nu_protocol::ShellError; use object_store::aws::AmazonS3ConfigKey; use polars_io::cloud::CloudOptions; diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/agg_groups.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/agg_groups.rs index a8d58bd6f0..ce3d916e35 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/agg_groups.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/agg_groups.rs @@ -1,8 +1,8 @@ +use crate::PolarsPlugin; use crate::dataframe::values::NuExpression; use crate::values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, PolarsPluginObject, PolarsPluginType, + CustomValueSupport, NuDataFrame, PolarsPluginObject, PolarsPluginType, cant_convert_err, }; -use crate::PolarsPlugin; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/aggregate.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/aggregate.rs index 64ff8952c5..0692bbe1c4 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/aggregate.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/aggregate.rs @@ -1,7 +1,7 @@ use crate::{ + PolarsPlugin, dataframe::values::{NuExpression, NuLazyFrame, NuLazyGroupBy}, values::{Column, CustomValueSupport, NuDataFrame}, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/count.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/count.rs index 3b1b32952b..97b7ebaef9 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/count.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/count.rs @@ -1,8 +1,8 @@ +use crate::PolarsPlugin; use crate::dataframe::values::NuExpression; use crate::values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, PolarsPluginObject, PolarsPluginType, + CustomValueSupport, NuDataFrame, PolarsPluginObject, PolarsPluginType, cant_convert_err, }; -use crate::PolarsPlugin; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/cumulative.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/cumulative.rs index 77ffa7cc96..c9fe221347 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/cumulative.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/cumulative.rs @@ -1,7 +1,7 @@ -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use crate::values::{ - cant_convert_err, Column, NuDataFrame, NuExpression, PolarsPluginObject, PolarsPluginType, + Column, NuDataFrame, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/groupby.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/groupby.rs index 8a98864655..defdcb6402 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/groupby.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/groupby.rs @@ -1,7 +1,7 @@ use crate::{ + PolarsPlugin, dataframe::values::{NuDataFrame, NuExpression, NuLazyFrame, NuLazyGroupBy}, values::CustomValueSupport, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/horizontal.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/horizontal.rs index 7cf077992b..08b5700013 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/horizontal.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/horizontal.rs @@ -1,6 +1,6 @@ use crate::{ - values::{Column, CustomValueSupport, NuDataFrame, NuExpression}, PolarsPlugin, + values::{Column, CustomValueSupport, NuDataFrame, NuExpression}, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/implode.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/implode.rs index c46dd6f7a8..2c5bd1f0e5 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/implode.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/implode.rs @@ -1,8 +1,8 @@ +use crate::PolarsPlugin; use crate::dataframe::values::NuExpression; use crate::values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, PolarsPluginObject, PolarsPluginType, + CustomValueSupport, NuDataFrame, PolarsPluginObject, PolarsPluginType, cant_convert_err, }; -use crate::PolarsPlugin; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, @@ -37,11 +37,14 @@ impl PluginCommand for ExprImplode { description: "Create two lists for columns a and b with all the rows as values.", example: "[[a b]; [1 4] [2 5] [3 6]] | polars into-df | polars select (polars col '*' | polars implode) | polars collect", result: Some( - NuDataFrame::from(df!( - "a"=> [[1i64, 2, 3].iter().collect::()], - "b"=> [[4i64, 5, 6].iter().collect::()], - ).expect("should not fail")) - .into_value(Span::unknown()) + NuDataFrame::from( + df!( + "a"=> [[1i64, 2, 3].iter().collect::()], + "b"=> [[4i64, 5, 6].iter().collect::()], + ) + .expect("should not fail"), + ) + .into_value(Span::unknown()), ), }] } diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/max.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/max.rs index d75ea65ede..cf0380530c 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/max.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/max.rs @@ -1,9 +1,9 @@ +use crate::PolarsPlugin; use crate::dataframe::values::NuExpression; use crate::values::{ - cant_convert_err, Column, CustomValueSupport, NuDataFrame, NuLazyFrame, PolarsPluginObject, - PolarsPluginType, + Column, CustomValueSupport, NuDataFrame, NuLazyFrame, PolarsPluginObject, PolarsPluginType, + cant_convert_err, }; -use crate::PolarsPlugin; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, Value, diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/mean.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/mean.rs index 1dab512020..8b848d9a1f 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/mean.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/mean.rs @@ -1,9 +1,9 @@ +use crate::PolarsPlugin; use crate::dataframe::values::NuExpression; use crate::values::{ - cant_convert_err, Column, CustomValueSupport, NuDataFrame, NuLazyFrame, PolarsPluginObject, - PolarsPluginType, + Column, CustomValueSupport, NuDataFrame, NuLazyFrame, PolarsPluginObject, PolarsPluginType, + cant_convert_err, }; -use crate::PolarsPlugin; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, Value, diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/median.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/median.rs index e4beadecca..bd9833bd10 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/median.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/median.rs @@ -1,9 +1,9 @@ use crate::{ + PolarsPlugin, dataframe::values::{Column, NuDataFrame, NuLazyFrame}, values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, }, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ @@ -68,8 +68,7 @@ impl PluginCommand for LazyMedian { }, Example { description: "Median value from columns in a dataframe", - example: - "[[a b]; [6 2] [4 2] [2 2]] | polars into-df | polars median | polars collect", + example: "[[a b]; [6 2] [4 2] [2 2]] | polars into-df | polars median | polars collect", result: Some( NuDataFrame::try_from_columns( vec![ diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/min.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/min.rs index 750099d32f..be6456e381 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/min.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/min.rs @@ -1,9 +1,9 @@ +use crate::PolarsPlugin; use crate::dataframe::values::NuExpression; use crate::values::{ - cant_convert_err, Column, CustomValueSupport, NuDataFrame, NuLazyFrame, PolarsPluginObject, - PolarsPluginType, + Column, CustomValueSupport, NuDataFrame, NuLazyFrame, PolarsPluginObject, PolarsPluginType, + cant_convert_err, }; -use crate::PolarsPlugin; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, Value, diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/n_null.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/n_null.rs index 61507d9d69..4e69d9cdf0 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/n_null.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/n_null.rs @@ -1,4 +1,4 @@ -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use crate::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/n_unique.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/n_unique.rs index 3c696ee371..d9be7a405a 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/n_unique.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/n_unique.rs @@ -1,6 +1,6 @@ use crate::{ - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, PolarsPlugin, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use crate::values::{Column, NuDataFrame, NuExpression}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/over.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/over.rs index 5bcdd7558f..4aaba37004 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/over.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/over.rs @@ -1,7 +1,7 @@ use crate::{ - dataframe::values::{NuDataFrame, NuExpression}, - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, PolarsPlugin, + dataframe::values::{NuDataFrame, NuExpression}, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/quantile.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/quantile.rs index e2572012cb..7594afad1f 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/quantile.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/quantile.rs @@ -1,16 +1,16 @@ use crate::{ + PolarsPlugin, dataframe::values::{Column, NuDataFrame, NuLazyFrame}, values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, }, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value, }; -use polars::prelude::{lit, QuantileMethod}; +use polars::prelude::{QuantileMethod, lit}; #[derive(Clone)] pub struct LazyQuantile; diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/rolling.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/rolling.rs index 70bfaee8b5..17682d08db 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/rolling.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/rolling.rs @@ -1,5 +1,5 @@ use crate::values::{Column, NuDataFrame}; -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/std.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/std.rs index 46411d1b0d..575d624a63 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/std.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/std.rs @@ -1,7 +1,7 @@ -use crate::values::{ - cant_convert_err, Column, CustomValueSupport, NuLazyFrame, PolarsPluginObject, PolarsPluginType, -}; use crate::PolarsPlugin; +use crate::values::{ + Column, CustomValueSupport, NuLazyFrame, PolarsPluginObject, PolarsPluginType, cant_convert_err, +}; use crate::{dataframe::values::NuExpression, values::NuDataFrame}; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ @@ -41,8 +41,7 @@ impl PluginCommand for ExprStd { vec![ Example { description: "Std value from columns in a dataframe", - example: - "[[a b]; [6 2] [4 2] [2 2]] | polars into-df | polars std | polars collect", + example: "[[a b]; [6 2] [4 2] [2 2]] | polars into-df | polars std | polars collect", result: Some( NuDataFrame::try_from_columns( vec![ diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/sum.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/sum.rs index 6aaf3320fe..e04057d48f 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/sum.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/sum.rs @@ -1,9 +1,9 @@ +use crate::PolarsPlugin; use crate::dataframe::values::NuExpression; use crate::values::{ - cant_convert_err, Column, CustomValueSupport, NuDataFrame, NuLazyFrame, PolarsPluginObject, - PolarsPluginType, + Column, CustomValueSupport, NuDataFrame, NuLazyFrame, PolarsPluginObject, PolarsPluginType, + cant_convert_err, }; -use crate::PolarsPlugin; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, Value, @@ -41,8 +41,7 @@ impl PluginCommand for ExprSum { vec![ Example { description: "Sums all columns in a dataframe", - example: - "[[a b]; [6 2] [1 4] [4 1]] | polars into-df | polars sum | polars collect", + example: "[[a b]; [6 2] [1 4] [4 1]] | polars into-df | polars sum | polars collect", result: Some( NuDataFrame::try_from_columns( vec![ diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/value_counts.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/value_counts.rs index 57f7f3381a..429eaf6b9b 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/value_counts.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/value_counts.rs @@ -1,5 +1,5 @@ -use crate::values::{CustomValueSupport, NuDataFrame}; use crate::PolarsPlugin; +use crate::values::{CustomValueSupport, NuDataFrame}; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/var.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/var.rs index bc1ee8ed04..9facb40c5d 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/var.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/var.rs @@ -1,9 +1,9 @@ +use crate::PolarsPlugin; use crate::dataframe::values::NuExpression; use crate::values::{ - cant_convert_err, Column, CustomValueSupport, NuDataFrame, NuLazyFrame, PolarsPluginObject, - PolarsPluginType, + Column, CustomValueSupport, NuDataFrame, NuLazyFrame, PolarsPluginObject, PolarsPluginType, + cant_convert_err, }; -use crate::PolarsPlugin; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, Value, @@ -41,10 +41,8 @@ impl PluginCommand for ExprVar { fn examples(&self) -> Vec { vec![ Example { - description: - "Var value from columns in a dataframe or aggregates columns to their var value", - example: - "[[a b]; [6 2] [4 2] [2 2]] | polars into-df | polars var | polars collect", + description: "Var value from columns in a dataframe or aggregates columns to their var value", + example: "[[a b]; [6 2] [4 2] [2 2]] | polars into-df | polars var | polars collect", result: Some( NuDataFrame::try_from_columns( vec![ diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/all_false.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/all_false.rs index f5cc7acf11..233d4abd63 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/all_false.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/all_false.rs @@ -1,5 +1,5 @@ -use crate::values::{Column, CustomValueSupport, NuDataFrame}; use crate::PolarsPlugin; +use crate::values::{Column, CustomValueSupport, NuDataFrame}; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/all_true.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/all_true.rs index bcca2f1562..297439dfa6 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/all_true.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/all_true.rs @@ -1,5 +1,5 @@ -use crate::values::{Column, CustomValueSupport, NuDataFrame}; use crate::PolarsPlugin; +use crate::values::{Column, CustomValueSupport, NuDataFrame}; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/arg_true.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/arg_true.rs index 5ce1152bf4..f602757b31 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/arg_true.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/arg_true.rs @@ -1,4 +1,4 @@ -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use super::super::super::values::{Column, NuDataFrame}; @@ -6,7 +6,7 @@ use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, Value, }; -use polars::prelude::{arg_where, col, IntoLazy}; +use polars::prelude::{IntoLazy, arg_where, col}; #[derive(Clone)] pub struct ArgTrue; diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/expr_not.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/expr_not.rs index c70d921e32..25bf6bdeb6 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/expr_not.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/expr_not.rs @@ -1,8 +1,8 @@ +use crate::PolarsPlugin; use crate::dataframe::values::NuExpression; use crate::values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, PolarsPluginObject, PolarsPluginType, + CustomValueSupport, NuDataFrame, PolarsPluginObject, PolarsPluginType, cant_convert_err, }; -use crate::PolarsPlugin; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/is_duplicated.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/is_duplicated.rs index c482b58aab..f0b08f288c 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/is_duplicated.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/is_duplicated.rs @@ -1,4 +1,4 @@ -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use super::super::super::values::{Column, NuDataFrame}; @@ -58,8 +58,7 @@ impl PluginCommand for IsDuplicated { }, Example { description: "Create mask indicating duplicated rows in a dataframe", - example: - "[[a, b]; [1 2] [1 2] [3 3] [3 3] [1 1]] | polars into-df | polars is-duplicated", + example: "[[a, b]; [1 2] [1 2] [3 3] [3 3] [1 1]] | polars into-df | polars is-duplicated", result: Some( NuDataFrame::try_from_columns( vec![Column::new( diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/is_in.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/is_in.rs index 7400c48bc9..d7bb912278 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/is_in.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/is_in.rs @@ -1,14 +1,14 @@ use crate::{ - dataframe::values::{Column, NuDataFrame, NuExpression}, - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, PolarsPlugin, + dataframe::values::{Column, NuDataFrame, NuExpression}, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value, }; -use polars::prelude::{is_in, lit, DataType, IntoSeries}; +use polars::prelude::{DataType, IntoSeries, is_in, lit}; #[derive(Clone)] pub struct ExprIsIn; diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/is_not_null.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/is_not_null.rs index b14602b9e1..49a351ff20 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/is_not_null.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/is_not_null.rs @@ -1,6 +1,6 @@ use crate::{ - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, PolarsPlugin, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use super::super::super::values::{Column, NuDataFrame, NuExpression}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/is_null.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/is_null.rs index 4eaf2643a2..5acf8f2f44 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/is_null.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/is_null.rs @@ -1,8 +1,8 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, + }, }; use super::super::super::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/is_unique.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/is_unique.rs index f0aa293a34..5a6f4322eb 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/is_unique.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/is_unique.rs @@ -1,4 +1,4 @@ -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use super::super::super::values::{Column, NuDataFrame}; @@ -58,8 +58,7 @@ impl PluginCommand for IsUnique { }, Example { description: "Create mask indicating duplicated rows in a dataframe", - example: - "[[a, b]; [1 2] [1 2] [3 3] [3 3] [1 1]] | polars into-df | polars is-unique", + example: "[[a, b]; [1 2] [1 2] [3 3] [3 3] [1 1]] | polars into-df | polars is-unique", result: Some( NuDataFrame::try_from_columns( vec![Column::new( diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/not.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/not.rs index 2759e117fa..35f9ca2bcb 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/not.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/not.rs @@ -1,4 +1,4 @@ -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use super::super::super::values::{Column, NuDataFrame}; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/otherwise.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/otherwise.rs index 5524205867..aeddcf5d88 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/otherwise.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/otherwise.rs @@ -1,7 +1,7 @@ use crate::{ + PolarsPlugin, dataframe::values::{Column, NuDataFrame, NuExpression, NuWhen, NuWhenType}, values::CustomValueSupport, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ @@ -41,8 +41,7 @@ impl PluginCommand for ExprOtherwise { }, Example { description: "Create a when conditions", - example: - "polars when ((polars col a) > 2) 4 | polars when ((polars col a) < 0) 6 | polars otherwise 0", + example: "polars when ((polars col a) > 2) 4 | polars when ((polars col a) < 0) 6 | polars otherwise 0", result: None, }, Example { diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/set.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/set.rs index 28d6be0ce2..c1e347381d 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/set.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/set.rs @@ -1,4 +1,4 @@ -use crate::{missing_flag_error, values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, missing_flag_error, values::CustomValueSupport}; use super::super::super::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/when.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/when.rs index e6c70ec73d..a38c5f8cdb 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/when.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/when.rs @@ -1,7 +1,7 @@ use crate::{ + PolarsPlugin, dataframe::values::{Column, NuDataFrame, NuExpression, NuWhen}, values::{CustomValueSupport, NuWhenType}, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/cache.rs b/crates/nu_plugin_polars/src/dataframe/command/core/cache.rs index 23c972654e..d12c3d2776 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/cache.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/cache.rs @@ -3,8 +3,8 @@ use nu_protocol::{Category, Example, LabeledError, PipelineData, Signature, Span use polars::df; use crate::{ - values::{CustomValueSupport, NuDataFrame, NuLazyFrame}, PolarsPlugin, + values::{CustomValueSupport, NuDataFrame, NuLazyFrame}, }; pub struct LazyCache; diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/columns.rs b/crates/nu_plugin_polars/src/dataframe/command/core/columns.rs index 9ece088c1c..5a89cfaed1 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/columns.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/columns.rs @@ -1,5 +1,5 @@ -use crate::values::NuDataFrame; use crate::PolarsPlugin; +use crate::values::NuDataFrame; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/fetch.rs b/crates/nu_plugin_polars/src/dataframe/command/core/fetch.rs index 48df365335..cd52f16dfc 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/fetch.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/fetch.rs @@ -1,6 +1,6 @@ +use crate::PolarsPlugin; use crate::dataframe::values::{Column, NuDataFrame}; use crate::values::{CustomValueSupport, NuLazyFrame}; -use crate::PolarsPlugin; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/open.rs b/crates/nu_plugin_polars/src/dataframe/command/core/open.rs index f01fc76824..fe55836624 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/open.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/open.rs @@ -1,16 +1,16 @@ use crate::{ + EngineWrapper, PolarsPlugin, command::core::resource::Resource, dataframe::values::NuSchema, values::{CustomValueSupport, NuDataFrame, NuLazyFrame, PolarsFileType}, - EngineWrapper, PolarsPlugin, }; use log::debug; use nu_utils::perf; use nu_plugin::{EvaluatedCall, PluginCommand}; use nu_protocol::{ - shell_error::io::IoError, Category, Example, LabeledError, PipelineData, ShellError, Signature, - Span, Spanned, SyntaxShape, Type, Value, + Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Spanned, + SyntaxShape, Type, Value, shell_error::io::IoError, }; use std::{fs::File, io::BufReader, num::NonZeroUsize, path::PathBuf, sync::Arc}; @@ -23,7 +23,7 @@ use polars::{ }, }; -use polars_io::{avro::AvroReader, csv::read::CsvReadOptions, HiveOptions}; +use polars_io::{HiveOptions, avro::AvroReader, csv::read::CsvReadOptions}; const DEFAULT_INFER_SCHEMA: usize = 100; diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/profile.rs b/crates/nu_plugin_polars/src/dataframe/command/core/profile.rs index 4b7684a5b4..e05e031391 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/profile.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/profile.rs @@ -1,14 +1,14 @@ use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, PipelineData, ShellError, Signature, Type, Value, + Category, Example, LabeledError, PipelineData, ShellError, Signature, Type, Value, record, }; use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, NuLazyFrame, PolarsPluginObject, - PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuDataFrame, NuLazyFrame, PolarsPluginObject, PolarsPluginType, + cant_convert_err, + }, }; pub struct ProfileDF; diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/resource.rs b/crates/nu_plugin_polars/src/dataframe/command/core/resource.rs index e5cbaf7cb4..98c14551a8 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/resource.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/resource.rs @@ -1,6 +1,6 @@ use std::path::{Component, Path, PathBuf}; -use crate::{cloud::build_cloud_options, PolarsPlugin}; +use crate::{PolarsPlugin, cloud::build_cloud_options}; use nu_path::expand_path_with; use nu_protocol::{ShellError, Span, Spanned}; use polars_io::cloud::CloudOptions; diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/save/avro.rs b/crates/nu_plugin_polars/src/dataframe/command/core/save/avro.rs index d3012aa685..b959304734 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/save/avro.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/save/avro.rs @@ -2,8 +2,8 @@ use std::fs::File; use nu_plugin::EvaluatedCall; use nu_protocol::ShellError; -use polars_io::avro::{AvroCompression, AvroWriter}; use polars_io::SerWriter; +use polars_io::avro::{AvroCompression, AvroWriter}; use crate::command::core::resource::Resource; use crate::values::NuDataFrame; diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/save/mod.rs b/crates/nu_plugin_polars/src/dataframe/command/core/save/mod.rs index ce56acd984..86c2cc6556 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/save/mod.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/save/mod.rs @@ -7,16 +7,16 @@ mod parquet; use std::path::PathBuf; use crate::{ - command::core::resource::Resource, - values::{cant_convert_err, PolarsFileType, PolarsPluginObject, PolarsPluginType}, PolarsPlugin, + command::core::resource::Resource, + values::{PolarsFileType, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use log::debug; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ - shell_error::io::IoError, Category, Example, LabeledError, PipelineData, ShellError, Signature, - Span, Spanned, SyntaxShape, Type, + Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Spanned, + SyntaxShape, Type, shell_error::io::IoError, }; use polars::error::PolarsError; @@ -67,8 +67,7 @@ impl PluginCommand for SaveDF { fn examples(&self) -> Vec { vec![ Example { - description: - "Performs a streaming collect and save the output to the specified file", + description: "Performs a streaming collect and save the output to the specified file", example: "[[a b];[1 2] [3 4]] | polars into-lazy | polars save test.parquet", result: None, }, diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/schema.rs b/crates/nu_plugin_polars/src/dataframe/command/core/schema.rs index 8eaa1126b4..38a497f67a 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/schema.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/schema.rs @@ -1,11 +1,11 @@ use crate::{ - values::{datatype_list, CustomValueSupport, PolarsPluginObject}, PolarsPlugin, + values::{CustomValueSupport, PolarsPluginObject, datatype_list}, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, Value, + Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, Value, record, }; #[derive(Clone)] diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/shape.rs b/crates/nu_plugin_polars/src/dataframe/command/core/shape.rs index bbd8821e18..f5bef43343 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/shape.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/shape.rs @@ -3,7 +3,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, Value, }; -use crate::{dataframe::values::Column, values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, dataframe::values::Column, values::CustomValueSupport}; use crate::values::NuDataFrame; diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/summary.rs b/crates/nu_plugin_polars/src/dataframe/command/core/summary.rs index b00a8bb201..c507fa273f 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/summary.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/summary.rs @@ -1,4 +1,4 @@ -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use crate::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/to_df.rs b/crates/nu_plugin_polars/src/dataframe/command/core/to_df.rs index 7fe33a9cfd..55473c5059 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/to_df.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/to_df.rs @@ -1,7 +1,7 @@ use crate::{ + PolarsPlugin, dataframe::values::NuSchema, values::{Column, CustomValueSupport}, - PolarsPlugin, }; use crate::values::NuDataFrame; @@ -162,35 +162,54 @@ impl PluginCommand for ToDataFrame { description: "Convert to a dataframe and provide a schema", example: "[[a b c e]; [1 {d: [1 2 3]} [10 11 12] 1.618]]| polars into-df -s {a: u8, b: {d: list}, c: list, e: 'decimal<4,3>'}", result: Some( - NuDataFrame::try_from_series_vec(vec![ - Series::new("a".into(), &[1u8]), - { - let dtype = DataType::Struct(vec![Field::new("d".into(), DataType::List(Box::new(DataType::UInt64)))]); - let vals = vec![AnyValue::StructOwned( - Box::new((vec![AnyValue::List(Series::new("d".into(), &[1u64, 2, 3]))], vec![Field::new("d".into(), DataType::String)]))); 1]; - Series::from_any_values_and_dtype("b".into(), &vals, &dtype, false) - .expect("Struct series should not fail") - }, - { - let dtype = DataType::List(Box::new(DataType::UInt8)); - let vals = vec![AnyValue::List(Series::new("c".into(), &[10, 11, 12]))]; - Series::from_any_values_and_dtype("c".into(), &vals, &dtype, false) - .expect("List series should not fail") - }, - Series::new("e".into(), &[1.618]), - ], Span::test_data()) - .expect("simple df for test should not fail") - .into_value(Span::test_data()), + NuDataFrame::try_from_series_vec( + vec![ + Series::new("a".into(), &[1u8]), + { + let dtype = DataType::Struct(vec![Field::new( + "d".into(), + DataType::List(Box::new(DataType::UInt64)), + )]); + let vals = vec![ + AnyValue::StructOwned(Box::new(( + vec![AnyValue::List(Series::new( + "d".into(), + &[1u64, 2, 3] + ))], + vec![Field::new("d".into(), DataType::String)] + ))); + 1 + ]; + Series::from_any_values_and_dtype("b".into(), &vals, &dtype, false) + .expect("Struct series should not fail") + }, + { + let dtype = DataType::List(Box::new(DataType::UInt8)); + let vals = + vec![AnyValue::List(Series::new("c".into(), &[10, 11, 12]))]; + Series::from_any_values_and_dtype("c".into(), &vals, &dtype, false) + .expect("List series should not fail") + }, + Series::new("e".into(), &[1.618]), + ], + Span::test_data(), + ) + .expect("simple df for test should not fail") + .into_value(Span::test_data()), ), }, Example { description: "Convert to a dataframe and provide a schema that adds a new column", example: r#"[[a b]; [1 "foo"] [2 "bar"]] | polars into-df -s {a: u8, b:str, c:i64} | polars fill-null 3"#, - result: Some(NuDataFrame::try_from_series_vec(vec![ - Series::new("a".into(), [1u8, 2]), - Series::new("b".into(), ["foo", "bar"]), - Series::new("c".into(), [3i64, 3]), - ], Span::test_data()) + result: Some( + NuDataFrame::try_from_series_vec( + vec![ + Series::new("a".into(), [1u8, 2]), + Series::new("b".into(), ["foo", "bar"]), + Series::new("c".into(), [3i64, 3]), + ], + Span::test_data(), + ) .expect("simple df for test should not fail") .into_value(Span::test_data()), ), @@ -198,9 +217,11 @@ impl PluginCommand for ToDataFrame { Example { description: "If a provided schema specifies a subset of columns, only those columns are selected", example: r#"[[a b]; [1 "foo"] [2 "bar"]] | polars into-df -s {a: str}"#, - result: Some(NuDataFrame::try_from_series_vec(vec![ - Series::new("a".into(), ["1", "2"]), - ], Span::test_data()) + result: Some( + NuDataFrame::try_from_series_vec( + vec![Series::new("a".into(), ["1", "2"])], + Span::test_data(), + ) .expect("simple df for test should not fail") .into_value(Span::test_data()), ), @@ -208,10 +229,14 @@ impl PluginCommand for ToDataFrame { Example { description: "Use a predefined schama", example: r#"let schema = {a: str, b: str}; [[a b]; [1 "foo"] [2 "bar"]] | polars into-df -s $schema"#, - result: Some(NuDataFrame::try_from_series_vec(vec![ - Series::new("a".into(), ["1", "2"]), - Series::new("b".into(), ["foo", "bar"]), - ], Span::test_data()) + result: Some( + NuDataFrame::try_from_series_vec( + vec![ + Series::new("a".into(), ["1", "2"]), + Series::new("b".into(), ["foo", "bar"]), + ], + Span::test_data(), + ) .expect("simple df for test should not fail") .into_value(Span::test_data()), ), diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/to_dtype.rs b/crates/nu_plugin_polars/src/dataframe/command/core/to_dtype.rs index 1cbab2ae2f..83f0bada66 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/to_dtype.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/to_dtype.rs @@ -2,8 +2,8 @@ use nu_plugin::PluginCommand; use nu_protocol::{Category, Example, ShellError, Signature, Span, Type, Value}; use crate::{ - values::{CustomValueSupport, NuDataType}, PolarsPlugin, + values::{CustomValueSupport, NuDataType}, }; pub struct ToDataType; diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/to_lazy.rs b/crates/nu_plugin_polars/src/dataframe/command/core/to_lazy.rs index 6355fcd3bc..5a2dbf6c44 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/to_lazy.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/to_lazy.rs @@ -1,11 +1,11 @@ -use crate::{dataframe::values::NuSchema, values::CustomValueSupport, Cacheable, PolarsPlugin}; +use crate::{Cacheable, PolarsPlugin, dataframe::values::NuSchema, values::CustomValueSupport}; use crate::values::{NuDataFrame, NuLazyFrame}; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, PipelineData, Signature, Span, SyntaxShape, Type, - Value, + Category, Example, LabeledError, PipelineData, Signature, Span, SyntaxShape, Type, Value, + record, }; use polars::prelude::NamedFrom; use polars::series::Series; @@ -46,15 +46,21 @@ impl PluginCommand for ToLazyFrame { Example { description: "Takes a table, creates a lazyframe, assigns column 'b' type str, displays the schema", example: "[[a b];[1 2] [3 4]] | polars into-lazy --schema {b: str} | polars schema", - result: Some(Value::test_record(record! {"b" => Value::test_string("str")})), + result: Some(Value::test_record( + record! {"b" => Value::test_string("str")}, + )), }, Example { description: "Use a predefined schama", example: r#"let schema = {a: str, b: str}; [[a b]; [1 "foo"] [2 "bar"]] | polars into-lazy -s $schema"#, - result: Some(NuDataFrame::try_from_series_vec(vec![ - Series::new("a".into(), ["1", "2"]), - Series::new("b".into(), ["foo", "bar"]), - ], Span::test_data()) + result: Some( + NuDataFrame::try_from_series_vec( + vec![ + Series::new("a".into(), ["1", "2"]), + Series::new("b".into(), ["foo", "bar"]), + ], + Span::test_data(), + ) .expect("simple df for test should not fail") .into_value(Span::test_data()), ), diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/to_nu.rs b/crates/nu_plugin_polars/src/dataframe/command/core/to_nu.rs index fc0a912e0a..d74c0e7e1f 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/to_nu.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/to_nu.rs @@ -1,12 +1,12 @@ use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, - SyntaxShape, Type, Value, + Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, + Value, record, }; use crate::{ - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, PolarsPlugin, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use crate::values::NuDataFrame; @@ -69,8 +69,7 @@ impl PluginCommand for ToNu { }, Example { description: "Shows tail rows from dataframe", - example: - "[[a b]; [1 2] [5 6] [3 4]] | polars into-df | polars into-nu --tail --rows 1 --index", + example: "[[a b]; [1 2] [5 6] [3 4]] | polars into-df | polars into-nu --tail --rows 1 --index", result: Some(Value::list(vec![rec_3], Span::test_data())), }, Example { diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/to_repr.rs b/crates/nu_plugin_polars/src/dataframe/command/core/to_repr.rs index 417a37cd2e..702c672397 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/to_repr.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/to_repr.rs @@ -4,8 +4,8 @@ use nu_protocol::{ }; use crate::{ - values::{cant_convert_err, CustomValueSupport, NuLazyFrame, PolarsPluginType}, PolarsPlugin, + values::{CustomValueSupport, NuLazyFrame, PolarsPluginType, cant_convert_err}, }; use crate::values::NuDataFrame; @@ -34,8 +34,7 @@ impl PluginCommand for ToRepr { vec![ Example { description: "Shows dataframe in repr format", - example: - "[[a b]; [2025-01-01 2] [2025-01-02 4]] | polars into-df | polars into-repr", + example: "[[a b]; [2025-01-01 2] [2025-01-02 4]] | polars into-df | polars into-repr", result: Some(Value::string( r#" shape: (2, 2) @@ -53,8 +52,7 @@ shape: (2, 2) }, Example { description: "Shows lazy dataframe in repr format", - example: - "[[a b]; [2025-01-01 2] [2025-01-02 4]] | polars into-lazy | polars into-repr", + example: "[[a b]; [2025-01-01 2] [2025-01-02 4]] | polars into-lazy | polars into-repr", result: Some(Value::string( r#" shape: (2, 2) diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/to_schema.rs b/crates/nu_plugin_polars/src/dataframe/command/core/to_schema.rs index 13d90cc135..bb313f57e2 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/to_schema.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/to_schema.rs @@ -1,9 +1,9 @@ use nu_plugin::PluginCommand; -use nu_protocol::{record, Category, Example, ShellError, Signature, Span, Type, Value}; +use nu_protocol::{Category, Example, ShellError, Signature, Span, Type, Value, record}; use crate::{ - values::{CustomValueSupport, NuSchema}, PolarsPlugin, + values::{CustomValueSupport, NuSchema}, }; pub struct ToSchema; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/alias.rs b/crates/nu_plugin_polars/src/dataframe/command/data/alias.rs index 1d1c547073..8919a802aa 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/alias.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/alias.rs @@ -1,10 +1,10 @@ -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use crate::values::NuExpression; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, PipelineData, Signature, SyntaxShape, Type, Value, + Category, Example, LabeledError, PipelineData, Signature, SyntaxShape, Type, Value, record, }; #[derive(Clone)] diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/append.rs b/crates/nu_plugin_polars/src/dataframe/command/data/append.rs index fd32a30ca3..413401ef6a 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/append.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/append.rs @@ -5,8 +5,8 @@ use nu_protocol::{ }; use crate::{ - values::{Axis, Column, CustomValueSupport, NuDataFrame}, PolarsPlugin, + values::{Axis, Column, CustomValueSupport, NuDataFrame}, }; #[derive(Clone)] diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/arg_where.rs b/crates/nu_plugin_polars/src/dataframe/command/data/arg_where.rs index 45105a6f75..3579b5d0a2 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/arg_where.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/arg_where.rs @@ -1,7 +1,7 @@ use crate::{ + PolarsPlugin, dataframe::values::{Column, NuDataFrame, NuExpression}, values::CustomValueSupport, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/cast.rs b/crates/nu_plugin_polars/src/dataframe/command/data/cast.rs index c1fc08c3c8..9f3b4fd6fa 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/cast.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/cast.rs @@ -1,14 +1,14 @@ use crate::{ - dataframe::values::{str_to_dtype, NuExpression, NuLazyFrame}, - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, PolarsPlugin, + dataframe::values::{NuExpression, NuLazyFrame, str_to_dtype}, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use crate::values::NuDataFrame; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, - SyntaxShape, Type, Value, + Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, + Value, record, }; use polars::prelude::*; @@ -66,8 +66,7 @@ impl PluginCommand for CastDF { }, Example { description: "Cast a column in a lazy dataframe to a different dtype", - example: - "[[a b]; [1 2] [3 4]] | polars into-df | polars into-lazy | polars cast u8 a | polars schema", + example: "[[a b]; [1 2] [3 4]] | polars into-df | polars into-lazy | polars cast u8 a | polars schema", result: Some(Value::record( record! { "a" => Value::string("u8", Span::test_data()), diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/col.rs b/crates/nu_plugin_polars/src/dataframe/command/data/col.rs index e02d0f8b2f..2411d54083 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/col.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/col.rs @@ -1,12 +1,12 @@ use crate::{ - dataframe::values::NuExpression, - values::{str_to_dtype, Column, CustomValueSupport, NuDataFrame}, PolarsPlugin, + dataframe::values::NuExpression, + values::{Column, CustomValueSupport, NuDataFrame, str_to_dtype}, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, - SyntaxShape, Type, Value, + Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, + Value, record, }; use polars::prelude::DataType; @@ -55,10 +55,23 @@ impl PluginCommand for ExprCol { description: "Select all columns using the asterisk wildcard.", example: "[[a b]; [x 1] [y 2] [z 3]] | polars into-df | polars select (polars col '*') | polars collect", result: Some( - NuDataFrame::try_from_columns(vec![ - Column::new("a".to_string(), vec![Value::test_string("x"), Value::test_string("y"), Value::test_string("z")]), - Column::new("b".to_string(), vec![Value::test_int(1), Value::test_int(2), Value::test_int(3)]), - ],None) + NuDataFrame::try_from_columns( + vec![ + Column::new( + "a".to_string(), + vec![ + Value::test_string("x"), + Value::test_string("y"), + Value::test_string("z"), + ], + ), + Column::new( + "b".to_string(), + vec![Value::test_int(1), Value::test_int(2), Value::test_int(3)], + ), + ], + None, + ) .expect("should not fail") .into_value(Span::test_data()), ), @@ -67,10 +80,13 @@ impl PluginCommand for ExprCol { description: "Select multiple columns (cannot be used with asterisk wildcard)", example: "[[a b c]; [x 1 1.1] [y 2 2.2] [z 3 3.3]] | polars into-df | polars select (polars col b c | polars sum) | polars collect", result: Some( - NuDataFrame::try_from_columns(vec![ - Column::new("b".to_string(), vec![Value::test_int(6)]), - Column::new("c".to_string(), vec![Value::test_float(6.6)]), - ],None) + NuDataFrame::try_from_columns( + vec![ + Column::new("b".to_string(), vec![Value::test_int(6)]), + Column::new("c".to_string(), vec![Value::test_float(6.6)]), + ], + None, + ) .expect("should not fail") .into_value(Span::test_data()), ), @@ -79,11 +95,14 @@ impl PluginCommand for ExprCol { description: "Select multiple columns by types (cannot be used with asterisk wildcard)", example: "[[a b c]; [x o 1.1] [y p 2.2] [z q 3.3]] | polars into-df | polars select (polars col str f64 --type | polars max) | polars collect", result: Some( - NuDataFrame::try_from_columns(vec![ - Column::new("a".to_string(), vec![Value::test_string("z")]), - Column::new("b".to_string(), vec![Value::test_string("q")]), - Column::new("c".to_string(), vec![Value::test_float(3.3)]), - ],None) + NuDataFrame::try_from_columns( + vec![ + Column::new("a".to_string(), vec![Value::test_string("z")]), + Column::new("b".to_string(), vec![Value::test_string("q")]), + Column::new("c".to_string(), vec![Value::test_float(3.3)]), + ], + None, + ) .expect("should not fail") .into_value(Span::test_data()), ), diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/collect.rs b/crates/nu_plugin_polars/src/dataframe/command/data/collect.rs index 278564137e..b899e5e08b 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/collect.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/collect.rs @@ -1,7 +1,7 @@ use crate::{ - dataframe::values::{Column, NuDataFrame}, - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, Cacheable, PolarsPlugin, + dataframe::values::{Column, NuDataFrame}, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/concat.rs b/crates/nu_plugin_polars/src/dataframe/command/data/concat.rs index 5757ec3a22..538fcb87b7 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/concat.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/concat.rs @@ -1,6 +1,6 @@ use crate::{ - values::{CustomValueSupport, NuLazyFrame}, PolarsPlugin, + values::{CustomValueSupport, NuLazyFrame}, }; use crate::values::NuDataFrame; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/cut.rs b/crates/nu_plugin_polars/src/dataframe/command/data/cut.rs index 5e402a96fa..e540c13bf5 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/cut.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/cut.rs @@ -3,8 +3,8 @@ use nu_protocol::{Category, Example, PipelineData, ShellError, Signature, Syntax use polars::prelude::PlSmallStr; use crate::{ - values::{CustomValueSupport, NuDataFrame}, PolarsPlugin, + values::{CustomValueSupport, NuDataFrame}, }; pub struct CutSeries; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/drop.rs b/crates/nu_plugin_polars/src/dataframe/command/data/drop.rs index 852e42e52c..a08faaeb5b 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/drop.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/drop.rs @@ -4,8 +4,8 @@ use nu_protocol::{ Value, }; -use crate::values::CustomValueSupport; use crate::PolarsPlugin; +use crate::values::CustomValueSupport; use crate::values::utils::convert_columns; use crate::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/drop_duplicates.rs b/crates/nu_plugin_polars/src/dataframe/command/data/drop_duplicates.rs index 94ccfde498..e6aec2f5dc 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/drop_duplicates.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/drop_duplicates.rs @@ -6,11 +6,11 @@ use nu_protocol::{ use polars::df; use polars::prelude::UniqueKeepStrategy; -use crate::values::CustomValueSupport; use crate::PolarsPlugin; +use crate::values::CustomValueSupport; -use crate::values::utils::convert_columns_string; use crate::values::NuDataFrame; +use crate::values::utils::convert_columns_string; #[derive(Clone)] pub struct DropDuplicates; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/drop_nulls.rs b/crates/nu_plugin_polars/src/dataframe/command/data/drop_nulls.rs index b99ea4223d..f694a49973 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/drop_nulls.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/drop_nulls.rs @@ -4,8 +4,8 @@ use nu_protocol::{ Value, }; -use crate::values::CustomValueSupport; use crate::PolarsPlugin; +use crate::values::CustomValueSupport; use crate::values::utils::convert_columns_string; use crate::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/dummies.rs b/crates/nu_plugin_polars/src/dataframe/command/data/dummies.rs index 2dc305c2f4..bd7ef982fb 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/dummies.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/dummies.rs @@ -1,5 +1,5 @@ use crate::values::NuDataFrame; -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/explode.rs b/crates/nu_plugin_polars/src/dataframe/command/data/explode.rs index e2bc6b4e49..ec62913631 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/explode.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/explode.rs @@ -1,6 +1,6 @@ +use crate::PolarsPlugin; use crate::dataframe::values::{Column, NuDataFrame, NuExpression, NuLazyFrame}; use crate::values::{CustomValueSupport, PolarsPluginObject}; -use crate::PolarsPlugin; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ @@ -46,58 +46,67 @@ impl PluginCommand for LazyExplode { vec![ Example { description: "Explode the specified dataframe", - example: "[[id name hobbies]; [1 Mercy [Cycling Knitting]] [2 Bob [Skiing Football]]] + example: + "[[id name hobbies]; [1 Mercy [Cycling Knitting]] [2 Bob [Skiing Football]]] | polars into-df | polars explode hobbies | polars collect | polars sort-by [id, name]", result: Some( - NuDataFrame::try_from_columns(vec![ - Column::new( - "id".to_string(), - vec![ - Value::test_int(1), - Value::test_int(1), - Value::test_int(2), - Value::test_int(2), - ]), - Column::new( - "name".to_string(), - vec![ - Value::test_string("Mercy"), - Value::test_string("Mercy"), - Value::test_string("Bob"), - Value::test_string("Bob"), - ]), - Column::new( - "hobbies".to_string(), - vec![ - Value::test_string("Cycling"), - Value::test_string("Knitting"), - Value::test_string("Skiing"), - Value::test_string("Football"), - ]), - ], None) + NuDataFrame::try_from_columns( + vec![ + Column::new( + "id".to_string(), + vec![ + Value::test_int(1), + Value::test_int(1), + Value::test_int(2), + Value::test_int(2), + ], + ), + Column::new( + "name".to_string(), + vec![ + Value::test_string("Mercy"), + Value::test_string("Mercy"), + Value::test_string("Bob"), + Value::test_string("Bob"), + ], + ), + Column::new( + "hobbies".to_string(), + vec![ + Value::test_string("Cycling"), + Value::test_string("Knitting"), + Value::test_string("Skiing"), + Value::test_string("Football"), + ], + ), + ], + None, + ) .expect("simple df for test should not fail") .into_value(Span::test_data()), - ) + ), }, Example { description: "Select a column and explode the values", example: "[[id name hobbies]; [1 Mercy [Cycling Knitting]] [2 Bob [Skiing Football]]] | polars into-df | polars select (polars col hobbies | polars explode)", result: Some( - NuDataFrame::try_from_columns(vec![ - Column::new( + NuDataFrame::try_from_columns( + vec![Column::new( "hobbies".to_string(), vec![ Value::test_string("Cycling"), Value::test_string("Knitting"), Value::test_string("Skiing"), Value::test_string("Football"), - ]), - ], None) - .expect("simple df for test should not fail") - .into_value(Span::test_data()), + ], + )], + None, + ) + .expect("simple df for test should not fail") + .into_value(Span::test_data()), ), }, ] diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/fill_nan.rs b/crates/nu_plugin_polars/src/dataframe/command/data/fill_nan.rs index dbe0adf5da..5ff88a8b11 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/fill_nan.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/fill_nan.rs @@ -1,7 +1,7 @@ use crate::{ - dataframe::values::{Column, NuDataFrame, NuExpression}, - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, PolarsPlugin, + dataframe::values::{Column, NuDataFrame, NuExpression}, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/fill_null.rs b/crates/nu_plugin_polars/src/dataframe/command/data/fill_null.rs index 7f7b5f1862..8dff660d5b 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/fill_null.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/fill_null.rs @@ -1,7 +1,7 @@ use crate::{ - dataframe::values::{Column, NuDataFrame, NuExpression, NuLazyFrame}, - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, PolarsPlugin, + dataframe::values::{Column, NuDataFrame, NuExpression, NuLazyFrame}, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/filter.rs b/crates/nu_plugin_polars/src/dataframe/command/data/filter.rs index 34d0fa6873..f47684c430 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/filter.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/filter.rs @@ -1,7 +1,7 @@ use crate::{ + PolarsPlugin, dataframe::values::{Column, NuDataFrame, NuExpression, NuLazyFrame}, values::CustomValueSupport, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -42,8 +42,7 @@ impl PluginCommand for LazyFilter { vec![ Example { description: "Filter dataframe using an expression", - example: - "[[a b]; [6 2] [4 2] [2 2]] | polars into-df | polars filter ((polars col a) >= 4)", + example: "[[a b]; [6 2] [4 2] [2 2]] | polars into-df | polars filter ((polars col a) >= 4)", result: Some( NuDataFrame::try_from_columns( vec![ @@ -64,44 +63,43 @@ impl PluginCommand for LazyFilter { }, Example { description: "Filter dataframe for rows where dt is within the last 2 days of the maximum dt value", - example: - "[[dt val]; [2025-04-01 1] [2025-04-02 2] [2025-04-03 3] [2025-04-04 4]] | polars into-df | polars filter ((polars col dt) > ((polars col dt | polars max | $in - 2day)))", + example: "[[dt val]; [2025-04-01 1] [2025-04-02 2] [2025-04-03 3] [2025-04-04 4]] | polars into-df | polars filter ((polars col dt) > ((polars col dt | polars max | $in - 2day)))", result: Some( - NuDataFrame::try_from_columns( - vec![ - Column::new( - "dt".to_string(), - vec![ - Value::date( - chrono::DateTime::parse_from_str( - "2025-04-03 00:00:00 +0000", - "%Y-%m-%d %H:%M:%S %z", - ) - .expect("date calculation should not fail in test"), - Span::test_data(), - ), - Value::date( - chrono::DateTime::parse_from_str( - "2025-04-04 00:00:00 +0000", - "%Y-%m-%d %H:%M:%S %z", - ) - .expect("date calculation should not fail in test"), - Span::test_data(), - ), - ] - ), - Column::new( - "val".to_string(), - vec![Value::test_int(3), Value::test_int(4)], - ), - ], - None, - ) - .expect("simple df for test should not fail") - .into_value(Span::test_data()), - ), - }, - ] + NuDataFrame::try_from_columns( + vec![ + Column::new( + "dt".to_string(), + vec![ + Value::date( + chrono::DateTime::parse_from_str( + "2025-04-03 00:00:00 +0000", + "%Y-%m-%d %H:%M:%S %z", + ) + .expect("date calculation should not fail in test"), + Span::test_data(), + ), + Value::date( + chrono::DateTime::parse_from_str( + "2025-04-04 00:00:00 +0000", + "%Y-%m-%d %H:%M:%S %z", + ) + .expect("date calculation should not fail in test"), + Span::test_data(), + ), + ], + ), + Column::new( + "val".to_string(), + vec![Value::test_int(3), Value::test_int(4)], + ), + ], + None, + ) + .expect("simple df for test should not fail") + .into_value(Span::test_data()), + ), + }, + ] } fn run( diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/filter_with.rs b/crates/nu_plugin_polars/src/dataframe/command/data/filter_with.rs index bc222459e1..eeae6a60dc 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/filter_with.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/filter_with.rs @@ -6,9 +6,9 @@ use nu_protocol::{ use polars::prelude::LazyFrame; use crate::{ - dataframe::values::{NuExpression, NuLazyFrame}, - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, PolarsPlugin, + dataframe::values::{NuExpression, NuLazyFrame}, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use crate::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/first.rs b/crates/nu_plugin_polars/src/dataframe/command/data/first.rs index 552b173e5c..cd432a0d78 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/first.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/first.rs @@ -1,6 +1,6 @@ use crate::{ - values::{Column, CustomValueSupport, NuLazyFrame, PolarsPluginObject}, PolarsPlugin, + values::{Column, CustomValueSupport, NuLazyFrame, PolarsPluginObject}, }; use crate::values::{NuDataFrame, NuExpression}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/flatten.rs b/crates/nu_plugin_polars/src/dataframe/command/data/flatten.rs index f292a824bb..2a5190a9da 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/flatten.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/flatten.rs @@ -4,9 +4,9 @@ use nu_protocol::{ }; use crate::{ + PolarsPlugin, dataframe::values::{Column, NuDataFrame}, values::CustomValueSupport, - PolarsPlugin, }; use super::explode::explode; @@ -47,54 +47,62 @@ impl PluginCommand for LazyFlatten { fn examples(&self) -> Vec { vec![ -Example { + Example { description: "Flatten the specified dataframe", example: "[[id name hobbies]; [1 Mercy [Cycling Knitting]] [2 Bob [Skiing Football]]] | polars into-df | polars flatten hobbies | polars collect", result: Some( - NuDataFrame::try_from_columns(vec![ - Column::new( - "id".to_string(), - vec![ - Value::test_int(1), - Value::test_int(1), - Value::test_int(2), - Value::test_int(2), - ]), - Column::new( - "name".to_string(), - vec![ - Value::test_string("Mercy"), - Value::test_string("Mercy"), - Value::test_string("Bob"), - Value::test_string("Bob"), - ]), - Column::new( - "hobbies".to_string(), - vec![ - Value::test_string("Cycling"), - Value::test_string("Knitting"), - Value::test_string("Skiing"), - Value::test_string("Football"), - ]), - ], None) + NuDataFrame::try_from_columns( + vec![ + Column::new( + "id".to_string(), + vec![ + Value::test_int(1), + Value::test_int(1), + Value::test_int(2), + Value::test_int(2), + ], + ), + Column::new( + "name".to_string(), + vec![ + Value::test_string("Mercy"), + Value::test_string("Mercy"), + Value::test_string("Bob"), + Value::test_string("Bob"), + ], + ), + Column::new( + "hobbies".to_string(), + vec![ + Value::test_string("Cycling"), + Value::test_string("Knitting"), + Value::test_string("Skiing"), + Value::test_string("Football"), + ], + ), + ], + None, + ) .expect("simple df for test should not fail") .into_value(Span::test_data()), - ) + ), }, - Example { + Example { description: "Select a column and flatten the values", example: "[[id name hobbies]; [1 Mercy [Cycling Knitting]] [2 Bob [Skiing Football]]] | polars into-df | polars select (polars col hobbies | polars flatten)", result: Some( - NuDataFrame::try_from_columns(vec![ - Column::new( - "hobbies".to_string(), + NuDataFrame::try_from_columns( + vec![Column::new( + "hobbies".to_string(), vec![ Value::test_string("Cycling"), Value::test_string("Knitting"), Value::test_string("Skiing"), Value::test_string("Football"), - ]), - ], None) + ], + )], + None, + ) .expect("simple df for test should not fail") .into_value(Span::test_data()), ), diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/get.rs b/crates/nu_plugin_polars/src/dataframe/command/data/get.rs index 09269589a3..8c9f1786e8 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/get.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/get.rs @@ -5,7 +5,7 @@ use nu_protocol::{ }; use crate::{ - dataframe::values::utils::convert_columns_string, values::CustomValueSupport, PolarsPlugin, + PolarsPlugin, dataframe::values::utils::convert_columns_string, values::CustomValueSupport, }; use crate::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/join.rs b/crates/nu_plugin_polars/src/dataframe/command/data/join.rs index bd140b5c2a..d2500d759d 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/join.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/join.rs @@ -1,7 +1,7 @@ use crate::{ + PolarsPlugin, dataframe::values::{Column, NuDataFrame, NuExpression, NuLazyFrame}, values::CustomValueSupport, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/join_where.rs b/crates/nu_plugin_polars/src/dataframe/command/data/join_where.rs index 354cfee94b..2702ae6ea6 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/join_where.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/join_where.rs @@ -1,7 +1,7 @@ use crate::{ + PolarsPlugin, dataframe::values::{Column, NuDataFrame, NuExpression, NuLazyFrame}, values::CustomValueSupport, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/last.rs b/crates/nu_plugin_polars/src/dataframe/command/data/last.rs index 694cbfd266..62bf9810e6 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/last.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/last.rs @@ -1,9 +1,9 @@ use crate::{ - values::{Column, CustomValueSupport, NuLazyFrame, PolarsPluginObject}, PolarsPlugin, + values::{Column, CustomValueSupport, NuLazyFrame, PolarsPluginObject}, }; -use crate::values::{utils::DEFAULT_ROWS, NuDataFrame, NuExpression}; +use crate::values::{NuDataFrame, NuExpression, utils::DEFAULT_ROWS}; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/len.rs b/crates/nu_plugin_polars/src/dataframe/command/data/len.rs index f537a6baa1..62cf685dd0 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/len.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/len.rs @@ -1,6 +1,6 @@ use crate::{ - values::{Column, CustomValueSupport, NuDataFrame, NuExpression}, PolarsPlugin, + values::{Column, CustomValueSupport, NuDataFrame, NuExpression}, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -33,9 +33,7 @@ impl PluginCommand for ExprLen { example: "[[a b]; [1 2] [3 4]] | polars into-df | polars select (polars len) | polars collect", result: Some( NuDataFrame::try_from_columns( - vec![ - Column::new("len".to_string(), vec![Value::test_int(2)]), - ], + vec![Column::new("len".to_string(), vec![Value::test_int(2)])], None, ) .expect("simple df for test should not fail") diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/lit.rs b/crates/nu_plugin_polars/src/dataframe/command/data/lit.rs index 783117ecbd..ad5079ca70 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/lit.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/lit.rs @@ -1,7 +1,7 @@ -use crate::{dataframe::values::NuExpression, values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, dataframe::values::NuExpression, values::CustomValueSupport}; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, PipelineData, Signature, SyntaxShape, Type, Value, + Category, Example, LabeledError, PipelineData, Signature, SyntaxShape, Type, Value, record, }; #[derive(Clone)] diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/pivot.rs b/crates/nu_plugin_polars/src/dataframe/command/data/pivot.rs index b6f29adf7e..672e063f7b 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/pivot.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/pivot.rs @@ -5,12 +5,12 @@ use nu_protocol::{ }; use chrono::DateTime; -use polars_ops::pivot::{pivot, PivotAgg}; +use polars_ops::pivot::{PivotAgg, pivot}; use crate::{ + PolarsPlugin, dataframe::values::utils::convert_columns_string, values::{Column, CustomValueSupport, PolarsPluginObject}, - PolarsPlugin, }; use crate::values::NuDataFrame; @@ -88,7 +88,10 @@ impl PluginCommand for PivotDF { vec![ Column::new( "name".to_string(), - vec![Value::string("Cady", Span::test_data()), Value::string("Karen", Span::test_data())], + vec![ + Value::string("Cady", Span::test_data()), + Value::string("Karen", Span::test_data()), + ], ), Column::new( "date".to_string(), @@ -113,18 +116,24 @@ impl PluginCommand for PivotDF { ), Column::new( "maths".to_string(), - vec![Value::int(98, Span::test_data()), Value::int(61, Span::test_data())], + vec![ + Value::int(98, Span::test_data()), + Value::int(61, Span::test_data()), + ], ), Column::new( "physics".to_string(), - vec![Value::int(99, Span::test_data()), Value::int(58, Span::test_data())], + vec![ + Value::int(99, Span::test_data()), + Value::int(58, Span::test_data()), + ], ), ], None, ) .expect("simple df for test should not fail") - .into_value(Span::unknown()) - ) + .into_value(Span::unknown()), + ), }, Example { description: "Perform a pivot with multiple `values` columns with a separator", @@ -134,31 +143,46 @@ impl PluginCommand for PivotDF { vec![ Column::new( "name".to_string(), - vec![Value::string("Cady", Span::test_data()), Value::string("Karen", Span::test_data())], + vec![ + Value::string("Cady", Span::test_data()), + Value::string("Karen", Span::test_data()), + ], ), Column::new( "test_1/maths".to_string(), - vec![Value::int(98, Span::test_data()), Value::int(61, Span::test_data())], + vec![ + Value::int(98, Span::test_data()), + Value::int(61, Span::test_data()), + ], ), Column::new( "test_1/physics".to_string(), - vec![Value::int(99, Span::test_data()), Value::int(58, Span::test_data())], + vec![ + Value::int(99, Span::test_data()), + Value::int(58, Span::test_data()), + ], ), Column::new( "grade_1/maths".to_string(), - vec![Value::string("A", Span::test_data()), Value::string("D", Span::test_data())], + vec![ + Value::string("A", Span::test_data()), + Value::string("D", Span::test_data()), + ], ), Column::new( "grade_1/physics".to_string(), - vec![Value::string("A", Span::test_data()), Value::string("D", Span::test_data())], + vec![ + Value::string("A", Span::test_data()), + Value::string("D", Span::test_data()), + ], ), ], None, ) .expect("simple df for test should not fail") - .into_value(Span::unknown()) - ) - } + .into_value(Span::unknown()), + ), + }, ] } diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/qcut.rs b/crates/nu_plugin_polars/src/dataframe/command/data/qcut.rs index 98e4108f91..779bd90e75 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/qcut.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/qcut.rs @@ -3,8 +3,8 @@ use nu_protocol::{Category, Example, PipelineData, ShellError, Signature, Syntax use polars::prelude::PlSmallStr; use crate::{ - values::{CustomValueSupport, NuDataFrame}, PolarsPlugin, + values::{CustomValueSupport, NuDataFrame}, }; pub struct QCutSeries; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/query_df.rs b/crates/nu_plugin_polars/src/dataframe/command/data/query_df.rs index 3d0c218796..f9f684695b 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/query_df.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/query_df.rs @@ -1,9 +1,9 @@ use super::sql_context::SQLContext; +use crate::PolarsPlugin; use crate::dataframe::values::Column; use crate::dataframe::values::NuLazyFrame; use crate::values::CustomValueSupport; use crate::values::NuDataFrame; -use crate::PolarsPlugin; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/rename.rs b/crates/nu_plugin_polars/src/dataframe/command/data/rename.rs index 3265a5c7fa..0445b20644 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/rename.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/rename.rs @@ -5,9 +5,9 @@ use nu_protocol::{ }; use crate::{ + PolarsPlugin, dataframe::{utils::extract_strings, values::NuLazyFrame}, values::{CustomValueSupport, PolarsPluginObject}, - PolarsPlugin, }; use crate::values::{Column, NuDataFrame}; @@ -90,8 +90,7 @@ impl PluginCommand for RenameDF { }, Example { description: "Renames two dataframe columns", - example: - "[[a b]; [1 2] [3 4]] | polars into-df | polars rename [a b] [a_new b_new]", + example: "[[a b]; [1 2] [3 4]] | polars into-df | polars rename [a b] [a_new b_new]", result: Some( NuDataFrame::try_from_columns( vec![ diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/reverse.rs b/crates/nu_plugin_polars/src/dataframe/command/data/reverse.rs index 9665b7aa2b..d3c7648117 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/reverse.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/reverse.rs @@ -2,8 +2,8 @@ use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{Category, Example, LabeledError, PipelineData, Signature, Span, Type, Value}; use crate::{ - values::{Column, CustomValueSupport, NuDataFrame, NuLazyFrame}, PolarsPlugin, + values::{Column, CustomValueSupport, NuDataFrame, NuLazyFrame}, }; pub struct LazyReverse; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/sample.rs b/crates/nu_plugin_polars/src/dataframe/command/data/sample.rs index 9157973d84..111638c69e 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/sample.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/sample.rs @@ -6,7 +6,7 @@ use nu_protocol::{ use polars::prelude::NamedFrom; use polars::series::Series; -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use crate::values::{Column, NuDataFrame}; @@ -62,14 +62,12 @@ impl PluginCommand for SampleDF { }, Example { description: "Shows sample row using fraction and replace", - example: - "[[a b]; [1 2] [3 4] [5 6]] | polars into-df | polars sample --fraction 0.5 --replace", + example: "[[a b]; [1 2] [3 4] [5 6]] | polars into-df | polars sample --fraction 0.5 --replace", result: None, // No expected value because sampling is random }, Example { description: "Shows sample row using using predefined seed 1", - example: - "[[a b]; [1 2] [3 4] [5 6]] | polars into-df | polars sample --seed 1 --n-rows 1", + example: "[[a b]; [1 2] [3 4] [5 6]] | polars into-df | polars sample --seed 1 --n-rows 1", result: Some( NuDataFrame::try_from_columns( vec![ @@ -80,9 +78,8 @@ impl PluginCommand for SampleDF { ) .expect("should not fail") .into_value(Span::test_data()), - ) + ), }, - ] } diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/select.rs b/crates/nu_plugin_polars/src/dataframe/command/data/select.rs index 6bcadb9d2b..ff43b46615 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/select.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/select.rs @@ -1,7 +1,7 @@ use crate::{ + PolarsPlugin, dataframe::values::{Column, NuDataFrame, NuExpression, NuLazyFrame}, values::CustomValueSupport, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -43,12 +43,10 @@ impl PluginCommand for LazySelect { example: "[[a b]; [6 2] [4 2] [2 2]] | polars into-df | polars select a", result: Some( NuDataFrame::try_from_columns( - vec![ - Column::new( + vec![Column::new( "a".to_string(), vec![Value::test_int(6), Value::test_int(4), Value::test_int(2)], - ) - ], + )], None, ) .expect("simple df for test should not fail") @@ -77,14 +75,17 @@ impl PluginCommand for LazySelect { NuDataFrame::try_from_columns( vec![ Column::new( - "a".to_string(), - vec![Value::test_int(6), Value::test_int(4), Value::test_int(2)]), + "a".to_string(), + vec![Value::test_int(6), Value::test_int(4), Value::test_int(2)], + ), Column::new( - "b".to_string(), - vec![Value::test_int(2), Value::test_int(2), Value::test_int(2)]), + "b".to_string(), + vec![Value::test_int(2), Value::test_int(2), Value::test_int(2)], + ), Column::new( - "c".to_string(), - vec![Value::test_int(36), Value::test_int(16), Value::test_int(4)]) + "c".to_string(), + vec![Value::test_int(36), Value::test_int(16), Value::test_int(4)], + ), ], None, ) diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/shift.rs b/crates/nu_plugin_polars/src/dataframe/command/data/shift.rs index 6565ad92b2..a4658962b1 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/shift.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/shift.rs @@ -1,7 +1,7 @@ use crate::{ - dataframe::values::{NuExpression, NuLazyFrame}, - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, PolarsPlugin, + dataframe::values::{NuExpression, NuLazyFrame}, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use crate::values::{Column, NuDataFrame}; @@ -63,8 +63,7 @@ impl PluginCommand for Shift { }, Example { description: "Shifts the values by a given period, fill absent values with 0", - example: - "[1 2 2 3 3] | polars into-lazy | polars shift 2 --fill 0 | polars collect", + example: "[1 2 2 3 3] | polars into-lazy | polars shift 2 --fill 0 | polars collect", result: Some( NuDataFrame::try_from_columns( vec![Column::new( diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/slice.rs b/crates/nu_plugin_polars/src/dataframe/command/data/slice.rs index 422d17db49..071220d2c0 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/slice.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/slice.rs @@ -4,7 +4,7 @@ use nu_protocol::{ Value, }; -use crate::{dataframe::values::Column, values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, dataframe::values::Column, values::CustomValueSupport}; use crate::values::NuDataFrame; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/sort_by_expr.rs b/crates/nu_plugin_polars/src/dataframe/command/data/sort_by_expr.rs index 50539c4ab1..3965725a94 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/sort_by_expr.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/sort_by_expr.rs @@ -1,8 +1,8 @@ use crate::values::NuLazyFrame; use crate::{ + PolarsPlugin, dataframe::values::{Column, NuDataFrame, NuExpression}, values::CustomValueSupport, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ @@ -57,45 +57,50 @@ impl PluginCommand for LazySortBy { description: "Sort dataframe by one column", example: "[[a b]; [6 2] [1 4] [4 1]] | polars into-df | polars sort-by a", result: Some( - NuDataFrame::try_from_columns(vec![ - Column::new( - "a".to_string(), - vec![Value::test_int(1), Value::test_int(4), Value::test_int(6)], - ), - Column::new( - "b".to_string(), - vec![Value::test_int(4), Value::test_int(1), Value::test_int(2)], - ), - ], None) + NuDataFrame::try_from_columns( + vec![ + Column::new( + "a".to_string(), + vec![Value::test_int(1), Value::test_int(4), Value::test_int(6)], + ), + Column::new( + "b".to_string(), + vec![Value::test_int(4), Value::test_int(1), Value::test_int(2)], + ), + ], + None, + ) .expect("simple df for test should not fail") .into_value(Span::test_data()), ), }, Example { description: "Sort column using two columns", - example: - "[[a b]; [6 2] [1 1] [1 4] [2 4]] | polars into-df | polars sort-by [a b] -r [false true]", + example: "[[a b]; [6 2] [1 1] [1 4] [2 4]] | polars into-df | polars sort-by [a b] -r [false true]", result: Some( - NuDataFrame::try_from_columns(vec![ - Column::new( - "a".to_string(), - vec![ - Value::test_int(1), - Value::test_int(1), - Value::test_int(2), - Value::test_int(6), - ], - ), - Column::new( - "b".to_string(), - vec![ - Value::test_int(4), - Value::test_int(1), - Value::test_int(4), - Value::test_int(2), - ], - ), - ], None) + NuDataFrame::try_from_columns( + vec![ + Column::new( + "a".to_string(), + vec![ + Value::test_int(1), + Value::test_int(1), + Value::test_int(2), + Value::test_int(6), + ], + ), + Column::new( + "b".to_string(), + vec![ + Value::test_int(4), + Value::test_int(1), + Value::test_int(4), + Value::test_int(2), + ], + ), + ], + None, + ) .expect("simple df for test should not fail") .into_value(Span::test_data()), ), diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/sql_context.rs b/crates/nu_plugin_polars/src/dataframe/command/data/sql_context.rs index 59e6c47258..75ca8b04a0 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/sql_context.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/sql_context.rs @@ -1,6 +1,6 @@ use crate::dataframe::command::data::sql_expr::parse_sql_expr; use polars::error::{ErrString, PolarsError}; -use polars::prelude::{col, DataFrame, DataType, IntoLazy, LazyFrame}; +use polars::prelude::{DataFrame, DataType, IntoLazy, LazyFrame, col}; use sqlparser::ast::{ Expr as SqlExpr, GroupByExpr, Select, SelectItem, SetExpr, Statement, TableFactor, Value as SQLValue, @@ -198,7 +198,7 @@ impl SQLContext { _ => { return Err(PolarsError::ComputeError( "INSERT, UPDATE is not supported for polars".into(), - )) + )); } }; match &query.limit { @@ -214,14 +214,14 @@ impl SQLContext { _ => { return Err(PolarsError::ComputeError( "Only support number argument to LIMIT clause".into(), - )) + )); } } } _ => { return Err(PolarsError::ComputeError( format!("Statement type {ast:?} is not supported").into(), - )) + )); } }) } diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/sql_expr.rs b/crates/nu_plugin_polars/src/dataframe/command/data/sql_expr.rs index 465da5437c..1634ea7853 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/sql_expr.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/sql_expr.rs @@ -1,5 +1,5 @@ use polars::error::PolarsError; -use polars::prelude::{col, lit, DataType, Expr, LiteralValue, PolarsResult as Result, TimeUnit}; +use polars::prelude::{DataType, Expr, LiteralValue, PolarsResult as Result, TimeUnit, col, lit}; use sqlparser::ast::{ ArrayElemTypeDef, BinaryOperator as SQLBinaryOperator, DataType as SQLDataType, @@ -40,13 +40,13 @@ fn map_sql_polars_datatype(data_type: &SQLDataType) -> Result { _ => { return Err(PolarsError::ComputeError( "SQL Datatype Array(None) was not supported in polars-sql yet!".into(), - )) + )); } }, _ => { return Err(PolarsError::ComputeError( format!("SQL Datatype {data_type:?} was not supported in polars-sql yet!").into(), - )) + )); } }) } @@ -78,7 +78,7 @@ fn binary_op_(left: Expr, right: Expr, op: &SQLBinaryOperator) -> Result { _ => { return Err(PolarsError::ComputeError( format!("SQL Operator {op:?} was not supported in polars-sql yet!").into(), - )) + )); } }) } @@ -106,7 +106,7 @@ fn literal_expr(value: &SqlValue) -> Result { _ => { return Err(PolarsError::ComputeError( format!("Parsing SQL Value {value:?} was not supported in polars-sql yet!").into(), - )) + )); } }) } @@ -128,7 +128,7 @@ pub fn parse_sql_expr(expr: &SqlExpr) -> Result { _ => { return Err(PolarsError::ComputeError( format!("Expression: {expr:?} was not supported in polars-sql yet!").into(), - )) + )); } }) } @@ -150,7 +150,7 @@ fn apply_window_spec(expr: Expr, window_type: Option<&WindowType>) -> Result { return Err(PolarsError::ComputeError( format!("Expression: {expr:?} was not supported in polars-sql yet!").into(), - )) + )); } }, None => expr, @@ -179,31 +179,23 @@ fn parse_sql_function(sql_function: &SQLFunction) -> Result { FunctionArg::ExprNamed { arg, .. } => arg, }) .collect::>(); - Ok( - match ( - function_name.as_str(), - args.as_slice(), - distinct, - ) { - ("sum", [FunctionArgExpr::Expr(ref expr)], false) => { - apply_window_spec(parse_sql_expr(expr)?, sql_function.over.as_ref())?.sum() - } - ("count", [FunctionArgExpr::Expr(ref expr)], false) => { - apply_window_spec(parse_sql_expr(expr)?, sql_function.over.as_ref())?.count() - } - ("count", [FunctionArgExpr::Expr(ref expr)], true) => { - apply_window_spec(parse_sql_expr(expr)?, sql_function.over.as_ref())?.n_unique() - } - // Special case for wildcard args to count function. - ("count", [FunctionArgExpr::Wildcard], false) => lit(1i32).count(), - _ => { - return Err(PolarsError::ComputeError( - format!( - "Function {function_name:?} with args {args:?} was not supported in polars-sql yet!" - ) - .into(), - )) - } - }, - ) + Ok(match (function_name.as_str(), args.as_slice(), distinct) { + ("sum", [FunctionArgExpr::Expr(expr)], false) => { + apply_window_spec(parse_sql_expr(expr)?, sql_function.over.as_ref())?.sum() + } + ("count", [FunctionArgExpr::Expr(expr)], false) => { + apply_window_spec(parse_sql_expr(expr)?, sql_function.over.as_ref())?.count() + } + ("count", [FunctionArgExpr::Expr(expr)], true) => { + apply_window_spec(parse_sql_expr(expr)?, sql_function.over.as_ref())?.n_unique() + } + // Special case for wildcard args to count function. + ("count", [FunctionArgExpr::Wildcard], false) => lit(1i32).count(), + _ => return Err(PolarsError::ComputeError( + format!( + "Function {function_name:?} with args {args:?} was not supported in polars-sql yet!" + ) + .into(), + )), + }) } diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/struct_json_encode.rs b/crates/nu_plugin_polars/src/dataframe/command/data/struct_json_encode.rs index a6d60f5a11..97e9368d91 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/struct_json_encode.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/struct_json_encode.rs @@ -3,8 +3,8 @@ use nu_protocol::{Category, Example, LabeledError, PipelineData, Signature, Span use polars::df; use crate::{ - values::{CustomValueSupport, NuDataFrame, NuExpression}, PolarsPlugin, + values::{CustomValueSupport, NuDataFrame, NuExpression}, }; #[derive(Clone)] diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/take.rs b/crates/nu_plugin_polars/src/dataframe/command/data/take.rs index 368c6337b2..bf63a4b670 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/take.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/take.rs @@ -5,7 +5,7 @@ use nu_protocol::{ }; use polars::prelude::DataType; -use crate::{dataframe::values::Column, values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, dataframe::values::Column, values::CustomValueSupport}; use crate::values::NuDataFrame; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/unique.rs b/crates/nu_plugin_polars/src/dataframe/command/data/unique.rs index 142039e973..566741741e 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/unique.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/unique.rs @@ -1,10 +1,10 @@ use crate::{ + PolarsPlugin, dataframe::{ utils::{extract_sm_strs, extract_strings}, values::NuLazyFrame, }, - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, - PolarsPlugin, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use crate::values::{Column, NuDataFrame}; @@ -77,16 +77,16 @@ impl PluginCommand for Unique { vec![ Column::new( "a".to_string(), - vec![Value::test_int(1), Value::test_int(2)] + vec![Value::test_int(1), Value::test_int(2)], ), Column::new( "b".to_string(), - vec![Value::test_int(2), Value::test_int(2)] + vec![Value::test_int(2), Value::test_int(2)], ), Column::new( "c".to_string(), - vec![Value::test_int(1), Value::test_int(2)] - ) + vec![Value::test_int(1), Value::test_int(2)], + ), ], None, ) @@ -105,16 +105,16 @@ impl PluginCommand for Unique { vec![ Column::new( "a".to_string(), - vec![Value::test_int(2), Value::test_int(3)] + vec![Value::test_int(2), Value::test_int(3)], ), Column::new( "b".to_string(), - vec![Value::test_int(2), Value::test_int(2)] + vec![Value::test_int(2), Value::test_int(2)], ), Column::new( "c".to_string(), - vec![Value::test_int(2), Value::test_int(1)] - ) + vec![Value::test_int(2), Value::test_int(1)], + ), ], None, ) diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/unnest.rs b/crates/nu_plugin_polars/src/dataframe/command/data/unnest.rs index 585bb28fc5..59c86bec2d 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/unnest.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/unnest.rs @@ -5,8 +5,8 @@ use nu_protocol::{ use polars::df; use crate::{ - values::{CustomValueSupport, NuLazyFrame, PolarsPluginObject}, PolarsPlugin, + values::{CustomValueSupport, NuLazyFrame, PolarsPluginObject}, }; use crate::values::NuDataFrame; diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/unpivot.rs b/crates/nu_plugin_polars/src/dataframe/command/data/unpivot.rs index 77ca9973c5..4fe4c70ca5 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/unpivot.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/unpivot.rs @@ -7,9 +7,9 @@ use polars::{frame::explode::UnpivotArgsIR, prelude::UnpivotArgsDSL}; use polars_ops::pivot::UnpivotDF; use crate::{ - dataframe::values::utils::convert_columns_string, - values::{utils::convert_columns_sm_str, CustomValueSupport, NuLazyFrame, PolarsPluginObject}, PolarsPlugin, + dataframe::values::utils::convert_columns_string, + values::{CustomValueSupport, NuLazyFrame, PolarsPluginObject, utils::convert_columns_sm_str}, }; use crate::values::{Column, NuDataFrame}; @@ -65,114 +65,118 @@ impl PluginCommand for Unpivot { vec![ Example { description: "unpivot on an eager dataframe", - example: - "[[a b c d]; [x 1 4 a] [y 2 5 b] [z 3 6 c]] | polars into-df | polars unpivot -i [b c] -o [a d]", + example: "[[a b c d]; [x 1 4 a] [y 2 5 b] [z 3 6 c]] | polars into-df | polars unpivot -i [b c] -o [a d]", result: Some( - NuDataFrame::try_from_columns(vec![ - Column::new( - "b".to_string(), - vec![ - Value::test_int(1), - Value::test_int(2), - Value::test_int(3), - Value::test_int(1), - Value::test_int(2), - Value::test_int(3), - ], - ), - Column::new( - "c".to_string(), - vec![ - Value::test_int(4), - Value::test_int(5), - Value::test_int(6), - Value::test_int(4), - Value::test_int(5), - Value::test_int(6), - ], - ), - Column::new( - "variable".to_string(), - vec![ - Value::test_string("a"), - Value::test_string("a"), - Value::test_string("a"), - Value::test_string("d"), - Value::test_string("d"), - Value::test_string("d"), - ], - ), - Column::new( - "value".to_string(), - vec![ - Value::test_string("x"), - Value::test_string("y"), - Value::test_string("z"), - Value::test_string("a"), - Value::test_string("b"), - Value::test_string("c"), - ], - ), - ], None) + NuDataFrame::try_from_columns( + vec![ + Column::new( + "b".to_string(), + vec![ + Value::test_int(1), + Value::test_int(2), + Value::test_int(3), + Value::test_int(1), + Value::test_int(2), + Value::test_int(3), + ], + ), + Column::new( + "c".to_string(), + vec![ + Value::test_int(4), + Value::test_int(5), + Value::test_int(6), + Value::test_int(4), + Value::test_int(5), + Value::test_int(6), + ], + ), + Column::new( + "variable".to_string(), + vec![ + Value::test_string("a"), + Value::test_string("a"), + Value::test_string("a"), + Value::test_string("d"), + Value::test_string("d"), + Value::test_string("d"), + ], + ), + Column::new( + "value".to_string(), + vec![ + Value::test_string("x"), + Value::test_string("y"), + Value::test_string("z"), + Value::test_string("a"), + Value::test_string("b"), + Value::test_string("c"), + ], + ), + ], + None, + ) .expect("simple df for test should not fail") .into_value(Span::test_data()), ), }, Example { description: "unpivot on a lazy dataframe", - example: - "[[a b c d]; [x 1 4 a] [y 2 5 b] [z 3 6 c]] | polars into-lazy | polars unpivot -i [b c] -o [a d] | polars collect", + example: "[[a b c d]; [x 1 4 a] [y 2 5 b] [z 3 6 c]] | polars into-lazy | polars unpivot -i [b c] -o [a d] | polars collect", result: Some( - NuDataFrame::try_from_columns(vec![ - Column::new( - "b".to_string(), - vec![ - Value::test_int(1), - Value::test_int(2), - Value::test_int(3), - Value::test_int(1), - Value::test_int(2), - Value::test_int(3), - ], - ), - Column::new( - "c".to_string(), - vec![ - Value::test_int(4), - Value::test_int(5), - Value::test_int(6), - Value::test_int(4), - Value::test_int(5), - Value::test_int(6), - ], - ), - Column::new( - "variable".to_string(), - vec![ - Value::test_string("a"), - Value::test_string("a"), - Value::test_string("a"), - Value::test_string("d"), - Value::test_string("d"), - Value::test_string("d"), - ], - ), - Column::new( - "value".to_string(), - vec![ - Value::test_string("x"), - Value::test_string("y"), - Value::test_string("z"), - Value::test_string("a"), - Value::test_string("b"), - Value::test_string("c"), - ], - ), - ], None) + NuDataFrame::try_from_columns( + vec![ + Column::new( + "b".to_string(), + vec![ + Value::test_int(1), + Value::test_int(2), + Value::test_int(3), + Value::test_int(1), + Value::test_int(2), + Value::test_int(3), + ], + ), + Column::new( + "c".to_string(), + vec![ + Value::test_int(4), + Value::test_int(5), + Value::test_int(6), + Value::test_int(4), + Value::test_int(5), + Value::test_int(6), + ], + ), + Column::new( + "variable".to_string(), + vec![ + Value::test_string("a"), + Value::test_string("a"), + Value::test_string("a"), + Value::test_string("d"), + Value::test_string("d"), + Value::test_string("d"), + ], + ), + Column::new( + "value".to_string(), + vec![ + Value::test_string("x"), + Value::test_string("y"), + Value::test_string("z"), + Value::test_string("a"), + Value::test_string("b"), + Value::test_string("c"), + ], + ), + ], + None, + ) .expect("simple df for test should not fail") .into_value(Span::test_data()), ), - } + }, ] } diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/with_column.rs b/crates/nu_plugin_polars/src/dataframe/command/data/with_column.rs index fba10c02a0..b8dcc12ed9 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/with_column.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/with_column.rs @@ -1,8 +1,8 @@ use crate::values::{Column, NuDataFrame}; use crate::{ + PolarsPlugin, dataframe::values::{NuExpression, NuLazyFrame}, values::{CustomValueSupport, PolarsPluginObject}, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/as_date.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/as_date.rs index eb9c056309..8cd8f502a6 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/as_date.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/as_date.rs @@ -1,19 +1,19 @@ use crate::{ - values::{ - cant_convert_err, Column, CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, - NuSchema, PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + Column, CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, NuSchema, + PolarsPluginObject, PolarsPluginType, cant_convert_err, + }, }; use chrono::DateTime; use std::sync::Arc; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ - record, Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, - SyntaxShape, Type, Value, + Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, + Value, record, }; -use polars::prelude::{col, DataType, Field, IntoSeries, Schema, StringMethods, StrptimeOptions}; +use polars::prelude::{DataType, Field, IntoSeries, Schema, StringMethods, StrptimeOptions, col}; #[derive(Clone)] pub struct AsDate; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/as_datetime.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/as_datetime.rs index c06a349496..fccce2b9e1 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/as_datetime.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/as_datetime.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, Column, CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, - NuSchema, PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + Column, CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, NuSchema, + PolarsPluginObject, PolarsPluginType, cant_convert_err, + }, }; use chrono::DateTime; use std::sync::Arc; @@ -14,8 +14,8 @@ use nu_protocol::{ Value, }; use polars::prelude::{ - col, DataType, Expr, Field, IntoSeries, LiteralValue, PlSmallStr, Schema, StringMethods, - StrptimeOptions, TimeUnit, + DataType, Expr, Field, IntoSeries, LiteralValue, PlSmallStr, Schema, StringMethods, + StrptimeOptions, TimeUnit, col, }; #[derive(Clone)] @@ -138,10 +138,7 @@ impl PluginCommand for AsDateTime { Some(NuSchema::new(Arc::new(Schema::from_iter(vec![ Field::new( "datetime".into(), - DataType::Datetime( - TimeUnit::Nanoseconds, - None - ), + DataType::Datetime(TimeUnit::Nanoseconds, None), ), ])))), ) @@ -156,24 +153,19 @@ impl PluginCommand for AsDateTime { NuDataFrame::try_from_columns( vec![Column::new( "datetime".to_string(), - vec![ - Value::date( - DateTime::parse_from_str( - "2021-12-30 00:00:00 +0000", - "%Y-%m-%d %H:%M:%S %z", - ) - .expect("date calculation should not fail in test"), - Span::test_data(), - ), - ], + vec![Value::date( + DateTime::parse_from_str( + "2021-12-30 00:00:00 +0000", + "%Y-%m-%d %H:%M:%S %z", + ) + .expect("date calculation should not fail in test"), + Span::test_data(), + )], )], Some(NuSchema::new(Arc::new(Schema::from_iter(vec![ Field::new( "datetime".into(), - DataType::Datetime( - TimeUnit::Nanoseconds, - None - ), + DataType::Datetime(TimeUnit::Nanoseconds, None), ), ])))), ) @@ -197,7 +189,6 @@ impl PluginCommand for AsDateTime { .expect("date calculation should not fail in test"), Span::test_data(), ), - Value::date( DateTime::parse_from_str( "2025-11-02 01:00:00 +0000", @@ -227,10 +218,7 @@ impl PluginCommand for AsDateTime { Some(NuSchema::new(Arc::new(Schema::from_iter(vec![ Field::new( "datetime".into(), - DataType::Datetime( - TimeUnit::Nanoseconds, - None - ), + DataType::Datetime(TimeUnit::Nanoseconds, None), ), ])))), ) diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/convert_time_zone.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/convert_time_zone.rs index 3572578b42..ccf641d3db 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/convert_time_zone.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/convert_time_zone.rs @@ -1,8 +1,8 @@ use crate::values::{Column, NuDataFrame, NuSchema}; use crate::{ - dataframe::values::NuExpression, - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, PolarsPlugin, + dataframe::values::NuExpression, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/datepart.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/datepart.rs index 1e18639d06..995c7ebbee 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/datepart.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/datepart.rs @@ -2,9 +2,9 @@ use crate::values::NuExpression; use std::sync::Arc; use crate::{ + PolarsPlugin, dataframe::values::{Column, NuDataFrame, NuSchema}, values::CustomValueSupport, - PolarsPlugin, }; use chrono::{DateTime, FixedOffset}; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_day.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_day.rs index cc5466a200..edf42364a6 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_day.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_day.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, - PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, PolarsPluginObject, + PolarsPluginType, cant_convert_err, + }, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -11,7 +11,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, }; use polars::{ - prelude::{col, DatetimeMethods, IntoSeries, NamedFrom}, + prelude::{DatetimeMethods, IntoSeries, NamedFrom, col}, series::Series, }; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_hour.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_hour.rs index 44db47acc5..f1d930fa31 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_hour.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_hour.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuExpression, NuLazyFrame, PolarsPluginObject, - PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuExpression, NuLazyFrame, PolarsPluginObject, PolarsPluginType, + cant_convert_err, + }, }; use super::super::super::values::NuDataFrame; @@ -13,7 +13,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, }; use polars::{ - prelude::{col, DatetimeMethods, IntoSeries, NamedFrom}, + prelude::{DatetimeMethods, IntoSeries, NamedFrom, col}, series::Series, }; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_minute.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_minute.rs index f52b0b5033..145adf7759 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_minute.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_minute.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, - PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, PolarsPluginObject, + PolarsPluginType, cant_convert_err, + }, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -11,7 +11,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, }; use polars::{ - prelude::{col, DatetimeMethods, IntoSeries, NamedFrom}, + prelude::{DatetimeMethods, IntoSeries, NamedFrom, col}, series::Series, }; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_month.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_month.rs index d52d281148..8f992026b6 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_month.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_month.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, - PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, PolarsPluginObject, + PolarsPluginType, cant_convert_err, + }, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -11,7 +11,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, }; use polars::{ - prelude::{col, DatetimeMethods, IntoSeries, NamedFrom}, + prelude::{DatetimeMethods, IntoSeries, NamedFrom, col}, series::Series, }; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_nanosecond.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_nanosecond.rs index 8db9cf30ee..ce0274b85f 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_nanosecond.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_nanosecond.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, - PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, PolarsPluginObject, + PolarsPluginType, cant_convert_err, + }, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -11,7 +11,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, }; use polars::{ - prelude::{col, DatetimeMethods, IntoSeries, NamedFrom}, + prelude::{DatetimeMethods, IntoSeries, NamedFrom, col}, series::Series, }; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_ordinal.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_ordinal.rs index c49b3c74fc..c19c9e7585 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_ordinal.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_ordinal.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, - PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, PolarsPluginObject, + PolarsPluginType, cant_convert_err, + }, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -11,7 +11,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, }; use polars::{ - prelude::{col, DatetimeMethods, IntoSeries, NamedFrom}, + prelude::{DatetimeMethods, IntoSeries, NamedFrom, col}, series::Series, }; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_second.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_second.rs index 4ffa7e7da1..9ab11ff15a 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_second.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_second.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, - PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, PolarsPluginObject, + PolarsPluginType, cant_convert_err, + }, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -11,7 +11,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, }; use polars::{ - prelude::{col, DatetimeMethods, IntoSeries, NamedFrom}, + prelude::{DatetimeMethods, IntoSeries, NamedFrom, col}, series::Series, }; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_week.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_week.rs index 3d3802d9a0..3793a55828 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_week.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_week.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, - PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, PolarsPluginObject, + PolarsPluginType, cant_convert_err, + }, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -11,7 +11,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, }; use polars::{ - prelude::{col, DatetimeMethods, IntoSeries, NamedFrom}, + prelude::{DatetimeMethods, IntoSeries, NamedFrom, col}, series::Series, }; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_weekday.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_weekday.rs index 73c2348a4e..f73a088b55 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_weekday.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_weekday.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, - PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, PolarsPluginObject, + PolarsPluginType, cant_convert_err, + }, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -11,7 +11,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, }; use polars::{ - prelude::{col, DatetimeMethods, IntoSeries, NamedFrom}, + prelude::{DatetimeMethods, IntoSeries, NamedFrom, col}, series::Series, }; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_year.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_year.rs index 16205bbbf9..1c1a561846 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/get_year.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/get_year.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, - PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuDataFrame, NuExpression, NuLazyFrame, PolarsPluginObject, + PolarsPluginType, cant_convert_err, + }, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -11,7 +11,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, Type, }; use polars::{ - prelude::{col, DatetimeMethods, IntoSeries, NamedFrom}, + prelude::{DatetimeMethods, IntoSeries, NamedFrom, col}, series::Series, }; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/replace_time_zone.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/replace_time_zone.rs index 03af97e7e5..5ea5160bc9 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/replace_time_zone.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/replace_time_zone.rs @@ -1,8 +1,8 @@ use crate::values::{Column, NuDataFrame, NuSchema}; use crate::{ - dataframe::values::NuExpression, - values::{cant_convert_err, CustomValueSupport, PolarsPluginObject, PolarsPluginType}, PolarsPlugin, + dataframe::values::NuExpression, + values::{CustomValueSupport, PolarsPluginObject, PolarsPluginType, cant_convert_err}, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/strftime.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/strftime.rs index ed48b9b905..12866d0511 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/strftime.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/strftime.rs @@ -1,8 +1,8 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, + }, }; use super::super::super::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/datetime/truncate.rs b/crates/nu_plugin_polars/src/dataframe/command/datetime/truncate.rs index 96c47d4129..8b0afca537 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/datetime/truncate.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/datetime/truncate.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, Column, CustomValueSupport, NuDataFrame, NuExpression, NuSchema, - PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + Column, CustomValueSupport, NuDataFrame, NuExpression, NuSchema, PolarsPluginObject, + PolarsPluginType, cant_convert_err, + }, }; use std::sync::Arc; diff --git a/crates/nu_plugin_polars/src/dataframe/command/index/arg_max.rs b/crates/nu_plugin_polars/src/dataframe/command/index/arg_max.rs index 62294359fe..7b1fbb51b2 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/index/arg_max.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/index/arg_max.rs @@ -1,4 +1,4 @@ -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use crate::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/index/arg_min.rs b/crates/nu_plugin_polars/src/dataframe/command/index/arg_min.rs index bc0c29409b..d276bd24ee 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/index/arg_min.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/index/arg_min.rs @@ -1,4 +1,4 @@ -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use crate::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/index/arg_sort.rs b/crates/nu_plugin_polars/src/dataframe/command/index/arg_sort.rs index 9c01353e34..e1c1214641 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/index/arg_sort.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/index/arg_sort.rs @@ -1,4 +1,4 @@ -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use super::super::super::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/index/arg_unique.rs b/crates/nu_plugin_polars/src/dataframe/command/index/arg_unique.rs index 8e527e6620..e3481c5c0a 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/index/arg_unique.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/index/arg_unique.rs @@ -1,4 +1,4 @@ -use crate::{values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, values::CustomValueSupport}; use super::super::super::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/index/set_with_idx.rs b/crates/nu_plugin_polars/src/dataframe/command/index/set_with_idx.rs index 06f64b4271..995148d370 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/index/set_with_idx.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/index/set_with_idx.rs @@ -1,4 +1,4 @@ -use crate::{missing_flag_error, values::CustomValueSupport, PolarsPlugin}; +use crate::{PolarsPlugin, missing_flag_error, values::CustomValueSupport}; use super::super::super::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/integer/to_decimal.rs b/crates/nu_plugin_polars/src/dataframe/command/integer/to_decimal.rs index 92469aa10b..25e45d5760 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/integer/to_decimal.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/integer/to_decimal.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, Column, CustomValueSupport, NuDataFrame, NuExpression, - PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + Column, CustomValueSupport, NuDataFrame, NuExpression, PolarsPluginObject, + PolarsPluginType, cant_convert_err, + }, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -51,12 +51,7 @@ impl PluginCommand for ToDecimal { example: "[[a b]; [1, '2.4']] | polars into-df | polars select (polars col b | polars decimal 2) | polars collect", result: Some( NuDataFrame::try_from_columns( - vec![Column::new( - "b".to_string(), - vec![ - Value::test_float(2.40), - ], - )], + vec![Column::new("b".to_string(), vec![Value::test_float(2.40)])], None, ) .expect("simple df for test should not fail") diff --git a/crates/nu_plugin_polars/src/dataframe/command/integer/to_integer.rs b/crates/nu_plugin_polars/src/dataframe/command/integer/to_integer.rs index 9d1df4aa00..be0cfd7420 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/integer/to_integer.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/integer/to_integer.rs @@ -1,9 +1,9 @@ use crate::{ - values::{ - cant_convert_err, Column, CustomValueSupport, NuDataFrame, NuExpression, - PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + Column, CustomValueSupport, NuDataFrame, NuExpression, PolarsPluginObject, + PolarsPluginType, cant_convert_err, + }, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; @@ -45,12 +45,7 @@ impl PluginCommand for ToInteger { example: "[[a b]; [1, '2']] | polars into-df | polars select (polars col b | polars integer) | polars collect", result: Some( NuDataFrame::try_from_columns( - vec![Column::new( - "b".to_string(), - vec![ - Value::test_int(2), - ], - )], + vec![Column::new("b".to_string(), vec![Value::test_int(2)])], None, ) .expect("simple df for test should not fail") diff --git a/crates/nu_plugin_polars/src/dataframe/command/list/contains.rs b/crates/nu_plugin_polars/src/dataframe/command/list/contains.rs index 16902541c8..4e4cb61dc8 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/list/contains.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/list/contains.rs @@ -1,8 +1,8 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, + }, }; use super::super::super::values::{Column, NuDataFrame}; @@ -142,7 +142,7 @@ fn command_expr( span: Some(call.head), help: None, inner: vec![], - }) + }); } }; let res: NuExpression = expr.into_polars().list().contains(single_expression).into(); diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/concat_str.rs b/crates/nu_plugin_polars/src/dataframe/command/string/concat_str.rs index 3dd3e4f6ae..697a9a09a5 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/concat_str.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/concat_str.rs @@ -1,7 +1,7 @@ use crate::{ + PolarsPlugin, dataframe::values::{Column, NuDataFrame, NuExpression}, values::CustomValueSupport, - PolarsPlugin, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; use nu_protocol::{ diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/contains.rs b/crates/nu_plugin_polars/src/dataframe/command/string/contains.rs index 551f32a744..1b51a5e887 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/contains.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/contains.rs @@ -1,8 +1,8 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, + }, }; use super::super::super::values::{Column, NuDataFrame}; @@ -12,7 +12,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value, }; -use polars::prelude::{lit, IntoSeries, StringNameSpaceImpl}; +use polars::prelude::{IntoSeries, StringNameSpaceImpl, lit}; #[derive(Clone)] pub struct Contains; diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/replace.rs b/crates/nu_plugin_polars/src/dataframe/command/string/replace.rs index 3eeaf4f43c..e43540bb66 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/replace.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/replace.rs @@ -1,9 +1,8 @@ use crate::{ - missing_flag_error, + PolarsPlugin, missing_flag_error, values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, }, - PolarsPlugin, }; use super::super::super::values::{Column, NuDataFrame}; @@ -13,7 +12,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value, }; -use polars::prelude::{lit, IntoSeries, StringNameSpaceImpl}; +use polars::prelude::{IntoSeries, StringNameSpaceImpl, lit}; #[derive(Clone)] pub struct Replace; @@ -60,16 +59,12 @@ impl PluginCommand for Replace { vec![ Example { description: "Replaces string in column", - example: - "[[a]; [abc] [abcabc]] | polars into-df | polars select (polars col a | polars replace --pattern ab --replace AB) | polars collect", + example: "[[a]; [abc] [abcabc]] | polars into-df | polars select (polars col a | polars replace --pattern ab --replace AB) | polars collect", result: Some( NuDataFrame::try_from_columns( vec![Column::new( "a".to_string(), - vec![ - Value::test_string("ABc"), - Value::test_string("ABcabc"), - ], + vec![Value::test_string("ABc"), Value::test_string("ABcabc")], )], None, ) @@ -79,8 +74,7 @@ impl PluginCommand for Replace { }, Example { description: "Replaces string", - example: - "[abc abc abc] | polars into-df | polars replace --pattern ab --replace AB", + example: "[abc abc abc] | polars into-df | polars replace --pattern ab --replace AB", result: Some( NuDataFrame::try_from_columns( vec![Column::new( diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/replace_all.rs b/crates/nu_plugin_polars/src/dataframe/command/string/replace_all.rs index 25dfb24de2..db9e06e5da 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/replace_all.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/replace_all.rs @@ -1,9 +1,8 @@ use crate::{ - missing_flag_error, + PolarsPlugin, missing_flag_error, values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, }, - PolarsPlugin, }; use super::super::super::values::{Column, NuDataFrame}; @@ -13,7 +12,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value, }; -use polars::prelude::{lit, IntoSeries, StringNameSpaceImpl}; +use polars::prelude::{IntoSeries, StringNameSpaceImpl, lit}; #[derive(Clone)] pub struct ReplaceAll; @@ -60,8 +59,7 @@ impl PluginCommand for ReplaceAll { vec![ Example { description: "Replaces string in a column", - example: - "[[a]; [abac] [abac] [abac]] | polars into-df | polars select (polars col a | polars replace-all --pattern a --replace A) | polars collect", + example: "[[a]; [abac] [abac] [abac]] | polars into-df | polars select (polars col a | polars replace-all --pattern a --replace A) | polars collect", result: Some( NuDataFrame::try_from_columns( vec![Column::new( @@ -80,8 +78,7 @@ impl PluginCommand for ReplaceAll { }, Example { description: "Replaces string", - example: - "[abac abac abac] | polars into-df | polars replace-all --pattern a --replace A", + example: "[abac abac abac] | polars into-df | polars replace-all --pattern a --replace A", result: Some( NuDataFrame::try_from_columns( vec![Column::new( diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/str_join.rs b/crates/nu_plugin_polars/src/dataframe/command/string/str_join.rs index 120cfa3920..92b87ca3c0 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/str_join.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/str_join.rs @@ -1,8 +1,8 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, + }, }; use super::super::super::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/str_lengths.rs b/crates/nu_plugin_polars/src/dataframe/command/string/str_lengths.rs index 78d8030b06..d56c2a3b06 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/str_lengths.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/str_lengths.rs @@ -1,8 +1,8 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, + }, }; use super::super::super::values::{Column, NuDataFrame}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/str_slice.rs b/crates/nu_plugin_polars/src/dataframe/command/string/str_slice.rs index 02d35e6984..0c75bb8a09 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/str_slice.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/str_slice.rs @@ -1,8 +1,8 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, + }, }; use super::super::super::values::{Column, NuDataFrame}; @@ -13,7 +13,7 @@ use nu_protocol::{ Value, }; use polars::{ - prelude::{lit, Expr, IntoSeries, NamedFrom, Null, StringNameSpaceImpl}, + prelude::{Expr, IntoSeries, NamedFrom, Null, StringNameSpaceImpl, lit}, series::Series, }; diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/str_split.rs b/crates/nu_plugin_polars/src/dataframe/command/string/str_split.rs index 7452b4d9f8..b315b1ce03 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/str_split.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/str_split.rs @@ -1,6 +1,6 @@ use crate::{ - values::{CustomValueSupport, NuDataFrame, NuExpression}, PolarsPlugin, + values::{CustomValueSupport, NuDataFrame, NuExpression}, }; use nu_plugin::{EngineInterface, EvaluatedCall, PluginCommand}; diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/str_strip_chars.rs b/crates/nu_plugin_polars/src/dataframe/command/string/str_strip_chars.rs index ed6a458a93..e2d40ead48 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/str_strip_chars.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/str_strip_chars.rs @@ -1,8 +1,8 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, + }, }; use super::super::super::values::{Column, NuDataFrame}; @@ -66,8 +66,7 @@ impl PluginCommand for StrStripChars { ), }, Example { - description: - "Strip characters from both ends of strings in a column using an expression", + description: "Strip characters from both ends of strings in a column using an expression", example: r#"[[text]; ["!!!hello!!!"] ["!!!world!!!"] ["!!!test!!!"]] | polars into-df | polars select (polars col text | polars str-strip-chars (polars lit "!")) | polars collect"#, result: Some( NuDataFrame::try_from_columns( diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/to_lowercase.rs b/crates/nu_plugin_polars/src/dataframe/command/string/to_lowercase.rs index 042341cc9f..e06299cf25 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/to_lowercase.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/to_lowercase.rs @@ -1,8 +1,8 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, + }, }; use super::super::super::values::{Column, NuDataFrame}; @@ -51,9 +51,7 @@ impl PluginCommand for ToLowerCase { NuDataFrame::try_from_columns( vec![Column::new( "a".to_string(), - vec![ - Value::test_string("abc"), - ], + vec![Value::test_string("abc")], )], None, ) diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/to_uppercase.rs b/crates/nu_plugin_polars/src/dataframe/command/string/to_uppercase.rs index 8b50542fc2..b94b664b06 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/to_uppercase.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/to_uppercase.rs @@ -1,8 +1,8 @@ use crate::{ - values::{ - cant_convert_err, CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, - }, PolarsPlugin, + values::{ + CustomValueSupport, NuExpression, PolarsPluginObject, PolarsPluginType, cant_convert_err, + }, }; use super::super::super::values::{Column, NuDataFrame}; @@ -55,9 +55,7 @@ impl PluginCommand for ToUpperCase { NuDataFrame::try_from_columns( vec![Column::new( "a".to_string(), - vec![ - Value::test_string("ABC"), - ], + vec![Value::test_string("ABC")], )], None, ) diff --git a/crates/nu_plugin_polars/src/dataframe/values/mod.rs b/crates/nu_plugin_polars/src/dataframe/values/mod.rs index 5184049ed7..c9c101515c 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/mod.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/mod.rs @@ -12,7 +12,7 @@ use crate::{Cacheable, PolarsPlugin}; use nu_dtype::custom_value::NuDataTypeCustomValue; use nu_plugin::EngineInterface; use nu_protocol::{ - ast::Operator, CustomValue, PipelineData, ShellError, Span, Spanned, Type, Value, + CustomValue, PipelineData, ShellError, Span, Spanned, Type, Value, ast::Operator, }; use nu_schema::custom_value::NuSchemaCustomValue; use std::{cmp::Ordering, fmt}; diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/between_values.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/between_values.rs index 918276818c..10f945c7b7 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/between_values.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/between_values.rs @@ -1,7 +1,7 @@ -use super::{operations::Axis, NuDataFrame}; +use super::{NuDataFrame, operations::Axis}; use nu_protocol::{ - ast::{Boolean, Comparison, Math, Operator}, ShellError, Span, Spanned, Value, + ast::{Boolean, Comparison, Math, Operator}, }; use num::Zero; use polars::prelude::{ diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/conversion.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/conversion.rs index 0c2e1611fa..591c0fd6eb 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/conversion.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/conversion.rs @@ -5,21 +5,21 @@ use std::sync::Arc; use chrono::{DateTime, Duration, FixedOffset, NaiveDate, NaiveDateTime, NaiveTime, TimeZone, Utc}; use chrono_tz::Tz; use indexmap::map::{Entry, IndexMap}; +use polars::chunked_array::ChunkedArray; use polars::chunked_array::builder::AnonymousOwnedListBuilder; use polars::chunked_array::object::builder::ObjectChunkedBuilder; -use polars::chunked_array::ChunkedArray; use polars::datatypes::{AnyValue, PlSmallStr}; use polars::prelude::{ ChunkAnyValue, Column as PolarsColumn, DataFrame, DataType, DatetimeChunked, Float32Type, - Float64Type, Int16Type, Int32Type, Int64Type, Int8Type, IntoSeries, ListBooleanChunkedBuilder, + Float64Type, Int8Type, Int16Type, Int32Type, Int64Type, IntoSeries, ListBooleanChunkedBuilder, ListBuilderTrait, ListPrimitiveChunkedBuilder, ListStringChunkedBuilder, ListType, LogicalType, NamedFrom, NewChunkedArray, ObjectType, PolarsError, Schema, SchemaExt, Series, StructChunked, - TemporalMethods, TimeUnit, UInt16Type, UInt32Type, UInt64Type, UInt8Type, + TemporalMethods, TimeUnit, UInt8Type, UInt16Type, UInt32Type, UInt64Type, }; use nu_protocol::{Record, ShellError, Span, Value}; -use polars_arrow::array::Utf8ViewArray; use polars_arrow::Either; +use polars_arrow::array::Utf8ViewArray; use crate::dataframe::values::NuSchema; diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/custom_value.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/custom_value.rs index 5913ba56d3..08ee9a8407 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/custom_value.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/custom_value.rs @@ -6,8 +6,8 @@ use serde::{Deserialize, Serialize}; use uuid::Uuid; use crate::{ - values::{CustomValueSupport, PolarsPluginCustomValue}, Cacheable, PolarsPlugin, + values::{CustomValueSupport, PolarsPluginCustomValue}, }; use super::NuDataFrame; diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/mod.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/mod.rs index e4191012c7..e5362c7402 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/mod.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/mod.rs @@ -7,11 +7,11 @@ pub use conversion::{Column, ColumnMap}; pub use operations::Axis; use indexmap::map::IndexMap; -use nu_protocol::{did_you_mean, PipelineData, Record, ShellError, Span, Value}; +use nu_protocol::{PipelineData, Record, ShellError, Span, Value, did_you_mean}; use polars::prelude::{ Column as PolarsColumn, DataFrame, DataType, IntoLazy, PolarsObject, Series, }; -use polars_plan::prelude::{lit, Expr, Null}; +use polars_plan::prelude::{Expr, Null, lit}; use polars_utils::total_ord::{TotalEq, TotalHash}; use std::fmt; use std::{ @@ -28,8 +28,8 @@ use crate::{Cacheable, PolarsPlugin}; pub use self::custom_value::NuDataFrameCustomValue; use super::{ - cant_convert_err, nu_schema::NuSchema, utils::DEFAULT_ROWS, CustomValueSupport, NuLazyFrame, - PolarsPluginObject, PolarsPluginType, + CustomValueSupport, NuLazyFrame, PolarsPluginObject, PolarsPluginType, cant_convert_err, + nu_schema::NuSchema, utils::DEFAULT_ROWS, }; // DataFrameValue is an encapsulation of Nushell Value that can be used diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/operations.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/operations.rs index 11753f87ab..35ed9102d2 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/operations.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/operations.rs @@ -1,8 +1,8 @@ -use nu_protocol::{ast::Operator, ShellError, Span, Spanned, Value}; +use nu_protocol::{ShellError, Span, Spanned, Value, ast::Operator}; use polars::prelude::{Column as PolarsColumn, DataFrame}; -use crate::values::CustomValueSupport; use crate::PolarsPlugin; +use crate::values::CustomValueSupport; use super::between_values::{ between_dataframes, compute_between_series, compute_series_single_value, diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_dtype/mod.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_dtype/mod.rs index aacc2aee58..385645405f 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_dtype/mod.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_dtype/mod.rs @@ -1,7 +1,7 @@ pub mod custom_value; use custom_value::NuDataTypeCustomValue; -use nu_protocol::{record, ShellError, Span, Value}; +use nu_protocol::{ShellError, Span, Value, record}; use polars::prelude::{DataType, Field, PlSmallStr, TimeUnit, UnknownKind}; use uuid::Uuid; @@ -330,6 +330,28 @@ fn str_to_time_unit(ts_string: &str, span: Span) -> Result pub(crate) fn dtype_to_value(dtype: &DataType, span: Span) -> Value { match dtype { DataType::Struct(fields) => fields_to_value(fields.iter().cloned(), span), + DataType::Enum(_, _) => Value::list( + get_categories(dtype) + .unwrap_or_default() + .iter() + .map(|s| Value::string(s, span)) + .collect(), + span, + ), _ => Value::string(dtype.to_string().replace('[', "<").replace(']', ">"), span), } } + +pub(super) fn get_categories(dtype: &DataType) -> Option> { + if let DataType::Enum(Some(rev_mapping), _) = dtype { + Some( + rev_mapping + .get_categories() + .iter() + .filter_map(|v| v.map(ToString::to_string)) + .collect::>(), + ) + } else { + None + } +} diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_expression/custom_value.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_expression/custom_value.rs index d028d513fa..71ddf50bad 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_expression/custom_value.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_expression/custom_value.rs @@ -1,14 +1,14 @@ use crate::{ - values::{CustomValueSupport, PolarsPluginCustomValue}, Cacheable, PolarsPlugin, + values::{CustomValueSupport, PolarsPluginCustomValue}, }; use std::ops::{Add, Div, Mul, Rem, Sub}; use super::NuExpression; use nu_plugin::EngineInterface; use nu_protocol::{ - ast::{Boolean, Comparison, Math, Operator}, CustomValue, ShellError, Span, Type, Value, + ast::{Boolean, Comparison, Math, Operator}, }; use polars::prelude::Expr; use serde::{Deserialize, Serialize}; diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_expression/mod.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_expression/mod.rs index 6db1fe1434..60474139a6 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_expression/mod.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_expression/mod.rs @@ -1,9 +1,9 @@ mod custom_value; -use nu_protocol::{record, ShellError, Span, Value}; +use nu_protocol::{ShellError, Span, Value, record}; use polars::{ chunked_array::cast::CastOptions, - prelude::{col, AggExpr, Expr, Literal}, + prelude::{AggExpr, Expr, Literal, col}, }; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use uuid::Uuid; diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_lazyframe/custom_value.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_lazyframe/custom_value.rs index abce1a9e7b..b61e83517f 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_lazyframe/custom_value.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_lazyframe/custom_value.rs @@ -6,8 +6,8 @@ use serde::{Deserialize, Serialize}; use uuid::Uuid; use crate::{ - values::{CustomValueSupport, NuDataFrame, PolarsPluginCustomValue}, Cacheable, PolarsPlugin, + values::{CustomValueSupport, NuDataFrame, PolarsPluginCustomValue}, }; use super::NuLazyFrame; diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_lazyframe/mod.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_lazyframe/mod.rs index 679c913eb6..7409654b4c 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_lazyframe/mod.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_lazyframe/mod.rs @@ -3,11 +3,11 @@ mod custom_value; use crate::{Cacheable, PolarsPlugin}; use super::{ - cant_convert_err, CustomValueSupport, NuDataFrame, NuExpression, NuSchema, PolarsPluginObject, - PolarsPluginType, + CustomValueSupport, NuDataFrame, NuExpression, NuSchema, PolarsPluginObject, PolarsPluginType, + cant_convert_err, }; use core::fmt; -use nu_protocol::{record, PipelineData, ShellError, Span, Value}; +use nu_protocol::{PipelineData, ShellError, Span, Value, record}; use polars::prelude::{Expr, IntoLazy, LazyFrame}; use std::sync::Arc; use uuid::Uuid; diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_lazygroupby/mod.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_lazygroupby/mod.rs index 8540d13c6f..6454208700 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_lazygroupby/mod.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_lazygroupby/mod.rs @@ -1,7 +1,7 @@ mod custom_value; use core::fmt; -use nu_protocol::{record, ShellError, Span, Value}; +use nu_protocol::{ShellError, Span, Value, record}; use polars::prelude::LazyGroupBy; use std::sync::Arc; use uuid::Uuid; diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_schema/mod.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_schema/mod.rs index 87a90f7ac7..84f88b2fff 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_schema/mod.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_schema/mod.rs @@ -10,8 +10,8 @@ use uuid::Uuid; use crate::{Cacheable, PolarsPlugin}; use super::{ - nu_dtype::fields_to_value, str_to_dtype, CustomValueSupport, NuDataType, PolarsPluginObject, - PolarsPluginType, + CustomValueSupport, NuDataType, PolarsPluginObject, PolarsPluginType, + nu_dtype::fields_to_value, str_to_dtype, }; #[derive(Debug, Clone)] diff --git a/crates/nu_plugin_polars/src/lib.rs b/crates/nu_plugin_polars/src/lib.rs index 6a0644c82c..8a75509f47 100644 --- a/crates/nu_plugin_polars/src/lib.rs +++ b/crates/nu_plugin_polars/src/lib.rs @@ -1,6 +1,6 @@ use std::{ cmp::Ordering, - panic::{catch_unwind, AssertUnwindSafe}, + panic::{AssertUnwindSafe, catch_unwind}, }; use cache::cache_commands; @@ -17,7 +17,7 @@ mod cache; mod cloud; pub mod dataframe; pub use dataframe::*; -use nu_protocol::{ast::Operator, CustomValue, LabeledError, ShellError, Span, Spanned, Value}; +use nu_protocol::{CustomValue, LabeledError, ShellError, Span, Spanned, Value, ast::Operator}; use tokio::runtime::Runtime; use values::CustomValueType; @@ -276,7 +276,7 @@ pub mod test { use super::*; use crate::values::PolarsPluginObject; use nu_plugin_test_support::PluginTest; - use nu_protocol::{engine::Command, ShellError, Span}; + use nu_protocol::{ShellError, Span, engine::Command}; impl PolarsPlugin { /// Creates a new polars plugin in test mode diff --git a/crates/nu_plugin_polars/src/main.rs b/crates/nu_plugin_polars/src/main.rs index 850d5abf38..a63bab32ba 100644 --- a/crates/nu_plugin_polars/src/main.rs +++ b/crates/nu_plugin_polars/src/main.rs @@ -1,4 +1,4 @@ -use nu_plugin::{serve_plugin, MsgPackSerializer}; +use nu_plugin::{MsgPackSerializer, serve_plugin}; use nu_plugin_polars::PolarsPlugin; fn main() { diff --git a/crates/nu_plugin_query/Cargo.toml b/crates/nu_plugin_query/Cargo.toml index f463d77d6d..22576d2c54 100644 --- a/crates/nu_plugin_query/Cargo.toml +++ b/crates/nu_plugin_query/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "A Nushell plugin to query JSON, XML, and various web data" repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_query" -edition = "2021" +edition = "2024" license = "MIT" name = "nu_plugin_query" version = "0.104.1" @@ -25,4 +25,4 @@ sxd-document = "0.3" sxd-xpath = "0.4" webpage = { version = "2.0.1", features = ["serde"] } serde_json.workspace = true -serde.workspace = true \ No newline at end of file +serde.workspace = true diff --git a/crates/nu_plugin_query/src/lib.rs b/crates/nu_plugin_query/src/lib.rs index 555144d9c7..fe4947394e 100644 --- a/crates/nu_plugin_query/src/lib.rs +++ b/crates/nu_plugin_query/src/lib.rs @@ -6,7 +6,7 @@ mod query_xml; mod web_tables; pub use query::Query; -pub use query_json::{execute_json_query, QueryJson}; -pub use query_web::{parse_selector_params, QueryWeb}; -pub use query_xml::{execute_xpath_query, QueryXml}; +pub use query_json::{QueryJson, execute_json_query}; +pub use query_web::{QueryWeb, parse_selector_params}; +pub use query_xml::{QueryXml, execute_xpath_query}; pub use web_tables::WebTable; diff --git a/crates/nu_plugin_query/src/main.rs b/crates/nu_plugin_query/src/main.rs index e65bd29c6f..b5a29a3161 100644 --- a/crates/nu_plugin_query/src/main.rs +++ b/crates/nu_plugin_query/src/main.rs @@ -1,4 +1,4 @@ -use nu_plugin::{serve_plugin, JsonSerializer}; +use nu_plugin::{JsonSerializer, serve_plugin}; use nu_plugin_query::Query; fn main() { diff --git a/crates/nu_plugin_query/src/query_json.rs b/crates/nu_plugin_query/src/query_json.rs index 3e28cb2f42..d075401cae 100644 --- a/crates/nu_plugin_query/src/query_json.rs +++ b/crates/nu_plugin_query/src/query_json.rs @@ -179,7 +179,7 @@ fn convert_gjson_value_to_nu_value(v: &gjValue, span: Span) -> Value { #[cfg(test)] mod tests { - use gjson::{valid, Value as gjValue}; + use gjson::{Value as gjValue, valid}; #[test] fn validate_string() { diff --git a/crates/nu_plugin_query/src/query_web.rs b/crates/nu_plugin_query/src/query_web.rs index e6723d72f4..b60c0a0ba7 100644 --- a/crates/nu_plugin_query/src/query_web.rs +++ b/crates/nu_plugin_query/src/query_web.rs @@ -1,4 +1,4 @@ -use crate::{web_tables::WebTable, Query}; +use crate::{Query, web_tables::WebTable}; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{ Category, Example, LabeledError, Record, Signature, Span, Spanned, SyntaxShape, Value, @@ -452,15 +452,17 @@ mod tests { #[test] fn test_first_child_is_not_empty() { - assert!(!execute_selector_query( - SIMPLE_LIST, - null_spanned("li:first-child"), - false, - null_spanned(&false), - Span::test_data() + assert!( + !execute_selector_query( + SIMPLE_LIST, + null_spanned("li:first-child"), + false, + null_spanned(&false), + Span::test_data() + ) + .unwrap() + .is_empty() ) - .unwrap() - .is_empty()) } #[test] diff --git a/crates/nu_plugin_query/src/query_xml.rs b/crates/nu_plugin_query/src/query_xml.rs index 5f46ce4355..ae45859ba4 100644 --- a/crates/nu_plugin_query/src/query_xml.rs +++ b/crates/nu_plugin_query/src/query_xml.rs @@ -1,7 +1,7 @@ use crate::Query; use nu_plugin::{EngineInterface, EvaluatedCall, SimplePluginCommand}; use nu_protocol::{ - record, Category, LabeledError, Record, Signature, Span, Spanned, SyntaxShape, Value, + Category, LabeledError, Record, Signature, Span, Spanned, SyntaxShape, Value, record, }; use sxd_document::parser; use sxd_xpath::{Context, Factory}; @@ -48,7 +48,7 @@ pub fn execute_xpath_query( None => { return Err( LabeledError::new("problem with input data").with_label("query missing", call.head) - ) + ); } }; @@ -132,7 +132,7 @@ fn build_xpath(xpath_str: &str, span: Span) -> Result; diff --git a/crates/nu_plugin_stress_internals/Cargo.toml b/crates/nu_plugin_stress_internals/Cargo.toml index 7f4de711c1..89078f75e3 100644 --- a/crates/nu_plugin_stress_internals/Cargo.toml +++ b/crates/nu_plugin_stress_internals/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "A test plugin for Nushell to stress aspects of the internals" repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_stress_internals" -edition = "2021" +edition = "2024" license = "MIT" name = "nu_plugin_stress_internals" version = "0.104.1" @@ -16,4 +16,4 @@ bench = false # assumptions about the serialized format serde = { workspace = true } serde_json = { workspace = true } -interprocess = { workspace = true } \ No newline at end of file +interprocess = { workspace = true } diff --git a/crates/nu_plugin_stress_internals/src/main.rs b/crates/nu_plugin_stress_internals/src/main.rs index 74539a04e0..b2d08924f2 100644 --- a/crates/nu_plugin_stress_internals/src/main.rs +++ b/crates/nu_plugin_stress_internals/src/main.rs @@ -5,10 +5,10 @@ use std::{ }; use interprocess::local_socket::{ - self, traits::Stream, GenericFilePath, GenericNamespaced, ToFsName, ToNsName, + self, GenericFilePath, GenericNamespaced, ToFsName, ToNsName, traits::Stream, }; use serde::Deserialize; -use serde_json::{json, Value}; +use serde_json::{Value, json}; #[derive(Debug)] struct Options { diff --git a/crates/nuon/Cargo.toml b/crates/nuon/Cargo.toml index 000dc59a7e..c45041748f 100644 --- a/crates/nuon/Cargo.toml +++ b/crates/nuon/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Nushell Project Developers"] description = "Support for the NUON format." repository = "https://github.com/nushell/nushell/tree/main/crates/nuon" -edition = "2021" +edition = "2024" license = "MIT" name = "nuon" version = "0.104.1" @@ -19,4 +19,4 @@ nu-utils = { path = "../nu-utils", version = "0.104.1", default-features = false chrono = { workspace = true } [lints] -workspace = true \ No newline at end of file +workspace = true diff --git a/crates/nuon/src/from.rs b/crates/nuon/src/from.rs index 04fec72e3f..a9c505ca8c 100644 --- a/crates/nuon/src/from.rs +++ b/crates/nuon/src/from.rs @@ -1,7 +1,7 @@ use nu_protocol::{ + Filesize, IntoValue, Range, Record, ShellError, Span, Type, Unit, Value, ast::{Expr, Expression, ListItem, RecordItem}, engine::{EngineState, StateWorkingSet}, - Filesize, IntoValue, Range, Record, ShellError, Span, Type, Unit, Value, }; use std::sync::Arc; @@ -282,7 +282,7 @@ fn convert_to_value( error: "Error when loading".into(), msg: "only strings can be keys".into(), span: key.span, - }) + }); } }; @@ -361,7 +361,7 @@ fn convert_to_value( error: "Error when loading".into(), msg: "only strings can be keys".into(), span: expr.span, - }) + }); } }; @@ -408,7 +408,7 @@ fn convert_to_value( error: "Error when loading".into(), msg: "non-integer unit value".into(), span: expr.span, - }) + }); } }; diff --git a/crates/nuon/src/lib.rs b/crates/nuon/src/lib.rs index 48166091e4..c044bafa8d 100644 --- a/crates/nuon/src/lib.rs +++ b/crates/nuon/src/lib.rs @@ -3,19 +3,20 @@ mod from; mod to; pub use from::from_nuon; -pub use to::to_nuon; pub use to::ToStyle; +pub use to::to_nuon; #[cfg(test)] mod tests { use chrono::DateTime; use nu_protocol::{ + BlockId, IntRange, Range, Span, Value, ast::{CellPath, PathMember, RangeInclusion}, engine::{Closure, EngineState}, - record, BlockId, IntRange, Range, Span, Value, + record, }; - use crate::{from_nuon, to_nuon, ToStyle}; + use crate::{ToStyle, from_nuon, to_nuon}; /// test something of the form /// ```nushell @@ -180,19 +181,21 @@ mod tests { fn to_nuon_errs_on_closure() { let engine_state = EngineState::new(); - assert!(to_nuon( - &engine_state, - &Value::test_closure(Closure { - block_id: BlockId::new(0), - captures: vec![] - }), - ToStyle::Default, - None, - false, - ) - .unwrap_err() - .to_string() - .contains("Unsupported input")); + assert!( + to_nuon( + &engine_state, + &Value::test_closure(Closure { + block_id: BlockId::new(0), + captures: vec![] + }), + ToStyle::Default, + None, + false, + ) + .unwrap_err() + .to_string() + .contains("Unsupported input") + ); } #[test] @@ -325,29 +328,31 @@ mod tests { fn to_nuon_converts_columns_with_spaces() { let engine_state = EngineState::new(); - assert!(from_nuon( - &to_nuon( - &engine_state, - &Value::test_list(vec![ - Value::test_record(record!( - "a" => Value::test_int(1), - "b" => Value::test_int(2), - "c d" => Value::test_int(3) - )), - Value::test_record(record!( - "a" => Value::test_int(4), - "b" => Value::test_int(5), - "c d" => Value::test_int(6) - )) - ]), - ToStyle::Default, + assert!( + from_nuon( + &to_nuon( + &engine_state, + &Value::test_list(vec![ + Value::test_record(record!( + "a" => Value::test_int(1), + "b" => Value::test_int(2), + "c d" => Value::test_int(3) + )), + Value::test_record(record!( + "a" => Value::test_int(4), + "b" => Value::test_int(5), + "c d" => Value::test_int(6) + )) + ]), + ToStyle::Default, + None, + false, + ) + .unwrap(), None, - false, ) - .unwrap(), - None, - ) - .is_ok()); + .is_ok() + ); } #[test] @@ -485,10 +490,12 @@ mod tests { // } // ``` fn read_code_should_fail_rather_than_panic() { - assert!(from_nuon( - include_str!("../../../tests/fixtures/formats/code.nu"), - None, - ) - .is_err()); + assert!( + from_nuon( + include_str!("../../../tests/fixtures/formats/code.nu"), + None, + ) + .is_err() + ); } } diff --git a/crates/nuon/src/to.rs b/crates/nuon/src/to.rs index c0fe3b9dfe..e95e291cb3 100644 --- a/crates/nuon/src/to.rs +++ b/crates/nuon/src/to.rs @@ -1,7 +1,7 @@ use core::fmt::Write; use nu_engine::get_columns; use nu_protocol::format::ObviousFloat; -use nu_protocol::{engine::EngineState, Range, ShellError, Span, Value}; +use nu_protocol::{Range, ShellError, Span, Value, engine::EngineState}; use nu_utils::{escape_quote_string, needs_quoting}; /// control the way Nushell [`Value`] is converted to NUON data diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 62c90079fd..b651028465 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -16,4 +16,4 @@ profile = "default" # use in nushell, we may opt to use the bleeding edge stable version of rust. # I believe rust is on a 6 week release cycle and nushell is on a 4 week release cycle. # So, every two nushell releases, this version number should be bumped by one. -channel = "1.84.1" +channel = "1.85.1" diff --git a/src/config_files.rs b/src/config_files.rs index 5c53d8f082..2842c12cdb 100644 --- a/src/config_files.rs +++ b/src/config_files.rs @@ -4,16 +4,17 @@ use nu_cli::read_plugin_file; use nu_cli::{eval_config_contents, eval_source}; use nu_path::canonicalize_with; use nu_protocol::{ + Config, ParseError, PipelineData, Spanned, engine::{EngineState, Stack, StateWorkingSet}, eval_const::{get_user_autoload_dirs, get_vendor_autoload_dirs}, - report_parse_error, report_shell_error, Config, ParseError, PipelineData, Spanned, + report_parse_error, report_shell_error, }; use nu_utils::{get_default_config, get_default_env, get_scaffold_config, get_scaffold_env}; use std::{ fs, fs::File, io::{Result, Write}, - panic::{catch_unwind, AssertUnwindSafe}, + panic::{AssertUnwindSafe, catch_unwind}, path::Path, sync::Arc, }; diff --git a/src/ide.rs b/src/ide.rs index 8d64fdd487..de3e1f68fe 100644 --- a/src/ide.rs +++ b/src/ide.rs @@ -1,14 +1,14 @@ use miette::IntoDiagnostic; use nu_cli::NuCompleter; -use nu_parser::{flatten_block, parse, FlatShape}; +use nu_parser::{FlatShape, flatten_block, parse}; use nu_protocol::{ + DeclId, ShellError, Span, Value, VarId, engine::{EngineState, Stack, StateWorkingSet}, report_shell_error, shell_error::io::{ErrorKindExt, IoError, NotFound}, - DeclId, ShellError, Span, Value, VarId, }; use reedline::Completer; -use serde_json::{json, Value as JsonValue}; +use serde_json::{Value as JsonValue, json}; use std::{path::PathBuf, sync::Arc}; #[derive(Debug)] @@ -667,15 +667,15 @@ pub fn ast(engine_state: &mut EngineState, file_path: &str) { fn json_merge(a: &mut JsonValue, b: &JsonValue) { match (a, b) { - (JsonValue::Object(ref mut a), JsonValue::Object(b)) => { + (JsonValue::Object(a), JsonValue::Object(b)) => { for (k, v) in b { json_merge(a.entry(k).or_insert(JsonValue::Null), v); } } - (JsonValue::Array(ref mut a), JsonValue::Array(b)) => { + (JsonValue::Array(a), JsonValue::Array(b)) => { a.extend(b.clone()); } - (JsonValue::Array(ref mut a), JsonValue::Object(b)) => { + (JsonValue::Array(a), JsonValue::Object(b)) => { a.extend([JsonValue::Object(b.clone())]); } (a, b) => { diff --git a/src/logger.rs b/src/logger.rs index dd66b17444..26f948c424 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -1,8 +1,8 @@ use log::{Level, LevelFilter, SetLoggerError}; use nu_protocol::ShellError; use simplelog::{ - format_description, Color, ColorChoice, Config, ConfigBuilder, LevelPadding, TermLogger, - TerminalMode, WriteLogger, + Color, ColorChoice, Config, ConfigBuilder, LevelPadding, TermLogger, TerminalMode, WriteLogger, + format_description, }; use std::{fs::File, path::Path, str::FromStr}; diff --git a/src/main.rs b/src/main.rs index bdebc876f0..9880741e28 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,15 +15,15 @@ use crate::{ logger::{configure, logger}, }; use command::gather_commandline_args; -use log::{trace, Level}; +use log::{Level, trace}; use miette::Result; use nu_cli::gather_parent_env_vars; use nu_engine::{convert_env_values, exit::cleanup_exit}; use nu_lsp::LanguageServer; use nu_path::canonicalize_with; use nu_protocol::{ - engine::Stack, record, report_shell_error, ByteStream, Config, IntoValue, PipelineData, - ShellError, Span, Spanned, Type, Value, + ByteStream, Config, IntoValue, PipelineData, ShellError, Span, Spanned, Type, Value, + engine::Stack, record, report_shell_error, }; use nu_std::load_standard_library; use nu_utils::perf; @@ -406,7 +406,7 @@ fn main() -> Result<()> { #[cfg(feature = "plugin")] if let Some(plugins) = &parsed_nu_cli_args.plugins { use nu_plugin_engine::{GetPlugin, PluginDeclaration}; - use nu_protocol::{engine::StateWorkingSet, ErrSpan, PluginIdentity, RegisteredPlugin}; + use nu_protocol::{ErrSpan, PluginIdentity, RegisteredPlugin, engine::StateWorkingSet}; // Load any plugins specified with --plugins start_time = std::time::Instant::now(); diff --git a/src/run.rs b/src/run.rs index 43ca28bb04..7c93f86e50 100644 --- a/src/run.rs +++ b/src/run.rs @@ -5,10 +5,11 @@ use crate::{ use log::trace; #[cfg(feature = "plugin")] use nu_cli::read_plugin_file; -use nu_cli::{evaluate_commands, evaluate_file, evaluate_repl, EvaluateCommandsOpts}; +use nu_cli::{EvaluateCommandsOpts, evaluate_commands, evaluate_file, evaluate_repl}; use nu_protocol::{ + PipelineData, Spanned, engine::{EngineState, Stack}, - report_shell_error, PipelineData, Spanned, + report_shell_error, }; use nu_utils::perf; diff --git a/src/signals.rs b/src/signals.rs index ca22eef255..323231e14e 100644 --- a/src/signals.rs +++ b/src/signals.rs @@ -1,7 +1,7 @@ -use nu_protocol::{engine::EngineState, Handlers, SignalAction, Signals}; +use nu_protocol::{Handlers, SignalAction, Signals, engine::EngineState}; use std::sync::{ - atomic::{AtomicBool, Ordering}, Arc, + atomic::{AtomicBool, Ordering}, }; pub(crate) fn ctrlc_protection(engine_state: &mut EngineState) { diff --git a/src/terminal.rs b/src/terminal.rs index 4ea5aa0c36..fa2c7ac40d 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -6,7 +6,7 @@ use std::{ use nix::{ errno::Errno, libc, - sys::signal::{killpg, raise, sigaction, SaFlags, SigAction, SigHandler, SigSet, Signal}, + sys::signal::{SaFlags, SigAction, SigHandler, SigSet, Signal, killpg, raise, sigaction}, unistd::{self, Pid}, }; diff --git a/src/test_bins.rs b/src/test_bins.rs index d31fd07c57..31fd184942 100644 --- a/src/test_bins.rs +++ b/src/test_bins.rs @@ -2,9 +2,10 @@ use nu_cmd_base::hook::{eval_env_change_hook, eval_hooks}; use nu_engine::eval_block; use nu_parser::parse; use nu_protocol::{ + PipelineData, ShellError, Value, debugger::WithoutDebug, engine::{EngineState, Stack, StateWorkingSet}, - report_parse_error, report_shell_error, PipelineData, ShellError, Value, + report_parse_error, report_shell_error, }; use nu_std::load_standard_library; use std::{ diff --git a/tests/plugins/custom_values.rs b/tests/plugins/custom_values.rs index 16b0c332e3..ea34ba9933 100644 --- a/tests/plugins/custom_values.rs +++ b/tests/plugins/custom_values.rs @@ -141,12 +141,16 @@ fn fails_if_passing_engine_custom_values_to_plugins() { "open sample.db | custom-value update" ); - assert!(actual - .err - .contains("`SQLiteDatabase` cannot be sent to plugin")); - assert!(actual - .err - .contains("the `custom_values` plugin does not support this kind of value")); + assert!( + actual + .err + .contains("`SQLiteDatabase` cannot be sent to plugin") + ); + assert!( + actual + .err + .contains("the `custom_values` plugin does not support this kind of value") + ); } #[test] @@ -160,12 +164,16 @@ fn fails_if_passing_custom_values_across_plugins() { "custom-value generate | inc --major" ); - assert!(actual - .err - .contains("`CoolCustomValue` cannot be sent to plugin")); - assert!(actual - .err - .contains("the `inc` plugin does not support this kind of value")); + assert!( + actual + .err + .contains("`CoolCustomValue` cannot be sent to plugin") + ); + assert!( + actual + .err + .contains("the `inc` plugin does not support this kind of value") + ); } #[test] @@ -225,9 +233,11 @@ fn custom_value_in_example_is_rendered() { "custom-value generate --help" ); - assert!(actual - .out - .contains("I used to be a custom value! My data was (abc)")); + assert!( + actual + .out + .contains("I used to be a custom value! My data was (abc)") + ); assert!(actual.status.success()); } diff --git a/tests/repl/test_bits.rs b/tests/repl/test_bits.rs index 68c610d2d6..e3aa46754c 100644 --- a/tests/repl/test_bits.rs +++ b/tests/repl/test_bits.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; #[test] fn bits_and() -> TestResult { diff --git a/tests/repl/test_cell_path.rs b/tests/repl/test_cell_path.rs index c89c50259b..1957282a10 100644 --- a/tests/repl/test_cell_path.rs +++ b/tests/repl/test_cell_path.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; // Tests for null / null / Value::Nothing #[test] diff --git a/tests/repl/test_commandline.rs b/tests/repl/test_commandline.rs index 0443ee4d6c..1b52797fc4 100644 --- a/tests/repl/test_commandline.rs +++ b/tests/repl/test_commandline.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; #[test] fn commandline_test_get_empty() -> TestResult { diff --git a/tests/repl/test_conditionals.rs b/tests/repl/test_conditionals.rs index dd1e16c5a8..d12af0862f 100644 --- a/tests/repl/test_conditionals.rs +++ b/tests/repl/test_conditionals.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{run_test, TestResult}; +use crate::repl::tests::{TestResult, run_test}; #[test] fn if_test1() -> TestResult { diff --git a/tests/repl/test_config.rs b/tests/repl/test_config.rs index f798d05606..8e69d29439 100644 --- a/tests/repl/test_config.rs +++ b/tests/repl/test_config.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, run_test_std, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test, run_test_std}; #[test] fn mutate_nu_config() -> TestResult { diff --git a/tests/repl/test_converters.rs b/tests/repl/test_converters.rs index cfa165e95d..3074703a74 100644 --- a/tests/repl/test_converters.rs +++ b/tests/repl/test_converters.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{run_test, TestResult}; +use crate::repl::tests::{TestResult, run_test}; #[test] fn from_json_1() -> TestResult { diff --git a/tests/repl/test_custom_commands.rs b/tests/repl/test_custom_commands.rs index a93d3fbba8..bee046bcac 100644 --- a/tests/repl/test_custom_commands.rs +++ b/tests/repl/test_custom_commands.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, run_test_contains, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test, run_test_contains}; use nu_test_support::nu; use pretty_assertions::assert_eq; use rstest::rstest; diff --git a/tests/repl/test_engine.rs b/tests/repl/test_engine.rs index d89a722bec..7c90bb4bb6 100644 --- a/tests/repl/test_engine.rs +++ b/tests/repl/test_engine.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; use rstest::rstest; #[test] diff --git a/tests/repl/test_env.rs b/tests/repl/test_env.rs index d540ce2fd4..021aee61fb 100644 --- a/tests/repl/test_env.rs +++ b/tests/repl/test_env.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; use nu_test_support::nu; #[test] diff --git a/tests/repl/test_help.rs b/tests/repl/test_help.rs index 2fe3b5ecff..63a811fe59 100644 --- a/tests/repl/test_help.rs +++ b/tests/repl/test_help.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{run_test, TestResult}; +use crate::repl::tests::{TestResult, run_test}; use rstest::rstest; #[rstest] diff --git a/tests/repl/test_hiding.rs b/tests/repl/test_hiding.rs index ee2016c54d..402d85dfd8 100644 --- a/tests/repl/test_hiding.rs +++ b/tests/repl/test_hiding.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; // TODO: Test the use/hide tests also as separate lines in REPL (i.e., with merging the delta in between) #[test] diff --git a/tests/repl/test_ide.rs b/tests/repl/test_ide.rs index 45cc87aa4d..a6dd5a0139 100644 --- a/tests/repl/test_ide.rs +++ b/tests/repl/test_ide.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{test_ide_contains, TestResult}; +use crate::repl::tests::{TestResult, test_ide_contains}; #[test] fn parser_recovers() -> TestResult { diff --git a/tests/repl/test_iteration.rs b/tests/repl/test_iteration.rs index bcc21b9ef9..8ed0836f47 100644 --- a/tests/repl/test_iteration.rs +++ b/tests/repl/test_iteration.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{run_test, TestResult}; +use crate::repl::tests::{TestResult, run_test}; #[test] fn better_block_types() -> TestResult { diff --git a/tests/repl/test_known_external.rs b/tests/repl/test_known_external.rs index c0278cc863..74bf8815b2 100644 --- a/tests/repl/test_known_external.rs +++ b/tests/repl/test_known_external.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, run_test_contains, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test, run_test_contains}; use std::process::Command; // cargo version prints a string of the form: diff --git a/tests/repl/test_math.rs b/tests/repl/test_math.rs index 7ad23e1968..6bd7b29403 100644 --- a/tests/repl/test_math.rs +++ b/tests/repl/test_math.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; #[test] fn add_simple() -> TestResult { diff --git a/tests/repl/test_modules.rs b/tests/repl/test_modules.rs index 813afd9f43..1b8972017f 100644 --- a/tests/repl/test_modules.rs +++ b/tests/repl/test_modules.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; use rstest::rstest; #[test] diff --git a/tests/repl/test_parser.rs b/tests/repl/test_parser.rs index e40c27dbab..45b890653c 100644 --- a/tests/repl/test_parser.rs +++ b/tests/repl/test_parser.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, run_test_contains, run_test_with_env, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test, run_test_contains, run_test_with_env}; use nu_test_support::{nu, nu_repl_code}; use std::collections::HashMap; diff --git a/tests/repl/test_ranges.rs b/tests/repl/test_ranges.rs index 2f3f26b07a..92e03b1321 100644 --- a/tests/repl/test_ranges.rs +++ b/tests/repl/test_ranges.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; #[test] fn int_in_inc_range() -> TestResult { diff --git a/tests/repl/test_regex.rs b/tests/repl/test_regex.rs index 7dff6d7710..87a0b8beb0 100644 --- a/tests/repl/test_regex.rs +++ b/tests/repl/test_regex.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; #[test] fn contains() -> TestResult { diff --git a/tests/repl/test_signatures.rs b/tests/repl/test_signatures.rs index cc8133afb5..4765a54d7a 100644 --- a/tests/repl/test_signatures.rs +++ b/tests/repl/test_signatures.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; use rstest::rstest; #[test] diff --git a/tests/repl/test_spread.rs b/tests/repl/test_spread.rs index 96628d2284..091d885f30 100644 --- a/tests/repl/test_spread.rs +++ b/tests/repl/test_spread.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; use nu_test_support::nu; #[test] @@ -164,9 +164,11 @@ fn bad_spread_internal_args() -> TestResult { #[test] fn spread_non_list_args() { fail_test(r#"echo ...(1)"#, "cannot spread value").unwrap(); - assert!(nu!(r#"nu --testbin cococo ...(1)"#) - .err - .contains("cannot spread value")); + assert!( + nu!(r#"nu --testbin cococo ...(1)"#) + .err + .contains("cannot spread value") + ); } #[test] diff --git a/tests/repl/test_stdlib.rs b/tests/repl/test_stdlib.rs index b15a10dd22..07edc28624 100644 --- a/tests/repl/test_stdlib.rs +++ b/tests/repl/test_stdlib.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test_std, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test_std}; #[test] fn not_loaded() -> TestResult { diff --git a/tests/repl/test_strings.rs b/tests/repl/test_strings.rs index 967086a592..439eedaac3 100644 --- a/tests/repl/test_strings.rs +++ b/tests/repl/test_strings.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; #[test] fn cjk_in_substrings() -> TestResult { diff --git a/tests/repl/test_table_operations.rs b/tests/repl/test_table_operations.rs index 5d61e0d902..6e32982929 100644 --- a/tests/repl/test_table_operations.rs +++ b/tests/repl/test_table_operations.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; #[test] fn illegal_column_duplication() -> TestResult { @@ -58,7 +58,7 @@ fn flatten_table_column_get_last() -> TestResult { fn flatten_should_just_flatten_one_level() -> TestResult { run_test( "[[origin, crate, versions]; [World, ([[name]; ['nu-cli']]), ['0.21', '0.22']]] | flatten crate | get crate.name.0", - "nu-cli" + "nu-cli", ) } @@ -66,7 +66,7 @@ fn flatten_should_just_flatten_one_level() -> TestResult { fn flatten_nest_table_when_all_provided() -> TestResult { run_test( "[[origin, crate, versions]; [World, ([[name]; ['nu-cli']]), ['0.21', '0.22']]] | flatten crate --all | get name.0", - "nu-cli" + "nu-cli", ) } diff --git a/tests/repl/test_type_check.rs b/tests/repl/test_type_check.rs index 86216c15a9..2fbc5a7842 100644 --- a/tests/repl/test_type_check.rs +++ b/tests/repl/test_type_check.rs @@ -1,4 +1,4 @@ -use crate::repl::tests::{fail_test, run_test, TestResult}; +use crate::repl::tests::{TestResult, fail_test, run_test}; use rstest::rstest; #[test] @@ -129,7 +129,7 @@ fn record_subtyping_allows_record_after_general_command() -> TestResult { fn record_subtyping_allows_general_inner() -> TestResult { run_test( "def merge_records [other: record]: record -> record { merge $other }", - "", + "", ) } diff --git a/tests/shell/pipeline/commands/external.rs b/tests/shell/pipeline/commands/external.rs index c0cf8e1adb..5b42798ba5 100644 --- a/tests/shell/pipeline/commands/external.rs +++ b/tests/shell/pipeline/commands/external.rs @@ -76,9 +76,11 @@ fn correctly_escape_external_arguments() { fn escape_also_escapes_equals() { let actual = nu!("^MYFOONAME=MYBARVALUE"); - assert!(actual - .err - .contains("Command `MYFOONAME=MYBARVALUE` not found")); + assert!( + actual + .err + .contains("Command `MYFOONAME=MYBARVALUE` not found") + ); } #[test] @@ -721,7 +723,9 @@ fn external_error_with_backtrace() { #[test] fn sub_external_expression_with_and_op_should_raise_proper_error() { let actual = nu!("(nu --testbin cococo false) and true"); - assert!(actual - .err - .contains("The 'and' operator does not work on values of type 'string'")) + assert!( + actual + .err + .contains("The 'and' operator does not work on values of type 'string'") + ) } diff --git a/tests/shell/pipeline/commands/internal.rs b/tests/shell/pipeline/commands/internal.rs index e78a0947b3..2ecf221863 100644 --- a/tests/shell/pipeline/commands/internal.rs +++ b/tests/shell/pipeline/commands/internal.rs @@ -771,9 +771,11 @@ fn filesize_math() { #[test] fn filesize_math2() { let actual = nu!("100 / 10kB"); - assert!(actual - .err - .contains("nu::parser::operator_incompatible_types")); + assert!( + actual + .err + .contains("nu::parser::operator_incompatible_types") + ); } #[test] @@ -1133,9 +1135,11 @@ fn command_not_found_error_shows_not_found_2() { #[test] fn error_on_out_greater_pipe() { let actual = nu!(r#""foo" o>| print"#); - assert!(actual - .err - .contains("Redirecting stdout to a pipe is the same as normal piping")) + assert!( + actual + .err + .contains("Redirecting stdout to a pipe is the same as normal piping") + ) } #[test]