[INFO] cloning repository https://github.com/studylessshape/qcpro [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/studylessshape/qcpro" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fstudylessshape%2Fqcpro", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fstudylessshape%2Fqcpro'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 08b8522c9c08191dc211244eeac4dc24688048a8 [INFO] linting studylessshape/qcpro against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fstudylessshape%2Fqcpro" "/workspace/builds/worker-3-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/studylessshape/qcpro [INFO] finished tweaking git repo https://github.com/studylessshape/qcpro [INFO] tweaked toml for git repo https://github.com/studylessshape/qcpro written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/studylessshape/qcpro 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/studylessshape/qcpro 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] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] d83d8670fa8c2c0f6eafd0aab3683d496a187437d12630d12e6ea8abce29a849 [INFO] running `Command { std: "docker" "start" "-a" "d83d8670fa8c2c0f6eafd0aab3683d496a187437d12630d12e6ea8abce29a849", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "d83d8670fa8c2c0f6eafd0aab3683d496a187437d12630d12e6ea8abce29a849", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d83d8670fa8c2c0f6eafd0aab3683d496a187437d12630d12e6ea8abce29a849", kill_on_drop: false }` [INFO] [stdout] d83d8670fa8c2c0f6eafd0aab3683d496a187437d12630d12e6ea8abce29a849 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 00fc9994b70d8b86d13ccdc9e35b1e57a7afee9138d5f7139aa6d951ba80a1cc [INFO] running `Command { std: "docker" "start" "-a" "00fc9994b70d8b86d13ccdc9e35b1e57a7afee9138d5f7139aa6d951ba80a1cc", kill_on_drop: false }` [INFO] [stderr] Checking qcpro v0.2.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/project/initialize.rs:12:33 [INFO] [stdout] | [INFO] [stdout] 12 | if directory.clone() == String::from(".") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `"."` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern reimplements `Option::unwrap_or` [INFO] [stdout] --> src/project/initialize.rs:13:26 [INFO] [stdout] | [INFO] [stdout] 13 | String::from(match env::current_dir()?.to_str() { [INFO] [stdout] | __________________________^ [INFO] [stdout] 14 | | Some(s) => s, [INFO] [stdout] 15 | | None => ".", [INFO] [stdout] 16 | | }) [INFO] [stdout] | |_____________^ help: replace with: `env::current_dir()?.to_str().unwrap_or(".")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/project/initialize.rs:26:16 [INFO] [stdout] | [INFO] [stdout] 26 | if last.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `last.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/project/build.rs:15:19 [INFO] [stdout] | [INFO] [stdout] 15 | .args(&["-S", &source_path, "-B", &build_path]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["-S", &source_path, "-B", &build_path]` [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 can be `std::io::Error::other(_)` [INFO] [stdout] --> src/project/build.rs:23:17 [INFO] [stdout] | [INFO] [stdout] 23 | Err(io::Error::new( [INFO] [stdout] | _________________^ [INFO] [stdout] 24 | | io::ErrorKind::Other, [INFO] [stdout] 25 | | "CMake build occured error!", [INFO] [stdout] 26 | | )) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] = note: `#[warn(clippy::io_other_error)]` on by default [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 23 ~ Err(io::Error::other( [INFO] [stdout] 24 ~ "CMake build occured error!", [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/project/build.rs:30:19 [INFO] [stdout] | [INFO] [stdout] 30 | .args(&["-S", &source_path, "-B", &build_path]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["-S", &source_path, "-B", &build_path]` [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] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/project/build.rs:39:17 [INFO] [stdout] | [INFO] [stdout] 39 | Err(io::Error::new( [INFO] [stdout] | _________________^ [INFO] [stdout] 40 | | io::ErrorKind::Other, [INFO] [stdout] 41 | | "CMake build occured error!", [INFO] [stdout] 42 | | )) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 39 ~ Err(io::Error::other( [INFO] [stdout] 40 ~ "CMake build occured error!", [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/project/build.rs:55:20 [INFO] [stdout] | [INFO] [stdout] 55 | return Err(io::Error::new( [INFO] [stdout] | ____________________^ [INFO] [stdout] 56 | | io::ErrorKind::Other, [INFO] [stdout] 57 | | "Compile occured error!", [INFO] [stdout] 58 | | )); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 55 ~ return Err(io::Error::other( [INFO] [stdout] 56 ~ "Compile occured error!", [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/project/run.rs:38:13 [INFO] [stdout] | [INFO] [stdout] 38 | Err(io::Error::new( [INFO] [stdout] | _____________^ [INFO] [stdout] 39 | | io::ErrorKind::Other, [INFO] [stdout] 40 | | format!("Run \'{}\' occured error!", project_name), [INFO] [stdout] 41 | | )) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 38 ~ Err(io::Error::other( [INFO] [stdout] 39 ~ format!("Run \'{}\' occured error!", project_name), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/project/run.rs:87:20 [INFO] [stdout] | [INFO] [stdout] 87 | if !(e.kind() == io::ErrorKind::AlreadyExists) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(e.kind() != io::ErrorKind::AlreadyExists)` [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: useless use of `format!` [INFO] [stdout] --> src/project/run.rs:58:34 [INFO] [stdout] | [INFO] [stdout] 58 | let src_path = PathBuf::from(format!("{}", current_dir)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `current_dir.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/project/run.rs:63:8 [INFO] [stdout] | [INFO] [stdout] 63 | if s.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/project/run.rs:82:12 [INFO] [stdout] | [INFO] [stdout] 82 | if build_args.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `build_args.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/project/run.rs:87:17 [INFO] [stdout] | [INFO] [stdout] 87 | / if !(e.kind() == io::ErrorKind::AlreadyExists) { [INFO] [stdout] 88 | | return Err(e); [INFO] [stdout] 89 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 86 ~ Err(e) [INFO] [stdout] 87 ~ if !(e.kind() == io::ErrorKind::AlreadyExists) => { [INFO] [stdout] 88 | return Err(e); [INFO] [stdout] 89 ~ } [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/project/run.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 85 | / match fs::create_dir("./bin") { [INFO] [stdout] 86 | | Err(e) => { [INFO] [stdout] 87 | | if !(e.kind() == io::ErrorKind::AlreadyExists) { [INFO] [stdout] 88 | | return Err(e); [INFO] [stdout] ... | [INFO] [stdout] 91 | | _ => {} [INFO] [stdout] 92 | | } [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] 85 ~ if let Err(e) = fs::create_dir("./bin") { [INFO] [stdout] 86 + if !(e.kind() == io::ErrorKind::AlreadyExists) { [INFO] [stdout] 87 + return Err(e); [INFO] [stdout] 88 + } [INFO] [stdout] 89 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/project/run.rs:106:28 [INFO] [stdout] | [INFO] [stdout] 106 | return Err(io::Error::new(io::ErrorKind::Other, "Run Error!")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 106 - return Err(io::Error::new(io::ErrorKind::Other, "Run Error!")); [INFO] [stdout] 106 + return Err(io::Error::other("Run Error!")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/project/run.rs:110:17 [INFO] [stdout] | [INFO] [stdout] 110 | Err(io::Error::new( [INFO] [stdout] | _________________^ [INFO] [stdout] 111 | | io::ErrorKind::Other, [INFO] [stdout] 112 | | "clang compile project occured error!", [INFO] [stdout] 113 | | )) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 110 ~ Err(io::Error::other( [INFO] [stdout] 111 ~ "clang compile project occured error!", [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/project/run.rs:121:23 [INFO] [stdout] | [INFO] [stdout] 121 | if is_ignore_path(&path, ignore) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [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: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/project/run.rs:128:5 [INFO] [stdout] | [INFO] [stdout] 128 | / for i in all_sub_path { [INFO] [stdout] 129 | | if let Ok(i_path) = i { [INFO] [stdout] 130 | | //If the path is directory, need to read the directory.Or add the path on s directly [INFO] [stdout] 131 | | match fs::read_dir(i_path.path()) { [INFO] [stdout] ... | [INFO] [stdout] 146 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/project/run.rs:129:9 [INFO] [stdout] | [INFO] [stdout] 129 | / if let Ok(i_path) = i { [INFO] [stdout] 130 | | //If the path is directory, need to read the directory.Or add the path on s directly [INFO] [stdout] 131 | | match fs::read_dir(i_path.path()) { [INFO] [stdout] 132 | | Ok(_sub_path) => { [INFO] [stdout] ... | [INFO] [stdout] 145 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 128 ~ for i_path in all_sub_path.into_iter().flatten() { [INFO] [stdout] 129 + //If the path is directory, need to read the directory.Or add the path on s directly [INFO] [stdout] 130 + match fs::read_dir(i_path.path()) { [INFO] [stdout] 131 + Ok(_sub_path) => { [INFO] [stdout] 132 + if let Ok(s_re) = read_path_file(&i_path.path(), ignore) { [INFO] [stdout] 133 + for i in s_re { [INFO] [stdout] 134 + s.push(i); [INFO] [stdout] 135 + } [INFO] [stdout] 136 + } [INFO] [stdout] 137 + } [INFO] [stdout] 138 + Err(_) => { [INFO] [stdout] 139 + if let Some(path) = i_path.path().to_str() { [INFO] [stdout] 140 + s.push(String::from(path)); [INFO] [stdout] 141 + } [INFO] [stdout] 142 + } [INFO] [stdout] 143 + } [INFO] [stdout] 144 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/project/run.rs:150:29 [INFO] [stdout] | [INFO] [stdout] 150 | pub fn is_ignore_path(path: &PathBuf, ignore: &Vec) -> bool { [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] 150 - pub fn is_ignore_path(path: &PathBuf, ignore: &Vec) -> bool { [INFO] [stdout] 150 + pub fn is_ignore_path(path: &Path, ignore: &Vec) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/project/run.rs:154:12 [INFO] [stdout] | [INFO] [stdout] 154 | if path_cp.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `path_cp.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/project/run.rs:163:8 [INFO] [stdout] | [INFO] [stdout] 163 | if last_path.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `last_path.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `starts_with` method [INFO] [stdout] --> src/command.rs:27:16 [INFO] [stdout] | [INFO] [stdout] 27 | if arg.chars().next().unwrap() == '-' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `arg.starts_with('-')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_next_cmp [INFO] [stdout] = note: `#[warn(clippy::chars_next_cmp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/command.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | if other.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!other.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/command.rs:53:12 [INFO] [stdout] | [INFO] [stdout] 53 | if self.options.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.options.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/command.rs:71:12 [INFO] [stdout] | [INFO] [stdout] 71 | if self.action.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.action.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/help.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | / "Example: qcpro [action] [subaction] [INFO] [stdout] 12 | | action: [INFO] [stdout] 13 | | new create new project name of subaction [INFO] [stdout] 14 | | init initialize project for directory that name of subaction [INFO] [stdout] ... | [INFO] [stdout] 22 | | -h,--help Print help to screen [INFO] [stdout] 23 | | -v, --version qcpro version"); [INFO] [stdout] | |___________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stdout] = note: `#[warn(clippy::print_literal)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 10 ~ println!("Example: qcpro [action] [subaction] [INFO] [stdout] 11 + action: [INFO] [stdout] 12 + new create new project name of subaction [INFO] [stdout] 13 + init initialize project for directory that name of subaction [INFO] [stdout] 14 + build use cmake to quickly build projcet [INFO] [stdout] 15 + run windows: use g++ to simply and quickly compile project [INFO] [stdout] 16 + shell: use cmake to build and use make to compile project [INFO] [stdout] 17 + subaction: [INFO] [stdout] 18 + the directory of project. If use action `init`, it can nothing and will initialize project on current directory [INFO] [stdout] 19 + If use `cmake`, it can run with two subactions one of source and other of build target.It can also be nothing and it will build with default path [INFO] [stdout] 20 + option: [INFO] [stdout] 21 + -h,--help Print help to screen [INFO] [stdout] 22 ~ -v, --version qcpro version\n"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/addition/string_addition.rs:4:19 [INFO] [stdout] | [INFO] [stdout] 4 | fn first_index(s: &String, pattern: &str) -> Option { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 4 - fn first_index(s: &String, pattern: &str) -> Option { [INFO] [stdout] 4 + fn first_index(s: &str, pattern: &str) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/addition/string_addition.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 47 - return None; [INFO] [stdout] 47 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/addition/string_addition.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | return Some(project_name); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 49 - return Some(project_name); [INFO] [stdout] 49 + Some(project_name) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/addition/string_addition.rs:19:16 [INFO] [stdout] | [INFO] [stdout] 19 | if s_cp.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s_cp.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/addition/string_addition.rs:32:23 [INFO] [stdout] | [INFO] [stdout] 32 | let fir = match first_index(&contents, pat) { [INFO] [stdout] | _______________________^ [INFO] [stdout] 33 | | Some(n) => n, [INFO] [stdout] 34 | | None => return None, [INFO] [stdout] 35 | | }; [INFO] [stdout] | |_____________^ help: try instead: `first_index(&contents, pat)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `idx` is only used to index `contents` [INFO] [stdout] --> src/addition/string_addition.rs:37:24 [INFO] [stdout] | [INFO] [stdout] 37 | for idx in fir + pat.len()..contents.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 37 - for idx in fir + pat.len()..contents.len() { [INFO] [stdout] 37 + for in contents.iter().skip(fir + pat.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/addition/string_addition.rs:46:8 [INFO] [stdout] | [INFO] [stdout] 46 | if project_name.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `project_name.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/command.rs:54:26 [INFO] [stdout] | [INFO] [stdout] 54 | let help_s = vec![String::from("--help"), String::from("-h")]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[String::from("--help"), String::from("-h")]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/command.rs:55:29 [INFO] [stdout] | [INFO] [stdout] 55 | let version_s = vec![String::from("--version"), String::from("-v")]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[String::from("--version"), String::from("-v")]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: panic message is not a string literal [INFO] [stdout] --> src/command.rs:131:16 [INFO] [stdout] | [INFO] [stdout] 131 | panic!(e); [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(non_fmt_panics)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: add a "{}" format string to `Display` the message [INFO] [stdout] | [INFO] [stdout] 131 | panic!("{}", e); [INFO] [stdout] | +++++ [INFO] [stdout] help: or use std::panic::panic_any instead [INFO] [stdout] | [INFO] [stdout] 131 - panic!(e); [INFO] [stdout] 131 + std::panic::panic_any(e); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/project/initialize.rs:12:33 [INFO] [stdout] | [INFO] [stdout] 12 | if directory.clone() == String::from(".") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `"."` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern reimplements `Option::unwrap_or` [INFO] [stdout] --> src/project/initialize.rs:13:26 [INFO] [stdout] | [INFO] [stdout] 13 | String::from(match env::current_dir()?.to_str() { [INFO] [stdout] | __________________________^ [INFO] [stdout] 14 | | Some(s) => s, [INFO] [stdout] 15 | | None => ".", [INFO] [stdout] 16 | | }) [INFO] [stdout] | |_____________^ help: replace with: `env::current_dir()?.to_str().unwrap_or(".")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/project/initialize.rs:26:16 [INFO] [stdout] | [INFO] [stdout] 26 | if last.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `last.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/project/build.rs:15:19 [INFO] [stdout] | [INFO] [stdout] 15 | .args(&["-S", &source_path, "-B", &build_path]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["-S", &source_path, "-B", &build_path]` [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 can be `std::io::Error::other(_)` [INFO] [stdout] --> src/project/build.rs:23:17 [INFO] [stdout] | [INFO] [stdout] 23 | Err(io::Error::new( [INFO] [stdout] | _________________^ [INFO] [stdout] 24 | | io::ErrorKind::Other, [INFO] [stdout] 25 | | "CMake build occured error!", [INFO] [stdout] 26 | | )) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] = note: `#[warn(clippy::io_other_error)]` on by default [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 23 ~ Err(io::Error::other( [INFO] [stdout] 24 ~ "CMake build occured error!", [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/project/build.rs:30:19 [INFO] [stdout] | [INFO] [stdout] 30 | .args(&["-S", &source_path, "-B", &build_path]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["-S", &source_path, "-B", &build_path]` [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] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/project/build.rs:39:17 [INFO] [stdout] | [INFO] [stdout] 39 | Err(io::Error::new( [INFO] [stdout] | _________________^ [INFO] [stdout] 40 | | io::ErrorKind::Other, [INFO] [stdout] 41 | | "CMake build occured error!", [INFO] [stdout] 42 | | )) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 39 ~ Err(io::Error::other( [INFO] [stdout] 40 ~ "CMake build occured error!", [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/project/build.rs:55:20 [INFO] [stdout] | [INFO] [stdout] 55 | return Err(io::Error::new( [INFO] [stdout] | ____________________^ [INFO] [stdout] 56 | | io::ErrorKind::Other, [INFO] [stdout] 57 | | "Compile occured error!", [INFO] [stdout] 58 | | )); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 55 ~ return Err(io::Error::other( [INFO] [stdout] 56 ~ "Compile occured error!", [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/project/run.rs:38:13 [INFO] [stdout] | [INFO] [stdout] 38 | Err(io::Error::new( [INFO] [stdout] | _____________^ [INFO] [stdout] 39 | | io::ErrorKind::Other, [INFO] [stdout] 40 | | format!("Run \'{}\' occured error!", project_name), [INFO] [stdout] 41 | | )) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 38 ~ Err(io::Error::other( [INFO] [stdout] 39 ~ format!("Run \'{}\' occured error!", project_name), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/project/run.rs:87:20 [INFO] [stdout] | [INFO] [stdout] 87 | if !(e.kind() == io::ErrorKind::AlreadyExists) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(e.kind() != io::ErrorKind::AlreadyExists)` [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: useless use of `format!` [INFO] [stdout] --> src/project/run.rs:58:34 [INFO] [stdout] | [INFO] [stdout] 58 | let src_path = PathBuf::from(format!("{}", current_dir)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `current_dir.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/project/run.rs:63:8 [INFO] [stdout] | [INFO] [stdout] 63 | if s.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/project/run.rs:82:12 [INFO] [stdout] | [INFO] [stdout] 82 | if build_args.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `build_args.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/project/run.rs:87:17 [INFO] [stdout] | [INFO] [stdout] 87 | / if !(e.kind() == io::ErrorKind::AlreadyExists) { [INFO] [stdout] 88 | | return Err(e); [INFO] [stdout] 89 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 86 ~ Err(e) [INFO] [stdout] 87 ~ if !(e.kind() == io::ErrorKind::AlreadyExists) => { [INFO] [stdout] 88 | return Err(e); [INFO] [stdout] 89 ~ } [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/project/run.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 85 | / match fs::create_dir("./bin") { [INFO] [stdout] 86 | | Err(e) => { [INFO] [stdout] 87 | | if !(e.kind() == io::ErrorKind::AlreadyExists) { [INFO] [stdout] 88 | | return Err(e); [INFO] [stdout] ... | [INFO] [stdout] 91 | | _ => {} [INFO] [stdout] 92 | | } [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] 85 ~ if let Err(e) = fs::create_dir("./bin") { [INFO] [stdout] 86 + if !(e.kind() == io::ErrorKind::AlreadyExists) { [INFO] [stdout] 87 + return Err(e); [INFO] [stdout] 88 + } [INFO] [stdout] 89 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/project/run.rs:106:28 [INFO] [stdout] | [INFO] [stdout] 106 | return Err(io::Error::new(io::ErrorKind::Other, "Run Error!")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 106 - return Err(io::Error::new(io::ErrorKind::Other, "Run Error!")); [INFO] [stdout] 106 + return Err(io::Error::other("Run Error!")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/project/run.rs:110:17 [INFO] [stdout] | [INFO] [stdout] 110 | Err(io::Error::new( [INFO] [stdout] | _________________^ [INFO] [stdout] 111 | | io::ErrorKind::Other, [INFO] [stdout] 112 | | "clang compile project occured error!", [INFO] [stdout] 113 | | )) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 110 ~ Err(io::Error::other( [INFO] [stdout] 111 ~ "clang compile project occured error!", [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/project/run.rs:121:23 [INFO] [stdout] | [INFO] [stdout] 121 | if is_ignore_path(&path, ignore) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [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: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/project/run.rs:128:5 [INFO] [stdout] | [INFO] [stdout] 128 | / for i in all_sub_path { [INFO] [stdout] 129 | | if let Ok(i_path) = i { [INFO] [stdout] 130 | | //If the path is directory, need to read the directory.Or add the path on s directly [INFO] [stdout] 131 | | match fs::read_dir(i_path.path()) { [INFO] [stdout] ... | [INFO] [stdout] 146 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/project/run.rs:129:9 [INFO] [stdout] | [INFO] [stdout] 129 | / if let Ok(i_path) = i { [INFO] [stdout] 130 | | //If the path is directory, need to read the directory.Or add the path on s directly [INFO] [stdout] 131 | | match fs::read_dir(i_path.path()) { [INFO] [stdout] 132 | | Ok(_sub_path) => { [INFO] [stdout] ... | [INFO] [stdout] 145 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 128 ~ for i_path in all_sub_path.into_iter().flatten() { [INFO] [stdout] 129 + //If the path is directory, need to read the directory.Or add the path on s directly [INFO] [stdout] 130 + match fs::read_dir(i_path.path()) { [INFO] [stdout] 131 + Ok(_sub_path) => { [INFO] [stdout] 132 + if let Ok(s_re) = read_path_file(&i_path.path(), ignore) { [INFO] [stdout] 133 + for i in s_re { [INFO] [stdout] 134 + s.push(i); [INFO] [stdout] 135 + } [INFO] [stdout] 136 + } [INFO] [stdout] 137 + } [INFO] [stdout] 138 + Err(_) => { [INFO] [stdout] 139 + if let Some(path) = i_path.path().to_str() { [INFO] [stdout] 140 + s.push(String::from(path)); [INFO] [stdout] 141 + } [INFO] [stdout] 142 + } [INFO] [stdout] 143 + } [INFO] [stdout] 144 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/project/run.rs:150:29 [INFO] [stdout] | [INFO] [stdout] 150 | pub fn is_ignore_path(path: &PathBuf, ignore: &Vec) -> bool { [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] 150 - pub fn is_ignore_path(path: &PathBuf, ignore: &Vec) -> bool { [INFO] [stdout] 150 + pub fn is_ignore_path(path: &Path, ignore: &Vec) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/project/run.rs:154:12 [INFO] [stdout] | [INFO] [stdout] 154 | if path_cp.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `path_cp.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/project/run.rs:163:8 [INFO] [stdout] | [INFO] [stdout] 163 | if last_path.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `last_path.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `starts_with` method [INFO] [stdout] --> src/command.rs:27:16 [INFO] [stdout] | [INFO] [stdout] 27 | if arg.chars().next().unwrap() == '-' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `arg.starts_with('-')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_next_cmp [INFO] [stdout] = note: `#[warn(clippy::chars_next_cmp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/command.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | if other.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!other.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/command.rs:53:12 [INFO] [stdout] | [INFO] [stdout] 53 | if self.options.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.options.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/command.rs:71:12 [INFO] [stdout] | [INFO] [stdout] 71 | if self.action.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.action.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/help.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | / "Example: qcpro [action] [subaction] [INFO] [stdout] 12 | | action: [INFO] [stdout] 13 | | new create new project name of subaction [INFO] [stdout] 14 | | init initialize project for directory that name of subaction [INFO] [stdout] ... | [INFO] [stdout] 22 | | -h,--help Print help to screen [INFO] [stdout] 23 | | -v, --version qcpro version"); [INFO] [stdout] | |___________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stdout] = note: `#[warn(clippy::print_literal)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 10 ~ println!("Example: qcpro [action] [subaction] [INFO] [stdout] 11 + action: [INFO] [stdout] 12 + new create new project name of subaction [INFO] [stdout] 13 + init initialize project for directory that name of subaction [INFO] [stdout] 14 + build use cmake to quickly build projcet [INFO] [stdout] 15 + run windows: use g++ to simply and quickly compile project [INFO] [stdout] 16 + shell: use cmake to build and use make to compile project [INFO] [stdout] 17 + subaction: [INFO] [stdout] 18 + the directory of project. If use action `init`, it can nothing and will initialize project on current directory [INFO] [stdout] 19 + If use `cmake`, it can run with two subactions one of source and other of build target.It can also be nothing and it will build with default path [INFO] [stdout] 20 + option: [INFO] [stdout] 21 + -h,--help Print help to screen [INFO] [stdout] 22 ~ -v, --version qcpro version\n"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/addition/string_addition.rs:4:19 [INFO] [stdout] | [INFO] [stdout] 4 | fn first_index(s: &String, pattern: &str) -> Option { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 4 - fn first_index(s: &String, pattern: &str) -> Option { [INFO] [stdout] 4 + fn first_index(s: &str, pattern: &str) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/addition/string_addition.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 47 - return None; [INFO] [stdout] 47 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/addition/string_addition.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | return Some(project_name); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 49 - return Some(project_name); [INFO] [stdout] 49 + Some(project_name) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/addition/string_addition.rs:19:16 [INFO] [stdout] | [INFO] [stdout] 19 | if s_cp.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s_cp.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/addition/string_addition.rs:32:23 [INFO] [stdout] | [INFO] [stdout] 32 | let fir = match first_index(&contents, pat) { [INFO] [stdout] | _______________________^ [INFO] [stdout] 33 | | Some(n) => n, [INFO] [stdout] 34 | | None => return None, [INFO] [stdout] 35 | | }; [INFO] [stdout] | |_____________^ help: try instead: `first_index(&contents, pat)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `idx` is only used to index `contents` [INFO] [stdout] --> src/addition/string_addition.rs:37:24 [INFO] [stdout] | [INFO] [stdout] 37 | for idx in fir + pat.len()..contents.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 37 - for idx in fir + pat.len()..contents.len() { [INFO] [stdout] 37 + for in contents.iter().skip(fir + pat.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/addition/string_addition.rs:46:8 [INFO] [stdout] | [INFO] [stdout] 46 | if project_name.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `project_name.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/command.rs:54:26 [INFO] [stdout] | [INFO] [stdout] 54 | let help_s = vec![String::from("--help"), String::from("-h")]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[String::from("--help"), String::from("-h")]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/command.rs:55:29 [INFO] [stdout] | [INFO] [stdout] 55 | let version_s = vec![String::from("--version"), String::from("-v")]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[String::from("--version"), String::from("-v")]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: panic message is not a string literal [INFO] [stdout] --> src/command.rs:131:16 [INFO] [stdout] | [INFO] [stdout] 131 | panic!(e); [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021 [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(non_fmt_panics)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: add a "{}" format string to `Display` the message [INFO] [stdout] | [INFO] [stdout] 131 | panic!("{}", e); [INFO] [stdout] | +++++ [INFO] [stdout] help: or use std::panic::panic_any instead [INFO] [stdout] | [INFO] [stdout] 131 - panic!(e); [INFO] [stdout] 131 + std::panic::panic_any(e); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.46s [INFO] running `Command { std: "docker" "inspect" "00fc9994b70d8b86d13ccdc9e35b1e57a7afee9138d5f7139aa6d951ba80a1cc", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "00fc9994b70d8b86d13ccdc9e35b1e57a7afee9138d5f7139aa6d951ba80a1cc", kill_on_drop: false }` [INFO] [stdout] 00fc9994b70d8b86d13ccdc9e35b1e57a7afee9138d5f7139aa6d951ba80a1cc