[INFO] cloning repository https://github.com/insixdev/cli-tool-dir-managment [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/insixdev/cli-tool-dir-managment" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Finsixdev%2Fcli-tool-dir-managment", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Finsixdev%2Fcli-tool-dir-managment'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 84af6258d7546f71a0b729ddcc720a0db11dbc1e [INFO] linting insixdev/cli-tool-dir-managment against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Finsixdev%2Fcli-tool-dir-managment" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/insixdev/cli-tool-dir-managment [INFO] finished tweaking git repo https://github.com/insixdev/cli-tool-dir-managment [INFO] tweaked toml for git repo https://github.com/insixdev/cli-tool-dir-managment written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/insixdev/cli-tool-dir-managment on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/insixdev/cli-tool-dir-managment already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded directories v5.0.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 41ac53fbd9dd2bb23b62f4740aeb480a1e0cbdea541b1dfe37c591b22fbf086f [INFO] running `Command { std: "docker" "start" "-a" "41ac53fbd9dd2bb23b62f4740aeb480a1e0cbdea541b1dfe37c591b22fbf086f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "41ac53fbd9dd2bb23b62f4740aeb480a1e0cbdea541b1dfe37c591b22fbf086f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "41ac53fbd9dd2bb23b62f4740aeb480a1e0cbdea541b1dfe37c591b22fbf086f", kill_on_drop: false }` [INFO] [stdout] 41ac53fbd9dd2bb23b62f4740aeb480a1e0cbdea541b1dfe37c591b22fbf086f [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 61ecd22fe9e8283f6002c7f46830bca51ffc103aa9b49ba2bf34e3b766732b08 [INFO] running `Command { std: "docker" "start" "-a" "61ecd22fe9e8283f6002c7f46830bca51ffc103aa9b49ba2bf34e3b766732b08", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.175 [INFO] [stderr] Checking dirs-sys v0.4.1 [INFO] [stderr] Checking directories v5.0.1 [INFO] [stderr] Checking cliToolCarpet v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `Permissions` [INFO] [stdout] --> src/main.rs:2:50 [INFO] [stdout] | [INFO] [stdout] 2 | use std::fs::{create_dir_all, File, OpenOptions, Permissions}; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Error` [INFO] [stdout] --> src/main.rs:3:30 [INFO] [stdout] | [INFO] [stdout] 3 | use std::io::{self, BufRead, Error, Read, Write }; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::num::ParseIntError` [INFO] [stdout] --> src/main.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use std::num::ParseIntError; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/main.rs:16:28 [INFO] [stdout] | [INFO] [stdout] 16 | let dir = Directory {name: name, directory: path}; [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Permissions` [INFO] [stdout] --> src/main.rs:2:50 [INFO] [stdout] | [INFO] [stdout] 2 | use std::fs::{create_dir_all, File, OpenOptions, Permissions}; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Error` [INFO] [stdout] --> src/main.rs:3:30 [INFO] [stdout] | [INFO] [stdout] 3 | use std::io::{self, BufRead, Error, Read, Write }; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::num::ParseIntError` [INFO] [stdout] --> src/main.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use std::num::ParseIntError; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/main.rs:16:28 [INFO] [stdout] | [INFO] [stdout] 16 | let dir = Directory {name: name, directory: path}; [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Read` [INFO] [stdout] --> src/main.rs:3:37 [INFO] [stdout] | [INFO] [stdout] 3 | use std::io::{self, BufRead, Error, Read, Write }; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `name_arg` [INFO] [stdout] --> src/main.rs:197:38 [INFO] [stdout] | [INFO] [stdout] 197 | fn option_create_dir(dir_arg: &str , name_arg: &str) { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_name_arg` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `name` is never read [INFO] [stdout] --> src/main.rs:11:4 [INFO] [stdout] | [INFO] [stdout] 9 | struct Directory { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] 10 | directory: PathBuf, [INFO] [stdout] 11 | name: String, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/main.rs:17:7 [INFO] [stdout] | [INFO] [stdout] 16 | let dir = Directory {name: name, directory: path}; [INFO] [stdout] | -------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 17 | dir [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 16 ~ [INFO] [stdout] 17 ~ Directory {name: name, directory: path} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:47:4 [INFO] [stdout] | [INFO] [stdout] 47 | / match directories::ProjectDirs::from("com", "insixdev", "cliTool") { [INFO] [stdout] 48 | | Some(proj_dirs) => { [INFO] [stdout] 49 | | let data_dir = proj_dirs.data_dir(); // para linux seria [INFO] [stdout] ... | [INFO] [stdout] 57 | | _ => (), [INFO] [stdout] 58 | | } [INFO] [stdout] | |____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 47 ~ if let Some(proj_dirs) = directories::ProjectDirs::from("com", "insixdev", "cliTool") { [INFO] [stdout] 48 + let data_dir = proj_dirs.data_dir(); // para linux seria [INFO] [stdout] 49 + // $HOME/.local/share/clitool [INFO] [stdout] 50 + [INFO] [stdout] 51 + if !data_dir.exists() { // si no existe [INFO] [stdout] 52 + create_dir_all(data_dir).expect("Failed to create data directory."); [INFO] [stdout] 53 + } [INFO] [stdout] 54 + return data_dir.to_path_buf(); [INFO] [stdout] 55 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:65:18 [INFO] [stdout] | [INFO] [stdout] 65 | fn get_arg(args: &Vec, val: i32) -> &str { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 65 - fn get_arg(args: &Vec, val: i32) -> &str { [INFO] [stdout] 65 + fn get_arg(args: &[String], val: i32) -> &str { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/main.rs:68:23 [INFO] [stdout] | [INFO] [stdout] 68 | if let Some(arg) = args.iter().nth(val as usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] = note: `#[warn(clippy::iter_nth)]` on by default [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 68 - if let Some(arg) = args.iter().nth(val as usize) { [INFO] [stdout] 68 + if let Some(arg) = args.get(val as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:85:7 [INFO] [stdout] | [INFO] [stdout] 85 | if !(args.iter().nth(4) == None) {println!("opcion desconocida/max arg exedido"); std::process::exit(1)} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(args.iter().nth(4) != None)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Read` [INFO] [stdout] --> src/main.rs:3:37 [INFO] [stdout] | [INFO] [stdout] 3 | use std::io::{self, BufRead, Error, Read, Write }; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:78:4 [INFO] [stdout] | [INFO] [stdout] 78 | / if args.get(1).map(|s| s.as_str()) == Some("init") { [INFO] [stdout] 79 | | if let Some(shell) = args.get(2) { [INFO] [stdout] 80 | | print_init(shell); [INFO] [stdout] 81 | | return Ok(()); [INFO] [stdout] 82 | | } [INFO] [stdout] 83 | | } [INFO] [stdout] | |____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 78 ~ if args.get(1).map(|s| s.as_str()) == Some("init") [INFO] [stdout] 79 ~ && let Some(shell) = args.get(2) { [INFO] [stdout] 80 | print_init(shell); [INFO] [stdout] 81 | return Ok(()); [INFO] [stdout] 82 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/main.rs:85:8 [INFO] [stdout] | [INFO] [stdout] 85 | if !(args.iter().nth(4) == None) {println!("opcion desconocida/max arg exedido"); std::process::exit(1)} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `args.iter().nth(4).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/main.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 85 | if !(args.iter().nth(4) == None) {println!("opcion desconocida/max arg exedido"); std::process::exit(1)} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 85 - if !(args.iter().nth(4) == None) {println!("opcion desconocida/max arg exedido"); std::process::exit(1)} [INFO] [stdout] 85 + if !(args.get(4) == None) {println!("opcion desconocida/max arg exedido"); std::process::exit(1)} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:91:33 [INFO] [stdout] | [INFO] [stdout] 91 | "-c" => option_create_dir(&arg2, &arg3 ), [INFO] [stdout] | ^^^^^ help: change this to: `arg2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:91:40 [INFO] [stdout] | [INFO] [stdout] 91 | "-c" => option_create_dir(&arg2, &arg3 ), [INFO] [stdout] | ^^^^^ help: change this to: `arg3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:92:25 [INFO] [stdout] | [INFO] [stdout] 92 | "-g" => option_go(&arg2), [INFO] [stdout] | ^^^^^ help: change this to: `arg2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:95:33 [INFO] [stdout] | [INFO] [stdout] 95 | "-d" => option_delete_dir(&arg2), [INFO] [stdout] | ^^^^^ help: change this to: `arg2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:137:44 [INFO] [stdout] | [INFO] [stdout] 137 | if let Err(e) = env::set_current_dir(&new_dir) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `new_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:198:25 [INFO] [stdout] | [INFO] [stdout] 198 | let dir = verify_dir(&dir_arg); [INFO] [stdout] | ^^^^^^^^ help: change this to: `dir_arg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/main.rs:230:4 [INFO] [stdout] | [INFO] [stdout] 223 | / let file = OpenOptions::new() [INFO] [stdout] 224 | | .read(true) [INFO] [stdout] 225 | | .write(true) [INFO] [stdout] 226 | | .create(true) [INFO] [stdout] 227 | | .append(true) [INFO] [stdout] 228 | | .open(&data_dir); [INFO] [stdout] | |_______________________- unnecessary `let` binding [INFO] [stdout] 229 | [INFO] [stdout] 230 | file [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 223 ~ [INFO] [stdout] 224 | [INFO] [stdout] 225 ~ OpenOptions::new() [INFO] [stdout] 226 + .read(true) [INFO] [stdout] 227 + .write(true) [INFO] [stdout] 228 + .create(true) [INFO] [stdout] 229 + .append(true) [INFO] [stdout] 230 + .open(&data_dir) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `.write(true)` because there is `.append(true)` [INFO] [stdout] --> src/main.rs:225:7 [INFO] [stdout] | [INFO] [stdout] 225 | .write(true) [INFO] [stdout] | ^^^^^^^^^^^^ help: remove `.write(true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_open_options [INFO] [stdout] = note: `#[warn(clippy::ineffective_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `name_arg` [INFO] [stdout] --> src/main.rs:197:38 [INFO] [stdout] | [INFO] [stdout] 197 | fn option_create_dir(dir_arg: &str , name_arg: &str) { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_name_arg` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `name` is never read [INFO] [stdout] --> src/main.rs:11:4 [INFO] [stdout] | [INFO] [stdout] 9 | struct Directory { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] 10 | directory: PathBuf, [INFO] [stdout] 11 | name: String, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/main.rs:17:7 [INFO] [stdout] | [INFO] [stdout] 16 | let dir = Directory {name: name, directory: path}; [INFO] [stdout] | -------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 17 | dir [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 16 ~ [INFO] [stdout] 17 ~ Directory {name: name, directory: path} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:47:4 [INFO] [stdout] | [INFO] [stdout] 47 | / match directories::ProjectDirs::from("com", "insixdev", "cliTool") { [INFO] [stdout] 48 | | Some(proj_dirs) => { [INFO] [stdout] 49 | | let data_dir = proj_dirs.data_dir(); // para linux seria [INFO] [stdout] ... | [INFO] [stdout] 57 | | _ => (), [INFO] [stdout] 58 | | } [INFO] [stdout] | |____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 47 ~ if let Some(proj_dirs) = directories::ProjectDirs::from("com", "insixdev", "cliTool") { [INFO] [stdout] 48 + let data_dir = proj_dirs.data_dir(); // para linux seria [INFO] [stdout] 49 + // $HOME/.local/share/clitool [INFO] [stdout] 50 + [INFO] [stdout] 51 + if !data_dir.exists() { // si no existe [INFO] [stdout] 52 + create_dir_all(data_dir).expect("Failed to create data directory."); [INFO] [stdout] 53 + } [INFO] [stdout] 54 + return data_dir.to_path_buf(); [INFO] [stdout] 55 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:65:18 [INFO] [stdout] | [INFO] [stdout] 65 | fn get_arg(args: &Vec, val: i32) -> &str { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 65 - fn get_arg(args: &Vec, val: i32) -> &str { [INFO] [stdout] 65 + fn get_arg(args: &[String], val: i32) -> &str { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/main.rs:68:23 [INFO] [stdout] | [INFO] [stdout] 68 | if let Some(arg) = args.iter().nth(val as usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] = note: `#[warn(clippy::iter_nth)]` on by default [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 68 - if let Some(arg) = args.iter().nth(val as usize) { [INFO] [stdout] 68 + if let Some(arg) = args.get(val as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:85:7 [INFO] [stdout] | [INFO] [stdout] 85 | if !(args.iter().nth(4) == None) {println!("opcion desconocida/max arg exedido"); std::process::exit(1)} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(args.iter().nth(4) != None)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:78:4 [INFO] [stdout] | [INFO] [stdout] 78 | / if args.get(1).map(|s| s.as_str()) == Some("init") { [INFO] [stdout] 79 | | if let Some(shell) = args.get(2) { [INFO] [stdout] 80 | | print_init(shell); [INFO] [stdout] 81 | | return Ok(()); [INFO] [stdout] 82 | | } [INFO] [stdout] 83 | | } [INFO] [stdout] | |____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 78 ~ if args.get(1).map(|s| s.as_str()) == Some("init") [INFO] [stdout] 79 ~ && let Some(shell) = args.get(2) { [INFO] [stdout] 80 | print_init(shell); [INFO] [stdout] 81 | return Ok(()); [INFO] [stdout] 82 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/main.rs:85:8 [INFO] [stdout] | [INFO] [stdout] 85 | if !(args.iter().nth(4) == None) {println!("opcion desconocida/max arg exedido"); std::process::exit(1)} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `args.iter().nth(4).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/main.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 85 | if !(args.iter().nth(4) == None) {println!("opcion desconocida/max arg exedido"); std::process::exit(1)} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 85 - if !(args.iter().nth(4) == None) {println!("opcion desconocida/max arg exedido"); std::process::exit(1)} [INFO] [stdout] 85 + if !(args.get(4) == None) {println!("opcion desconocida/max arg exedido"); std::process::exit(1)} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:91:33 [INFO] [stdout] | [INFO] [stdout] 91 | "-c" => option_create_dir(&arg2, &arg3 ), [INFO] [stdout] | ^^^^^ help: change this to: `arg2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:91:40 [INFO] [stdout] | [INFO] [stdout] 91 | "-c" => option_create_dir(&arg2, &arg3 ), [INFO] [stdout] | ^^^^^ help: change this to: `arg3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:92:25 [INFO] [stdout] | [INFO] [stdout] 92 | "-g" => option_go(&arg2), [INFO] [stdout] | ^^^^^ help: change this to: `arg2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:95:33 [INFO] [stdout] | [INFO] [stdout] 95 | "-d" => option_delete_dir(&arg2), [INFO] [stdout] | ^^^^^ help: change this to: `arg2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:137:44 [INFO] [stdout] | [INFO] [stdout] 137 | if let Err(e) = env::set_current_dir(&new_dir) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `new_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:198:25 [INFO] [stdout] | [INFO] [stdout] 198 | let dir = verify_dir(&dir_arg); [INFO] [stdout] | ^^^^^^^^ help: change this to: `dir_arg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/main.rs:230:4 [INFO] [stdout] | [INFO] [stdout] 223 | / let file = OpenOptions::new() [INFO] [stdout] 224 | | .read(true) [INFO] [stdout] 225 | | .write(true) [INFO] [stdout] 226 | | .create(true) [INFO] [stdout] 227 | | .append(true) [INFO] [stdout] 228 | | .open(&data_dir); [INFO] [stdout] | |_______________________- unnecessary `let` binding [INFO] [stdout] 229 | [INFO] [stdout] 230 | file [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 223 ~ [INFO] [stdout] 224 | [INFO] [stdout] 225 ~ OpenOptions::new() [INFO] [stdout] 226 + .read(true) [INFO] [stdout] 227 + .write(true) [INFO] [stdout] 228 + .create(true) [INFO] [stdout] 229 + .append(true) [INFO] [stdout] 230 + .open(&data_dir) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `.write(true)` because there is `.append(true)` [INFO] [stdout] --> src/main.rs:225:7 [INFO] [stdout] | [INFO] [stdout] 225 | .write(true) [INFO] [stdout] | ^^^^^^^^^^^^ help: remove `.write(true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_open_options [INFO] [stdout] = note: `#[warn(clippy::ineffective_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.47s [INFO] running `Command { std: "docker" "inspect" "61ecd22fe9e8283f6002c7f46830bca51ffc103aa9b49ba2bf34e3b766732b08", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "61ecd22fe9e8283f6002c7f46830bca51ffc103aa9b49ba2bf34e3b766732b08", kill_on_drop: false }` [INFO] [stdout] 61ecd22fe9e8283f6002c7f46830bca51ffc103aa9b49ba2bf34e3b766732b08