nushell/crates/nu-command/src
Daniel Buch Hansen 850ecf648a
Protocol: debug_assert!() Span to reflect a valid slice (#6806)
Also enforce this by #[non_exhaustive] span such that going forward we
cannot, in debug builds (1), construct invalid spans.

The motivation for this stems from #6431 where I've seen crashes due to
invalid slice indexing.

My hope is this will mitigate such senarios

1. https://github.com/nushell/nushell/pull/6431#issuecomment-1278147241

# Description

(description of your pull request here)

# Tests

Make sure you've done the following:

- [ ] Add tests that cover your changes, either in the command examples,
the crate/tests folder, or in the /tests folder.
- [ ] Try to think about corner cases and various ways how your changes
could break. Cover them with tests.
- [ ] If adding tests is not possible, please document in the PR body a
minimal example with steps on how to reproduce so one can verify your
change works.

Make sure you've run and fixed any issues with these commands:

- [x] `cargo fmt --all -- --check` to check standard code formatting
(`cargo fmt --all` applies these changes)
- [ ] `cargo clippy --workspace --features=extra -- -D warnings -D
clippy::unwrap_used -A clippy::needless_collect` to check that you're
using the standard code style
- [ ] `cargo test --workspace --features=extra` to check that all the
tests pass

# Documentation

- [ ] If your PR touches a user-facing nushell feature then make sure
that there is an entry in the documentation
(https://github.com/nushell/nushell.github.io) for the feature, and
update it if necessary.
2022-12-03 11:44:12 +02:00
..
bits add signature information when get help on one command (#7079) 2022-11-20 07:22:42 -06:00
bytes add signature information when get help on one command (#7079) 2022-11-20 07:22:42 -06:00
charting Protocol: debug_assert!() Span to reflect a valid slice (#6806) 2022-12-03 11:44:12 +02:00
conversions Protocol: debug_assert!() Span to reflect a valid slice (#6806) 2022-12-03 11:44:12 +02:00
core_commands Protocol: debug_assert!() Span to reflect a valid slice (#6806) 2022-12-03 11:44:12 +02:00
database Apply clippy fix (#7193) 2022-11-23 16:57:27 +13:00
dataframe Protocol: debug_assert!() Span to reflect a valid slice (#6806) 2022-12-03 11:44:12 +02:00
date chore: chrono_update (#7132) 2022-11-27 07:19:02 +13:00
deprecated Add a deprecation note for removed build-string (#7307) 2022-12-01 16:26:59 +01:00
env Protocol: debug_assert!() Span to reflect a valid slice (#6806) 2022-12-03 11:44:12 +02:00
experimental Removes export env command (#6468) 2022-09-25 19:52:43 +03:00
filesystem Protocol: debug_assert!() Span to reflect a valid slice (#6806) 2022-12-03 11:44:12 +02:00
filters Protocol: debug_assert!() Span to reflect a valid slice (#6806) 2022-12-03 11:44:12 +02:00
formats Protocol: debug_assert!() Span to reflect a valid slice (#6806) 2022-12-03 11:44:12 +02:00
generators fix cal input_output_types signature (#7306) 2022-12-01 07:10:49 -06:00
hash add signature information when get help on one command (#7079) 2022-11-20 07:22:42 -06:00
math Add natural logarithm (#7258) 2022-12-01 15:58:05 +01:00
misc Protocol: debug_assert!() Span to reflect a valid slice (#6806) 2022-12-03 11:44:12 +02:00
network Fix fetch/post not erroring on 4xx and 5xx statuses (#7213) 2022-11-23 08:43:12 -08:00
path Fix sort-by, path join and size error arrows (#7199) 2022-11-23 19:22:23 +13:00
platform add signature information when get help on one command (#7079) 2022-11-20 07:22:42 -06:00
random add signature information when get help on one command (#7079) 2022-11-20 07:22:42 -06:00
shells Refactor shell listing related code (#6262) 2022-08-08 06:31:24 -05:00
strings Protocol: debug_assert!() Span to reflect a valid slice (#6806) 2022-12-03 11:44:12 +02:00
system A set of fixes for stderr redirect (#7219) 2022-11-24 16:58:15 +13:00
viewers Edited help text and examples in explore for readability (#7324) 2022-12-02 08:01:02 -06:00
default_context.rs uniq-by command (#7295) 2022-12-02 11:36:01 +01:00
example_test.rs Fix where -b flag (#7313) 2022-12-01 15:11:03 -08:00
input_handler.rs Replace all instances of 'column path' in help messages with 'cell path' (#7063) 2022-11-09 21:49:11 -08:00
lib.rs Feature cleanup (#7182) 2022-11-22 16:58:11 -08:00
sort_utils.rs Fix sort-by, path join and size error arrows (#7199) 2022-11-23 19:22:23 +13:00