reviewdog [clippy] report
reported by reviewdog 🐶
Findings (0)
Filtered Findings (89)
src/utils/pipeline.rs|75 col 28| error: this else { if .. }
block can be collapsed
--> src/utils/pipeline.rs:75:28
|
75 | } else {
| ^
76 | | if let Some(alias) = alias.as_ref() {
77 | | create_shim(
78 | | current_shell,
... |
88 | | };
89 | | };
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
= note: -D clippy::collapsible-else-if
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::collapsible_else_if)]
help: collapse nested if block
|
75 ~ } else if let Some(alias) = alias.as_ref() {
76 + create_shim(
77 + current_shell,
78 + alias,
79 + &get_shim_content(current_shell, run, alias, None)?,
80 + )?;
81 + } else {
82 + create_shim(
83 + current_shell,
84 + run,
85 + &get_shim_content(current_shell, run, run, None)?,
86 + )?;
87 ~ };
|
src/hooks/extract.rs|10 col 28| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/extract.rs:10:28
|
10 | run_cmd(current_shell, &cmd)?;
| ^^^^ help: change this to: cmd
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: -D clippy::needless-borrow
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::needless_borrow)]
src/hooks/extract.rs|42 col 9| error: you seem to be trying to use match
for an equality check. Consider using if
--> src/hooks/extract.rs:42:9
|
42 | / match ext.to_str().unwrap() {
43 | | "dmg" => {
44 | | run_cmd(
45 | | current_shell,
... |
67 | | _ => {}
68 | | }
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: -D clippy::single-match
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::single_match)]
help: try
|
42 ~ if ext.to_str().unwrap() == "dmg" {
43 + run_cmd(
44 + current_shell,
45 + &format!(
46 + r#"
47 + extract_dmg() {{
48 + local dmg_name="{}"
49 + echo "dmg_name $dmg_name"
50 +
51 + local attached_vol_info=$(eval "hdiutil attach $(realpath -m $dmg_name)" | tail -n1)
52 + local attached_vol=$(echo $attached_vol_info | awk -F " " '{{print $1}}')
53 + local attached_vol_mnt_pt=$(echo $attached_vol_info | awk -F " " '{{print $3}}')
54 + cp -R $(realpath -m $attached_vol_mnt_pt)/ .
55 + echo "attached vol $(realpath -m $attached_vol)"
56 + eval "hdiutil detach "$attached_vol""
57 + }}
58 +
59 + extract_dmg
60 +
61 + "#,
62 + asset_path_string
63 + ),
64 + )?;
65 + }
|
src/hooks/load.rs|7 col 5| error: passing a unit value to a function
--> src/hooks/load.rs:7:5
|
7 | / Ok(match load_cmd {
8 | | ShellSpecificEvaluatable::Generic(generic) => println!("{}", generic),
9 | | ShellSpecificEvaluatable::ShellSpecific(shell_specific) => {
10 | | let shell_specific_evaluatable = match current_shell {
... |
23 | | }
24 | | })
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
= note: -D clippy::unit-arg
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::unit_arg)]
help: move the expression in front of the call and replace it with the unit literal ()
|
7 ~ match load_cmd {
8 + ShellSpecificEvaluatable::Generic(generic) => println!("{}", generic),
9 + ShellSpecificEvaluatable::ShellSpecific(shell_specific) => {
10 + let shell_specific_evaluatable = match current_shell {
11 + SupportedShell::Sh => &shell_specific.sh,
12 + SupportedShell::Bash => &shell_specific.bash,
13 + SupportedShell::Zsh => &shell_specific.zsh,
14 + SupportedShell::Fish => &shell_specific.fish,
15 + SupportedShell::PowerShell => &shell_specific.powershell,
16 + SupportedShell::WinCmd => &shell_specific.wincmd,
17 + };
18 +
19 + match shell_specific_evaluatable {
20 + Some(evaluatable) => println!("{}", evaluatable),
21 + None => (),
22 + }
23 + }
24 + };
25 + Ok(())
|
src/hooks/resource.rs|32 col 24| error: the borrowed expression implements the required traits
--> src/hooks/resource.rs:32:24
|
32 | fs::create_dir_all(&payload_current_install_dir)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: payload_current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: -D clippy::needless-borrows-for-generic-args
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::needless_borrows_for_generic_args)]
src/hooks/resource.rs|34 col 49| error: the borrowed expression implements the required traits
--> src/hooks/resource.rs:34:49
|
34 | let dest = payload_current_install_dir.join(&resource_name);
| ^^^^^^^^^^^^^^ help: change this to: resource_name
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/hooks/resource.rs|37 col 12| error: the borrowed expression implements the required traits
--> src/hooks/resource.rs:37:12
|
37 | rename(&resource_path, &dest)?;
| ^^^^^^^^^^^^^^ help: change this to: resource_path
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/hooks/resource.rs|49 col 12| error: the borrowed expression implements the required traits
--> src/hooks/resource.rs:49:12
|
49 | rename(&resource_path, &dest)?;
| ^^^^^^^^^^^^^^ help: change this to: resource_path
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/hooks/resource.rs|49 col 28| error: the borrowed expression implements the required traits
--> src/hooks/resource.rs:49:28
|
49 | rename(&resource_path, &dest)?;
| ^^^^^ help: change this to: dest
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/hooks/resource.rs|103 col 39| error: the borrowed expression implements the required traits
--> src/hooks/resource.rs:103:39
|
103 | assert!(std::env::set_current_dir(&payload_config_dir).is_ok());
| ^^^^^^^^^^^^^^^^^^^ help: change this to: payload_config_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/hooks/resource.rs|136 col 28| error: this call to as_ref
does nothing
--> src/hooks/resource.rs:136:28
|
136 | let arch_regex = match machine_arch.as_ref() {
| ^^^^^^^^^^^^^^^^^^^^^ help: try: machine_arch
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
= note: -D clippy::useless-asref
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::useless_asref)]
src/hooks/resource.rs|162 col 14| error: the borrowed expression implements the required traits
--> src/hooks/resource.rs:162:14
|
162 | .get(&first_release_url)
| ^^^^^^^^^^^^^^^^^^ help: change this to: first_release_url
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/hooks/resource.rs|178 col 9| error: returning the result of a let
binding from a block
--> src/hooks/resource.rs:183:9
|
178 | / let binary_pattern_matched_assets = filtered_assets
179 | | .into_iter()
180 | | .filter(|asset| re.is_match(&asset.name))
181 | | .collect::<Vec<&GitHubReleaseAsset>>();
| |________________________- unnecessary let
binding
182 |
183 | binary_pattern_matched_assets
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: -D clippy::let-and-return
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::let_and_return)]
help: return the expression directly
|
178 ~
179 |
180 ~ filtered_assets
181 + .into_iter()
182 + .filter(|asset| re.is_match(&asset.name))
183 + .collect::<Vec<&GitHubReleaseAsset>>()
|
src/hooks/resource.rs|170 col 29| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:170:29
|
170 | let re = Regex::new(&binary_pattern)?;
| ^^^^^^^^^^^^^^^ help: change this to: binary_pattern
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|175 col 14| error: this .into_iter()
call is equivalent to .iter()
and will not consume the Vec
--> src/hooks/resource.rs:175:14
|
175 | .into_iter()
| ^^^^^^^^^ help: call directly: iter
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
= note: -D clippy::into-iter-on-ref
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::into_iter_on_ref)]
src/hooks/resource.rs|188 col 14| error: this .into_iter()
call is equivalent to .iter()
and will not consume the slice
--> src/hooks/resource.rs:188:14
|
188 | .into_iter()
| ^^^^^^^^^ help: call directly: iter
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
src/hooks/resource.rs|195 col 14| error: this .into_iter()
call is equivalent to .iter()
and will not consume the Vec
--> src/hooks/resource.rs:195:14
|
195 | .into_iter()
| ^^^^^^^^^ help: call directly: iter
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
src/hooks/resource.rs|212 col 12| error: length comparison to zero
--> src/hooks/resource.rs:212:12
|
212 | if os_arch_matched_assets.len() > 0usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using !is_empty
is clearer and more explicit: !os_arch_matched_assets.is_empty()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: -D clippy::len-zero
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::len_zero)]
src/hooks/resource.rs|214 col 19| error: length comparison to zero
--> src/hooks/resource.rs:214:19
|
214 | } else if os_matched_assets.len() > 0usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using !is_empty
is clearer and more explicit: !os_matched_assets.is_empty()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
src/hooks/resource.rs|217 col 20| error: this .into_iter()
call is equivalent to .iter()
and will not consume the Vec
--> src/hooks/resource.rs:217:20
|
217 | assets.into_iter().collect()
| ^^^^^^^^^ help: call directly: iter
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
src/hooks/resource.rs|233 col 49| error: the borrowed expression implements the required traits
--> src/hooks/resource.rs:233:49
|
233 | let file_path = payload_config_dir.join(&file_name);
| ^^^^^^^^^^ help: change this to: file_name
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/hooks/resource.rs|240 col 59| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:240:59
|
240 | let dest_path = move_resource_to_current_dir(&dest.1, ¤t_install_dir)?;
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|251 col 47| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:251:47
|
251 | let repo_name = clone_repo(current_shell, &payload_config_dir, &repo)?;
| ^^^^^^^^^^^^^^^^^^^ help: change this to: payload_config_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|251 col 68| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:251:68
|
251 | let repo_name = clone_repo(current_shell, &payload_config_dir, &repo)?;
| ^^^^^ help: change this to: repo
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|252 col 49| error: the borrowed expression implements the required traits
--> src/hooks/resource.rs:252:49
|
252 | let resource_path = payload_config_dir.join(&repo_name);
| ^^^^^^^^^^ help: change this to: repo_name
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/hooks/resource.rs|253 col 45| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:253:45
|
253 | set_resource_as_current(&resource_path, ¤t_install_dir)?;
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|257 col 43| error: the borrowed expression implements the required traits
--> src/hooks/resource.rs:257:43
|
257 | assert!(std::env::set_current_dir(¤t_install_dir).is_ok());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/hooks/resource.rs|273 col 50| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:273:50
|
273 | let url = get_repo_release_asset_url(&repo)?;
| ^^^^^ help: change this to: repo
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|274 col 28| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:274:28
|
274 | Some(get_asset(&payload_config_dir, ¤t_install_dir, &url)?)
| ^^^^^^^^^^^^^^^^^^^ help: change this to: payload_config_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|274 col 49| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:274:49
|
274 | Some(get_asset(&payload_config_dir, ¤t_install_dir, &url)?)
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|278 col 17| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:278:17
|
278 | &repo,
| ^^^^^ help: change this to: repo
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|279 col 17| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:279:17
|
279 | &payload_config_dir,
| ^^^^^^^^^^^^^^^^^^^ help: change this to: payload_config_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|280 col 17| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:280:17
|
280 | ¤t_install_dir,
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|287 col 13| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:287:13
|
287 | &repo,
| ^^^^^ help: change this to: repo
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|288 col 13| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:288:13
|
288 | &payload_config_dir,
| ^^^^^^^^^^^^^^^^^^^ help: change this to: payload_config_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|289 col 13| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:289:13
|
289 | ¤t_install_dir,
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|306 col 13| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:306:13
|
306 | &payload_config_dir,
| ^^^^^^^^^^^^^^^^^^^ help: change this to: payload_config_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|307 col 13| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:307:13
|
307 | ¤t_install_dir,
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|311 col 24| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:311:24
|
311 | Some(get_asset(&payload_config_dir, ¤t_install_dir, &url)?)
| ^^^^^^^^^^^^^^^^^^^ help: change this to: payload_config_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|311 col 45| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:311:45
|
311 | Some(get_asset(&payload_config_dir, ¤t_install_dir, &url)?)
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|311 col 67| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:311:67
|
311 | Some(get_asset(&payload_config_dir, ¤t_install_dir, &url)?)
| ^^^^ help: change this to: url
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|327 col 13| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:327:13
|
327 | &payload_config_dir,
| ^^^^^^^^^^^^^^^^^^^ help: change this to: payload_config_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|328 col 13| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:328:13
|
328 | ¤t_install_dir,
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|332 col 35| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:332:35
|
332 | get_resource_location(&payload_config_dir, ¤t_install_dir, &url, init_result)
| ^^^^^^^^^^^^^^^^^^^ help: change this to: payload_config_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|332 col 56| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:332:56
|
332 | get_resource_location(&payload_config_dir, ¤t_install_dir, &url, init_result)
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|332 col 78| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:332:78
|
332 | get_resource_location(&payload_config_dir, ¤t_install_dir, &url, init_result)
| ^^^^ help: change this to: url
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|362 col 17| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:362:17
|
362 | &res,
| ^^^^ help: change this to: res
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|367 col 17| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:367:17
|
367 | &payload_config_dir,
| ^^^^^^^^^^^^^^^^^^^ help: change this to: payload_config_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|368 col 17| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:368:17
|
368 | ¤t_install_dir,
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|388 col 50| error: this call to as_ref
does nothing
--> src/hooks/resource.rs:388:50
|
388 | let supported_arch_specific_resource = match machine_arch.as_ref() {
| ^^^^^^^^^^^^^^^^^^^^^ help: try: machine_arch
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
src/hooks/resource.rs|402 col 13| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:402:13
|
402 | &res,
| ^^^^ help: change this to: res
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|417 col 58| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:417:58
|
417 | let payload_config_dir = get_payload_config_dir_path(&payload)?;
| ^^^^^^^^ help: change this to: payload
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/resource.rs|418 col 68| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/resource.rs:418:68
|
418 | let current_install_dir = get_payload_current_install_dir_path(&payload)?;
| ^^^^^^^^ help: change this to: payload
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/src.rs|15 col 75| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/src.rs:15:75
|
15 | ShellSpecificSourceTarget::Generic(generic) => process_src_target(&generic),
| ^^^^^^^^ help: change this to: generic
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/src.rs|27 col 36| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/src.rs:27:36
|
27 | process_src_target(&shell_specific_target)
| ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: shell_specific_target
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/src.rs|37 col 23| error: single-character string constant used as pattern
--> src/hooks/src.rs:37:23
|
37 | if f.contains("*") {
| ^^^ help: try using a char
instead: '*'
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
= note: -D clippy::single-char-pattern
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::single_char_pattern)]
src/hooks/src.rs|39 col 13| error: unnecessary if let
since only the Ok
variant of the iterator element is used
--> src/hooks/src.rs:39:13
|
39 | for entry in glob(&f).expect(&format!("unable to locate {}", f)) {
| ^ --------------------------------------------------- help: try: glob(&f).expect(&format!("unable to locate {}", f)).flatten()
| |
| |
40 | | if let Ok(entry_path) = entry {
41 | | print_src_path_canonical(&entry_path.display().to_string());
42 | | }
43 | | }
| |^
|
help: ...and remove the if let
statement in the for loop
--> src/hooks/src.rs:40:17
|
40 | / if let Ok(entry_path) = entry {
41 | | print_src_path_canonical(&entry_path.display().to_string());
42 | | }
| |^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
= note: -D clippy::manual-flatten
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::manual_flatten)]
src/hooks/src.rs|39 col 35| error: use of expect
followed by a function call
--> src/hooks/src.rs:39:35
|
39 | for entry in glob(&f).expect(&format!("unable to locate {}", f)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: unwrap_or_else(|_| panic!("unable to locate {}", f))
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
= note: -D clippy::expect-fun-call
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::expect_fun_call)]
src/hooks/src.rs|39 col 31| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/src.rs:39:31
|
39 | for entry in glob(&f).expect(&format!("unable to locate {}", f)) {
| ^^ help: change this to: f
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/hooks/src.rs|45 col 38| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/hooks/src.rs:45:38
|
45 | print_src_path_canonical(&f);
| ^^ help: change this to: f
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/config.rs|39 col 1| error: large size difference between variants
--> src/utils/config.rs:39:1
|
39 | / pub enum AdaptiveResource {
40 | | Standard(Resource),
| | ------------------ the second-largest variant contains at least 104 bytes
41 | | OSSpecific(SupportedOSSpecificResource),
| | --------------------------------------- the largest variant contains at least 624 bytes
42 | | }
| |^ the entire enum is at least 624 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
= note: -D clippy::large-enum-variant
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::large_enum_variant)]
help: consider boxing the large fields to reduce the total size of the enum
|
41 | OSSpecific(Box),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/utils/config.rs|90 col 1| error: large size difference between variants
--> src/utils/config.rs:90:1
|
90 | / pub enum ShellSpecificCommand {
91 | | Generic(String),
| | --------------- the second-largest variant contains at least 24 bytes
92 | | ShellSpecific(SupportedShellSpecificCommand),
| | -------------------------------------------- the largest variant contains at least 480 bytes
93 | | }
| |^ the entire enum is at least 480 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
help: consider boxing the large fields to reduce the total size of the enum
|
92 | ShellSpecific(Box),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/utils/paths.rs|104 col 27| error: single-character string constant used as pattern
--> src/utils/paths.rs:104:27
|
104 | if file_path.contains("*") {
| ^^^ help: try using a char
instead: '*'
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
src/utils/paths.rs|105 col 26| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/paths.rs:105:26
|
105 | let entry = glob(&file_path)?
| ^^^^^^^^^^ help: change this to: file_path
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/paths.rs|109 col 36| error: the borrowed expression implements the required traits
--> src/utils/paths.rs:109:36
|
109 | return Ok(fs::canonicalize(&entry)?);
| ^^^^^^ help: change this to: entry
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/utils/paths.rs|124 col 26| error: writing &PathBuf
instead of &Path
involves a new object where a slice will do
--> src/utils/paths.rs:124:26
|
124 | pub fn get_dir(bin_path: &PathBuf) -> Result<PathBuf, Box> {
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: -D clippy::ptr-arg
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::ptr_arg)]
help: change this to
|
124 ~ pub fn get_dir(bin_path: &Path) -> Result<PathBuf, Box> {
125 ~ let mut bin_path = bin_path.to_path_buf();
|
src/utils/pipeline.rs|41 col 43| error: the borrowed expression implements the required traits
--> src/utils/pipeline.rs:41:43
|
41 | assert!(std::env::set_current_dir(¤t_install_dir).is_ok());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/utils/pipeline.rs|45 col 36| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/pipeline.rs:45:36
|
45 | extract(current_shell, &extract_cmd)?;
| ^^^^^^^^^^^^ help: change this to: extract_cmd
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/pipeline.rs|47 col 42| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/pipeline.rs:47:42
|
47 | extract_asset(current_shell, &asset_path)?;
| ^^^^^^^^^^^ help: change this to: asset_path
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/pipeline.rs|61 col 25| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/pipeline.rs:61:25
|
61 | &cmd,
| ^^^^ help: change this to: cmd
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/pipeline.rs|62 col 58| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/pipeline.rs:62:58
|
62 | &get_shim_content(current_shell, &cmd, &cmd, None)?,
| ^^^^ help: change this to: cmd
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/pipeline.rs|62 col 64| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/pipeline.rs:62:64
|
62 | &get_shim_content(current_shell, &cmd, &cmd, None)?,
| ^^^^ help: change this to: cmd
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/pipeline.rs|99 col 43| error: the borrowed expression implements the required traits
--> src/utils/pipeline.rs:99:43
|
99 | assert!(std::env::set_current_dir(¤t_install_dir).is_ok());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/utils/pipeline.rs|108 col 43| error: the borrowed expression implements the required traits
--> src/utils/pipeline.rs:108:43
|
108 | assert!(std::env::set_current_dir(¤t_install_dir).is_ok());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: current_install_dir
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/utils/pipeline.rs|121 col 29| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/pipeline.rs:121:29
|
121 | remove_shim(&cmd)?;
| ^^^^ help: change this to: cmd
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/script.rs|41 col 83| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/script.rs:41:83
|
41 | OSSpecificCommand::Generic(cmd) => run_cmd_with_output(current_shell, &cmd)?,
| ^^^^ help: change this to: cmd
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/script.rs|47 col 64| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/script.rs:47:64
|
47 | ... run_cmd_with_output(current_shell, &cmd)?
| ^^^^ help: change this to: cmd
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/script.rs|54 col 64| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/script.rs:54:64
|
54 | ... run_cmd_with_output(current_shell, &cmd)?
| ^^^^ help: change this to: cmd
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/script.rs|61 col 64| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/script.rs:61:64
|
61 | ... run_cmd_with_output(current_shell, &cmd)?
| ^^^^ help: change this to: cmd
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/script.rs|88 col 5| error: question mark operator is useless here
--> src/utils/script.rs:88:5
|
88 | Ok(run_os_specific_cmd(current_shell, os_specific_cmd)?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and Ok()
: run_os_specific_cmd(current_shell, os_specific_cmd)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: -D clippy::needless-question-mark
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::needless_question_mark)]
src/utils/shells.rs|37 col 5| error: method from_str
can be confused for the standard trait method std::str::FromStr::from_str
--> src/utils/shells.rs:37:5
|
37 | / pub fn from_str(shell: &str) -> SupportedShell {
38 | | match shell {
39 | | "sh" => SupportedShell::Sh,
40 | | "zsh" => SupportedShell::Zsh,
... |
46 | | }
47 | | }
| |^
|
= help: consider implementing the trait std::str::FromStr
or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
= note: -D clippy::should-implement-trait
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::should_implement_trait)]
src/utils/shim.rs|12 col 5| error: question mark operator is useless here
--> src/utils/shim.rs:12:5
|
12 | Ok(get_file_name(func)?)
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and Ok()
: get_file_name(func)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
src/utils/shim.rs|60 col 43| error: single-character string constant used as pattern
--> src/utils/shim.rs:60:43
|
60 | internal_func = func_name.replace("-", ""),
| ^^^ help: try using a char
instead: '-'
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
src/utils/shim.rs|66 col 5| error: question mark operator is useless here
--> src/utils/shim.rs:66:5
|
66 | Ok(get_bin_file_path(&get_func_name(&cmd)?)?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and Ok()
: get_bin_file_path(&get_func_name(&cmd)?)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
src/utils/shim.rs|66 col 41| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/shim.rs:66:41
|
66 | Ok(get_bin_file_path(&get_func_name(&cmd)?)?)
| ^^^^ help: change this to: cmd
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/shim.rs|74 col 24| error: the borrowed expression implements the required traits
--> src/utils/shim.rs:74:24
|
74 | fs::create_dir_all(&get_bin_dir_path()?)?;
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: get_bin_dir_path()?
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
src/utils/shim.rs|75 col 35| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/shim.rs:75:35
|
75 | let shim_path = get_shim_path(&cmd)?;
| ^^^^ help: change this to: cmd
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/shim.rs|89 col 38| error: this expression creates a reference which is immediately dereferenced by the compiler
--> src/utils/shim.rs:89:38
|
89 | Ok(fs::remove_file(get_shim_path(&cmd)?)?)
| ^^^^ help: change this to: cmd
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
src/utils/symlink.rs|26 col 49| error: to_string
applied to a type that implements Display
in println!
args
--> src/utils/symlink.rs:26:49
|
26 | get_bin_file_path(&file_name)?.display().to_string()
| ^^^^^^^^^^^^ help: remove this
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
= note: -D clippy::to-string-in-format-args
implied by -D warnings
= help: to override -D warnings
add #[allow(clippy::to_string_in_format_args)]