Fix warnings and old names (#8457)

# Description

This fixes up some clippy warnings and removes some old names/info from
our unit tests

# User-Facing Changes

Internal changes only

# 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 -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass

> **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.
This commit is contained in:
JT
2023-03-15 18:54:55 +13:00
committed by GitHub
parent 57ce6a7c66
commit 61455b457d
41 changed files with 142 additions and 158 deletions

View File

@ -82,7 +82,7 @@ fn infers_types() {
r#"
first_name,last_name,rusty_luck,d
Andrés,Robalino,1,d
Jonathan,Turner,1,d
JT,Turner,1,d
Yehuda,Katz,1,d
Jason,Gedge,1,d
"#,
@ -109,7 +109,7 @@ fn from_csv_text_to_table() {
r#"
first_name,last_name,rusty_luck
Andrés,Robalino,1
Jonathan,Turner,1
JT,Turner,1
Yehuda,Katz,1
"#,
)]);
@ -136,7 +136,7 @@ fn from_csv_text_with_separator_to_table() {
r#"
first_name;last_name;rusty_luck
Andrés;Robalino;1
Jonathan;Turner;1
JT;Turner;1
Yehuda;Katz;1
"#,
)]);
@ -163,7 +163,7 @@ fn from_csv_text_with_tab_separator_to_table() {
r#"
first_name last_name rusty_luck
Andrés Robalino 1
Jonathan Turner 1
JT Turner 1
Yehuda Katz 1
"#,
)]);
@ -189,7 +189,7 @@ fn from_csv_text_skipping_headers_to_table() {
"los_tres_amigos.txt",
r#"
Andrés,Robalino,1
Jonathan,Turner,1
JT,Turner,1
Yehuda,Katz,1
"#,
)]);

View File

@ -26,7 +26,7 @@ fn from_json_text_to_table() {
{
"katz": [
{"name": "Yehuda", "rusty_luck": 1},
{"name": "Jonathan", "rusty_luck": 1},
{"name": "JT", "rusty_luck": 1},
{"name": "Andres", "rusty_luck": 1},
{"name":"GorbyPuff", "rusty_luck": 1}
]
@ -50,7 +50,7 @@ fn from_json_text_recognizing_objects_independently_to_table() {
"katz.txt",
r#"
{"name": "Yehuda", "rusty_luck": 1}
{"name": "Jonathan", "rusty_luck": 1}
{"name": "JT", "rusty_luck": 1}
{"name": "Andres", "rusty_luck": 1}
{"name":"GorbyPuff", "rusty_luck": 3}
"#,

View File

@ -86,7 +86,7 @@ fn from_tsv_text_to_table() {
r#"
first Name Last Name rusty_luck
Andrés Robalino 1
Jonathan Turner 1
JT Turner 1
Yehuda Katz 1
"#,
)]);
@ -112,7 +112,7 @@ fn from_tsv_text_skipping_headers_to_table() {
"los_tres_amigos.txt",
r#"
Andrés Robalino 1
Jonathan Turner 1
JT Turner 1
Yehuda Katz 1
"#,
)]);

View File

@ -5,7 +5,7 @@ fn table_to_xml_text_and_from_xml_text_back_into_table() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
open jonathan.xml
open jt.xml
| to xml
| from xml
| get content