mirror of
https://github.com/nushell/nushell
synced 2024-12-29 06:23:11 +00:00
69bf43ef56
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description This PR fixes the following nightly clippy warnings. ``` warning: you should consider adding a `Default` implementation for `HjsonFormatter<'a>` --> crates/nu-json/src/ser.rs:700:5 | 700 | / pub fn new() -> Self { 701 | | HjsonFormatter::with_indent(b" ") 702 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default = note: `#[warn(clippy::new_without_default)]` on by default help: try adding this | 698 + impl<'a> Default for HjsonFormatter<'a> { 699 + fn default() -> Self { 700 + Self::new() 701 + } 702 + } | warning: `nu-json` (lib) generated 1 warning warning: private item shadows public glob re-export --> crates/nu-command/src/strings/mod.rs:8:1 | 8 | mod str_; | ^^^^^^^^^ | note: the name `str_` in the type namespace is supposed to be publicly re-exported here --> crates/nu-command/src/strings/mod.rs:17:9 | 17 | pub use str_::*; | ^^^^^^^ note: but the private item here shadows it --> crates/nu-command/src/strings/mod.rs:8:1 | 8 | mod str_; | ^^^^^^^^^ = note: `#[warn(hidden_glob_reexports)]` on by default warning: incorrect NaN comparison, NaN cannot be directly compared to itself --> crates/nu-command/src/formats/to/nuon.rs:186:20 | 186 | && val != &f64::NAN | ^^^^^^^^^^^^^^^^ | = note: `#[warn(invalid_nan_comparisons)]` on by default help: use `f32::is_nan()` or `f64::is_nan()` instead | 186 - && val != &f64::NAN 186 + && !val.is_nan() | warning: `nu-command` (lib) generated 2 warnings (run `cargo clippy --fix --lib -p nu-command` to apply 1 suggestion) Compiling nu v0.81.1 (/data/source/nushell) warning: this expression creates a reference which is immediately dereferenced by the compiler --> crates/nu-command/tests/commands/rm.rs:392:27 | 392 | dir_to_clean: &test_dir, | ^^^^^^^^^ help: change this to: `test_dir` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default warning: `nu-command` (test "main") generated 1 warning (run `cargo clippy --fix --test "main"` to apply 1 suggestion) warning: `nu-command` (lib test) generated 2 warnings (2 duplicates) warning: `nu-json` (lib test) generated 1 warning (1 duplicate) Finished dev [unoptimized + debuginfo] target(s) in 3.89s ``` # User-Facing Changes N/A # 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 -A clippy::result_large_err` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass - `cargo run -- crates/nu-std/tests/run.nu` 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. --> |
||
---|---|---|
.. | ||
assignment | ||
bytes | ||
date | ||
hash_ | ||
math | ||
move_ | ||
network | ||
path | ||
platform | ||
query | ||
random | ||
skip | ||
str_ | ||
take | ||
url | ||
alias.rs | ||
all.rs | ||
any.rs | ||
append.rs | ||
break_.rs | ||
cal.rs | ||
cd.rs | ||
compact.rs | ||
continue_.rs | ||
cp.rs | ||
def.rs | ||
default.rs | ||
do_.rs | ||
drop.rs | ||
each.rs | ||
echo.rs | ||
empty.rs | ||
error_make.rs | ||
every.rs | ||
exec.rs | ||
export_def.rs | ||
fill.rs | ||
find.rs | ||
first.rs | ||
flatten.rs | ||
for_.rs | ||
format.rs | ||
get.rs | ||
glob.rs | ||
group_by.rs | ||
headers.rs | ||
help.rs | ||
histogram.rs | ||
insert.rs | ||
inspect.rs | ||
into_filesize.rs | ||
into_int.rs | ||
join.rs | ||
last.rs | ||
length.rs | ||
let_.rs | ||
lines.rs | ||
loop_.rs | ||
ls.rs | ||
match_.rs | ||
merge.rs | ||
mkdir.rs | ||
mod.rs | ||
mut_.rs | ||
nu_check.rs | ||
open.rs | ||
par_each.rs | ||
parse.rs | ||
prepend.rs | ||
print.rs | ||
range.rs | ||
redirection.rs | ||
reduce.rs | ||
reject.rs | ||
rename.rs | ||
return_.rs | ||
reverse.rs | ||
rm.rs | ||
roll.rs | ||
rotate.rs | ||
run_external.rs | ||
save.rs | ||
select.rs | ||
semicolon.rs | ||
seq.rs | ||
seq_char.rs | ||
sort.rs | ||
sort_by.rs | ||
source_env.rs | ||
split_by.rs | ||
split_column.rs | ||
split_row.rs | ||
table.rs | ||
to_text.rs | ||
touch.rs | ||
transpose.rs | ||
try_.rs | ||
uniq.rs | ||
uniq_by.rs | ||
update.rs | ||
upsert.rs | ||
use_.rs | ||
where_.rs | ||
which.rs | ||
while_.rs | ||
with_env.rs | ||
wrap.rs | ||
zip.rs |