forked from extern/nushell
b9c78a05aa
# Description Command: `cargo clippy --workspace --all-targets` Resolve those warnings: ``` warning: this expression creates a reference which is immediately dereferenced by the compiler --> crates/nu-parser/tests/test_parser.rs:86:59 | 86 | compare_rhs_binaryOp(test_tag, &expected_val, &observed_val); | ^^^^^^^^^^^^^ help: change this to: `observed_val` | = 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: `assert!(false, ..)` should probably be replaced --> crates/nu-cli/src/completions/command_completions.rs:319:17 | 319 | assert!(false, "Merge delta has failed: {}", err); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: use `panic!(..)` or `unreachable!(..)` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants = note: `#[warn(clippy::assertions_on_constants)]` on by default warning: 1 warning emitted warning: `assert!(false, ..)` should probably be replaced --> crates/nu-cli/src/completions/completer.rs:600:13 | 600 | assert!(false, "Error merging delta: {:?}", err); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: use `panic!(..)` or `unreachable!(..)` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants warning: length comparison to zero --> crates/nu-cli/src/completions/completer.rs:620:24 | 620 | assert_eq!(result.len() > 0, has_result, "line: {}", line); | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!result.is_empty()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero = note: `#[warn(clippy::len_zero)]` on by default warning: equality checks against true are unnecessary --> crates/nu-cli/src/completions/completer.rs:632:33 | 632 | .filter(|x| *x == true) | ^^^^^^^^^^ help: try simplifying it as shown: `*x` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison = note: `#[warn(clippy::bool_comparison)]` on by default Checking nu v0.76.1 (/home/jaudiger/Development/git-repositories/jaudiger/nushell) warning: 4 warnings emitted warning: the borrowed expression implements the required traits --> crates/nu-command/tests/commands/cp.rs:26:40 | 26 | let first_hash = get_file_hash(&test_file.display()); | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `test_file.display()` | = 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: the borrowed expression implements the required traits --> crates/nu-command/tests/commands/cp.rs:178:13 | 178 | &jonathans_expected_copied_dir | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `jonathans_expected_copied_dir` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: the borrowed expression implements the required traits --> crates/nu-command/tests/commands/cp.rs:182:13 | 182 | &andres_expected_copied_dir | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `andres_expected_copied_dir` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: the borrowed expression implements the required traits --> crates/nu-command/tests/commands/cp.rs:186:13 | 186 | &yehudas_expected_copied_dir | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `yehudas_expected_copied_dir` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: 4 warnings emitted ``` # User-Facing Changes None. # 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 # 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 | ||
enter.rs | ||
error_make.rs | ||
every.rs | ||
exec.rs | ||
export_def.rs | ||
fill.rs | ||
find.rs | ||
first.rs | ||
flatten.rs | ||
for_.rs | ||
format.rs | ||
g.rs | ||
get.rs | ||
glob.rs | ||
group_by.rs | ||
headers.rs | ||
help.rs | ||
histogram.rs | ||
insert.rs | ||
into_filesize.rs | ||
into_int.rs | ||
last.rs | ||
length.rs | ||
let_.rs | ||
lines.rs | ||
loop_.rs | ||
ls.rs | ||
merge.rs | ||
mkdir.rs | ||
mod.rs | ||
mut_.rs | ||
n.rs | ||
nu_check.rs | ||
open.rs | ||
p.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_char.rs | ||
seq.rs | ||
shells.rs | ||
sort_by.rs | ||
sort.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_by.rs | ||
uniq.rs | ||
update.rs | ||
upsert.rs | ||
use_.rs | ||
where_.rs | ||
which.rs | ||
while_.rs | ||
with_env.rs | ||
wrap.rs | ||
zip.rs |