nushell/crates/nu-command/src/strings
Darren Schroeder 366348dea0
make char command const (#11771)
# Description

This PR makes the `char` command a `const` command. The only real
changes are to get the arguments different and I extracted code into
functions so they could be called via run and run_cost. No algorithms
were harmed in the making of this PR.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

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

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-07 16:29:00 -06:00
..
encode_decode adjust some commansd input_output type (#11436) 2024-01-15 16:58:26 +08:00
format Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00
split Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00
str_ add str escape-glob command (#11664) 2024-01-29 23:00:15 +08:00
char_.rs make char command const (#11771) 2024-02-07 16:29:00 -06:00
detect_columns.rs Fix panic in rotate; Add safe record creation function (#11718) 2024-02-03 13:23:16 +02:00
mod.rs Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00
parse.rs Apply nightly clippy fixes (#11508) 2024-01-15 10:52:16 +08:00