[INFO] cloning repository https://github.com/patjak/b2tf-rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/patjak/b2tf-rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpatjak%2Fb2tf-rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpatjak%2Fb2tf-rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 24554dec5572b691e3c129beaf49941e1901708f [INFO] linting patjak/b2tf-rust against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpatjak%2Fb2tf-rust" "/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/patjak/b2tf-rust [INFO] finished tweaking git repo https://github.com/patjak/b2tf-rust [INFO] tweaked toml for git repo https://github.com/patjak/b2tf-rust written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/patjak/b2tf-rust 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/patjak/b2tf-rust 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] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded anstyle v1.0.6 [INFO] [stderr] Downloaded unidiff v0.3.3 [INFO] [stderr] Downloaded clap_lex v0.7.0 [INFO] [stderr] Downloaded strsim v0.11.0 [INFO] [stderr] Downloaded anstyle-parse v0.2.3 [INFO] [stderr] Downloaded anstream v0.6.13 [INFO] [stderr] Downloaded clap_derive v4.5.3 [INFO] [stderr] Downloaded clap v4.5.3 [INFO] [stderr] Downloaded clap_builder v4.5.2 [INFO] [stderr] Downloaded anstyle-query v1.0.2 [INFO] [stderr] Downloaded anstyle-wincon v3.0.2 [INFO] [stderr] Downloaded uuid v1.4.1 [INFO] [stderr] Downloaded mktemp v0.5.1 [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] 499bea7956c913845ac2f05b5044c28a3ee9bd014eff178a04f9d4202e693fa4 [INFO] running `Command { std: "docker" "start" "-a" "499bea7956c913845ac2f05b5044c28a3ee9bd014eff178a04f9d4202e693fa4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "499bea7956c913845ac2f05b5044c28a3ee9bd014eff178a04f9d4202e693fa4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "499bea7956c913845ac2f05b5044c28a3ee9bd014eff178a04f9d4202e693fa4", kill_on_drop: false }` [INFO] [stdout] 499bea7956c913845ac2f05b5044c28a3ee9bd014eff178a04f9d4202e693fa4 [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] ebf673d89f0058220534fcf889e01c6c5583ad0d6a3b1df2de820c9b1d83f085 [INFO] running `Command { std: "docker" "start" "-a" "ebf673d89f0058220534fcf889e01c6c5583ad0d6a3b1df2de820c9b1d83f085", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.172 [INFO] [stderr] Checking utf8parse v0.2.1 [INFO] [stderr] Checking anstyle v1.0.6 [INFO] [stderr] Checking anstyle-query v1.0.2 [INFO] [stderr] Checking colorchoice v1.0.0 [INFO] [stderr] Checking clap_lex v0.7.0 [INFO] [stderr] Compiling heck v0.5.0 [INFO] [stderr] Checking strsim v0.11.0 [INFO] [stderr] Checking colored v3.0.0 [INFO] [stderr] Compiling proc-macro2 v1.0.95 [INFO] [stderr] Checking encoding_rs v0.8.35 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking anstyle-parse v0.2.3 [INFO] [stderr] Checking anstream v0.6.13 [INFO] [stderr] Checking clap_builder v4.5.2 [INFO] [stderr] Compiling quote v1.0.35 [INFO] [stderr] Compiling syn v2.0.101 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Checking uuid v1.4.1 [INFO] [stderr] Checking mktemp v0.5.1 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking unidiff v0.3.3 [INFO] [stderr] Compiling clap_derive v4.5.3 [INFO] [stderr] Checking clap v4.5.3 [INFO] [stderr] Checking b2tf v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused variable: `log` [INFO] [stdout] --> src/commands.rs:192:39 [INFO] [stdout] | [INFO] [stdout] 192 | pub fn cmd_compare(options: &Options, log: &mut Log) -> Result<(), Box> { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_log` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `status` [INFO] [stdout] --> src/commands.rs:448:25 [INFO] [stdout] | [INFO] [stdout] 448 | let status = Command::new("sh") [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_status` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `log` [INFO] [stdout] --> src/commands.rs:192:39 [INFO] [stdout] | [INFO] [stdout] 192 | pub fn cmd_compare(options: &Options, log: &mut Log) -> Result<(), Box> { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_log` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `status` [INFO] [stdout] --> src/commands.rs:448:25 [INFO] [stdout] | [INFO] [stdout] 448 | let status = Command::new("sh") [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_status` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/log.rs:112:13 [INFO] [stdout] | [INFO] [stdout] 112 | / if !cols.is_empty() { [INFO] [stdout] 113 | | if cols[0].len() == 40 { [INFO] [stdout] 114 | | let hash_upstream = cols[0]; [INFO] [stdout] 115 | | let mut hash_backport = "".to_string(); [INFO] [stdout] ... | [INFO] [stdout] 124 | | } [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] 112 ~ if !cols.is_empty() [INFO] [stdout] 113 ~ && cols[0].len() == 40 { [INFO] [stdout] 114 | let hash_upstream = cols[0]; [INFO] [stdout] ... [INFO] [stdout] 122 | list.push((hash_upstream.to_string(), hash_backport.to_string())); [INFO] [stdout] 123 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.range_start` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:27:59 [INFO] [stdout] | [INFO] [stdout] 26 | if options.range_start.is_some() { [INFO] [stdout] | -------------------------------- help: try: `if let Some() = options.range_start` [INFO] [stdout] 27 | log.config.push_str(format!("range-start: {}\n", &options.range_start.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.range_stop` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:32:58 [INFO] [stdout] | [INFO] [stdout] 31 | if options.range_stop.is_some() { [INFO] [stdout] | ------------------------------- help: try: `if let Some() = options.range_stop` [INFO] [stdout] 32 | log.config.push_str(format!("range-stop: {}\n", &options.range_stop.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.branch` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:37:54 [INFO] [stdout] | [INFO] [stdout] 36 | if options.branch.is_some() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = options.branch` [INFO] [stdout] 37 | log.config.push_str(format!("branch: {}\n", &options.branch.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.branch_point` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:42:60 [INFO] [stdout] | [INFO] [stdout] 41 | if options.branch_point.is_some() { [INFO] [stdout] | --------------------------------- help: try: `if let Some() = options.branch_point` [INFO] [stdout] 42 | log.config.push_str(format!("branch-point: {}\n", &options.branch_point.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.work_dir` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:45:56 [INFO] [stdout] | [INFO] [stdout] 44 | if options.work_dir.is_some() { [INFO] [stdout] | ----------------------------- help: try: `if let Some() = options.work_dir` [INFO] [stdout] 45 | log.config.push_str(format!("work-dir: {}\n", &options.work_dir.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.git_dir` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:48:55 [INFO] [stdout] | [INFO] [stdout] 47 | if options.git_dir.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = options.git_dir` [INFO] [stdout] 48 | log.config.push_str(format!("git-dir: {}\n", &options.git_dir.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.paths` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:53:53 [INFO] [stdout] | [INFO] [stdout] 52 | if options.paths.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = options.paths` [INFO] [stdout] 53 | log.config.push_str(format!("paths: {}\n", &options.paths.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.signature` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:56:57 [INFO] [stdout] | [INFO] [stdout] 55 | if options.signature.is_some() { [INFO] [stdout] | ------------------------------ help: try: `if let Some() = options.signature` [INFO] [stdout] 56 | log.config.push_str(format!("signature: {}\n", &options.signature.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.references` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:59:58 [INFO] [stdout] | [INFO] [stdout] 58 | if options.references.is_some() { [INFO] [stdout] | ------------------------------- help: try: `if let Some() = options.references` [INFO] [stdout] 59 | log.config.push_str(format!("references: {}\n", &options.references.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands.rs:231:31 [INFO] [stdout] | [INFO] [stdout] 231 | if handle_empty_state(&options, log)? { [INFO] [stdout] | ^^^^^^^^ help: change this to: `options` [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 `if` statement can be collapsed [INFO] [stdout] --> src/commands.rs:240:13 [INFO] [stdout] | [INFO] [stdout] 240 | / if !handled { [INFO] [stdout] 241 | | if handle_empty_state(&options, log)? { [INFO] [stdout] 242 | | return Ok(true); [INFO] [stdout] 243 | | } [INFO] [stdout] 244 | | } [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] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 240 ~ if !handled [INFO] [stdout] 241 ~ && handle_empty_state(&options, log)? { [INFO] [stdout] 242 | return Ok(true); [INFO] [stdout] 243 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands.rs:241:39 [INFO] [stdout] | [INFO] [stdout] 241 | if handle_empty_state(&options, log)? { [INFO] [stdout] | ^^^^^^^^ help: change this to: `options` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/commands.rs:475:13 [INFO] [stdout] | [INFO] [stdout] 475 | / match Git::cmd(format!("show {}:{} > {}", range_stop, file, target_file), &git_dir) { [INFO] [stdout] 476 | | Err(_error) => println!("{} {} {} {}", "Target file", file.red(), "doesn't exist at revision", range_stop.red()), [INFO] [stdout] 477 | | _ => (), [INFO] [stdout] 478 | | } [INFO] [stdout] | |_____________^ help: try: `if let Err(_error) = Git::cmd(format!("show {}:{} > {}", range_stop, file, target_file), &git_dir) { println!("{} {} {} {}", "Target file", file.red(), "doesn't exist at revision", range_stop.red()) }` [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] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/commands.rs:476:56 [INFO] [stdout] | [INFO] [stdout] 476 | Err(_error) => println!("{} {} {} {}", "Target file", file.red(), "doesn't exist at revision", range_stop.red()), [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] 476 - Err(_error) => println!("{} {} {} {}", "Target file", file.red(), "doesn't exist at revision", range_stop.red()), [INFO] [stdout] 476 + Err(_error) => println!("Target file {} doesn't exist at revision {}", file.red(), range_stop.red()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/log.rs:112:13 [INFO] [stdout] | [INFO] [stdout] 112 | / if !cols.is_empty() { [INFO] [stdout] 113 | | if cols[0].len() == 40 { [INFO] [stdout] 114 | | let hash_upstream = cols[0]; [INFO] [stdout] 115 | | let mut hash_backport = "".to_string(); [INFO] [stdout] ... | [INFO] [stdout] 124 | | } [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] 112 ~ if !cols.is_empty() [INFO] [stdout] 113 ~ && cols[0].len() == 40 { [INFO] [stdout] 114 | let hash_upstream = cols[0]; [INFO] [stdout] ... [INFO] [stdout] 122 | list.push((hash_upstream.to_string(), hash_backport.to_string())); [INFO] [stdout] 123 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands.rs:620:31 [INFO] [stdout] | [INFO] [stdout] 620 | print_patched_file_header(&file); [INFO] [stdout] | ^^^^^ help: change this to: `file` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/commands.rs:653:5 [INFO] [stdout] | [INFO] [stdout] 653 | / match &options.skip { [INFO] [stdout] 654 | | Some(arg) => skip = arg.to_string(), [INFO] [stdout] 655 | | None => (), [INFO] [stdout] 656 | | }; [INFO] [stdout] | |_____^ help: try: `if let Some(arg) = &options.skip { skip = arg.to_string() }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/commands.rs:718:23 [INFO] [stdout] | [INFO] [stdout] 718 | } else if hash.1.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!hash.1.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: function call inside of `expect` [INFO] [stdout] --> src/commands.rs:736:14 [INFO] [stdout] | [INFO] [stdout] 736 | .expect(format!("Failed to execute: {}\n", &query).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to execute: {}\n", &query))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.range_start` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:27:59 [INFO] [stdout] | [INFO] [stdout] 26 | if options.range_start.is_some() { [INFO] [stdout] | -------------------------------- help: try: `if let Some() = options.range_start` [INFO] [stdout] 27 | log.config.push_str(format!("range-start: {}\n", &options.range_start.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` 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/commands.rs:757:16 [INFO] [stdout] | [INFO] [stdout] 757 | cmd_update(&options, log)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `options` [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: called `unwrap` on `options.range_stop` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:32:58 [INFO] [stdout] | [INFO] [stdout] 31 | if options.range_stop.is_some() { [INFO] [stdout] | ------------------------------- help: try: `if let Some() = options.range_stop` [INFO] [stdout] 32 | log.config.push_str(format!("range-stop: {}\n", &options.range_stop.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.branch` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:37:54 [INFO] [stdout] | [INFO] [stdout] 36 | if options.branch.is_some() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = options.branch` [INFO] [stdout] 37 | log.config.push_str(format!("branch: {}\n", &options.branch.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.branch_point` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:42:60 [INFO] [stdout] | [INFO] [stdout] 41 | if options.branch_point.is_some() { [INFO] [stdout] | --------------------------------- help: try: `if let Some() = options.branch_point` [INFO] [stdout] 42 | log.config.push_str(format!("branch-point: {}\n", &options.branch_point.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.work_dir` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:45:56 [INFO] [stdout] | [INFO] [stdout] 44 | if options.work_dir.is_some() { [INFO] [stdout] | ----------------------------- help: try: `if let Some() = options.work_dir` [INFO] [stdout] 45 | log.config.push_str(format!("work-dir: {}\n", &options.work_dir.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.git_dir` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:48:55 [INFO] [stdout] | [INFO] [stdout] 47 | if options.git_dir.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = options.git_dir` [INFO] [stdout] 48 | log.config.push_str(format!("git-dir: {}\n", &options.git_dir.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.paths` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:53:53 [INFO] [stdout] | [INFO] [stdout] 52 | if options.paths.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = options.paths` [INFO] [stdout] 53 | log.config.push_str(format!("paths: {}\n", &options.paths.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.signature` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:56:57 [INFO] [stdout] | [INFO] [stdout] 55 | if options.signature.is_some() { [INFO] [stdout] | ------------------------------ help: try: `if let Some() = options.signature` [INFO] [stdout] 56 | log.config.push_str(format!("signature: {}\n", &options.signature.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `options.references` after checking its variant with `is_some` [INFO] [stdout] --> src/commands.rs:59:58 [INFO] [stdout] | [INFO] [stdout] 58 | if options.references.is_some() { [INFO] [stdout] | ------------------------------- help: try: `if let Some() = options.references` [INFO] [stdout] 59 | log.config.push_str(format!("references: {}\n", &options.references.unwrap()).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `commits` [INFO] [stdout] --> src/commands.rs:774:14 [INFO] [stdout] | [INFO] [stdout] 774 | for i in 0..commits.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] 774 - for i in 0..commits.len() { [INFO] [stdout] 774 + for in &commits { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands.rs:801:42 [INFO] [stdout] | [INFO] [stdout] 801 | log.commit_update(&hash_log, &hash_git)?; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `hash_git` [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 loop variable `i` is only used to index `commits` [INFO] [stdout] --> src/commands.rs:824:14 [INFO] [stdout] | [INFO] [stdout] 824 | for i in 0..commits.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] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 824 - for i in 0..commits.len() { [INFO] [stdout] 824 + for in &commits { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands.rs:851:42 [INFO] [stdout] | [INFO] [stdout] 851 | log.commit_update(&hash_log, &hash_git)?; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `hash_git` [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: unneeded late initialization [INFO] [stdout] --> src/commands.rs:861:5 [INFO] [stdout] | [INFO] [stdout] 861 | let hash_arg; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `hash_arg` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 861 ~ [INFO] [stdout] 862 | [INFO] [stdout] 863 ~ let hash_arg = match &options.hash { [INFO] [stdout] 864 ~ Some(arg) => arg, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/commands.rs:891:5 [INFO] [stdout] | [INFO] [stdout] 891 | let hash_arg; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `hash_arg` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 891 ~ [INFO] [stdout] 892 | [INFO] [stdout] 893 ~ let hash_arg = match &options.hash { [INFO] [stdout] 894 ~ Some(arg) => arg, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/commands.rs:921:5 [INFO] [stdout] | [INFO] [stdout] 921 | let hash_arg; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `hash_arg` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 921 ~ [INFO] [stdout] 922 | let mut after = String::new(); [INFO] [stdout] 923 | [INFO] [stdout] 924 ~ let hash_arg = match &options.hash { [INFO] [stdout] 925 ~ Some(arg) => arg, [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/commands.rs:929:5 [INFO] [stdout] | [INFO] [stdout] 929 | / match &options.after { [INFO] [stdout] 930 | | Some(arg) => after = arg.to_string(), [INFO] [stdout] 931 | | None => (), [INFO] [stdout] 932 | | }; [INFO] [stdout] | |_____^ help: try: `if let Some(arg) = &options.after { after = arg.to_string() }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands.rs:958:34 [INFO] [stdout] | [INFO] [stdout] 958 | commits.push_str(&line); [INFO] [stdout] | ^^^^^ help: change this to: `line` [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/commands.rs:963:26 [INFO] [stdout] | [INFO] [stdout] 963 | commits.push_str(&line); [INFO] [stdout] | ^^^^^ help: change this to: `line` [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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/commands.rs:964:9 [INFO] [stdout] | [INFO] [stdout] 964 | commits.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `commits.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` 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/commands.rs:231:31 [INFO] [stdout] | [INFO] [stdout] 231 | if handle_empty_state(&options, log)? { [INFO] [stdout] | ^^^^^^^^ help: change this to: `options` [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 `if` statement can be collapsed [INFO] [stdout] --> src/commands.rs:240:13 [INFO] [stdout] | [INFO] [stdout] 240 | / if !handled { [INFO] [stdout] 241 | | if handle_empty_state(&options, log)? { [INFO] [stdout] 242 | | return Ok(true); [INFO] [stdout] 243 | | } [INFO] [stdout] 244 | | } [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] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 240 ~ if !handled [INFO] [stdout] 241 ~ && handle_empty_state(&options, log)? { [INFO] [stdout] 242 | return Ok(true); [INFO] [stdout] 243 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/git.rs:38:14 [INFO] [stdout] | [INFO] [stdout] 38 | .expect(format!("Failed to execute: {}\n", &query).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to execute: {}\n", &query))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands.rs:241:39 [INFO] [stdout] | [INFO] [stdout] 241 | if handle_empty_state(&options, log)? { [INFO] [stdout] | ^^^^^^^^ help: change this to: `options` [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: function call inside of `expect` [INFO] [stdout] --> src/git.rs:60:14 [INFO] [stdout] | [INFO] [stdout] 60 | .expect(format!("Failed to execute: {}\n", &query).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to execute: {}\n", &query))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [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/commands.rs:475:13 [INFO] [stdout] | [INFO] [stdout] 475 | / match Git::cmd(format!("show {}:{} > {}", range_stop, file, target_file), &git_dir) { [INFO] [stdout] 476 | | Err(_error) => println!("{} {} {} {}", "Target file", file.red(), "doesn't exist at revision", range_stop.red()), [INFO] [stdout] 477 | | _ => (), [INFO] [stdout] 478 | | } [INFO] [stdout] | |_____________^ help: try: `if let Err(_error) = Git::cmd(format!("show {}:{} > {}", range_stop, file, target_file), &git_dir) { println!("{} {} {} {}", "Target file", file.red(), "doesn't exist at revision", range_stop.red()) }` [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] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/commands.rs:476:56 [INFO] [stdout] | [INFO] [stdout] 476 | Err(_error) => println!("{} {} {} {}", "Target file", file.red(), "doesn't exist at revision", range_stop.red()), [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] 476 - Err(_error) => println!("{} {} {} {}", "Target file", file.red(), "doesn't exist at revision", range_stop.red()), [INFO] [stdout] 476 + Err(_error) => println!("Target file {} doesn't exist at revision {}", file.red(), range_stop.red()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/suse.rs:126:12 [INFO] [stdout] | [INFO] [stdout] 126 | if cols.len() > 0 && cols[0] == hash { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cols.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/suse.rs:173:48 [INFO] [stdout] | [INFO] [stdout] 173 | fn compare_commits(list1: &Vec, list2: &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] 173 - fn compare_commits(list1: &Vec, list2: &Vec) -> bool { [INFO] [stdout] 173 + fn compare_commits(list1: &Vec, list2: &[String]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands.rs:620:31 [INFO] [stdout] | [INFO] [stdout] 620 | print_patched_file_header(&file); [INFO] [stdout] | ^^^^^ help: change this to: `file` [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/suse.rs:318:39 [INFO] [stdout] | [INFO] [stdout] 318 | fn strip_number_prefix(old_file_name: &String, commit: &String) -> Result> { [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] 318 ~ fn strip_number_prefix(old_file_name: &str, commit: &String) -> Result> { [INFO] [stdout] 319 ~ let file_name = old_file_name.to_owned(); [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/commands.rs:653:5 [INFO] [stdout] | [INFO] [stdout] 653 | / match &options.skip { [INFO] [stdout] 654 | | Some(arg) => skip = arg.to_string(), [INFO] [stdout] 655 | | None => (), [INFO] [stdout] 656 | | }; [INFO] [stdout] | |_____^ help: try: `if let Some(arg) = &options.skip { skip = arg.to_string() }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/suse.rs:325:29 [INFO] [stdout] | [INFO] [stdout] 325 | let mut new_file_name = format!("{}", file_name); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `file_name.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 zero [INFO] [stdout] --> src/commands.rs:718:23 [INFO] [stdout] | [INFO] [stdout] 718 | } else if hash.1.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!hash.1.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: function call inside of `expect` [INFO] [stdout] --> src/commands.rs:736:14 [INFO] [stdout] | [INFO] [stdout] 736 | .expect(format!("Failed to execute: {}\n", &query).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to execute: {}\n", &query))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` 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/suse.rs:447:53 [INFO] [stdout] | [INFO] [stdout] 447 | if !compare_commits(&failed_hashes, &p) { [INFO] [stdout] | ^^ help: change this to: `p` [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/commands.rs:757:16 [INFO] [stdout] | [INFO] [stdout] 757 | cmd_update(&options, log)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `options` [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 loop variable `i` is only used to index `commits` [INFO] [stdout] --> src/commands.rs:774:14 [INFO] [stdout] | [INFO] [stdout] 774 | for i in 0..commits.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] 774 - for i in 0..commits.len() { [INFO] [stdout] 774 + for in &commits { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands.rs:801:42 [INFO] [stdout] | [INFO] [stdout] 801 | log.commit_update(&hash_log, &hash_git)?; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `hash_git` [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 loop variable `i` is only used to index `commits` [INFO] [stdout] --> src/commands.rs:824:14 [INFO] [stdout] | [INFO] [stdout] 824 | for i in 0..commits.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] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 824 - for i in 0..commits.len() { [INFO] [stdout] 824 + for in &commits { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/suse.rs:539:8 [INFO] [stdout] | [INFO] [stdout] 539 | if subject.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `subject.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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands.rs:851:42 [INFO] [stdout] | [INFO] [stdout] 851 | log.commit_update(&hash_log, &hash_git)?; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `hash_git` [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: unneeded late initialization [INFO] [stdout] --> src/commands.rs:861:5 [INFO] [stdout] | [INFO] [stdout] 861 | let hash_arg; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `hash_arg` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 861 ~ [INFO] [stdout] 862 | [INFO] [stdout] 863 ~ let hash_arg = match &options.hash { [INFO] [stdout] 864 ~ Some(arg) => arg, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/suse.rs:582:8 [INFO] [stdout] | [INFO] [stdout] 582 | if session.unmerged_paths.len() == 0 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `session.unmerged_paths.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: unneeded late initialization [INFO] [stdout] --> src/commands.rs:891:5 [INFO] [stdout] | [INFO] [stdout] 891 | let hash_arg; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `hash_arg` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 891 ~ [INFO] [stdout] 892 | [INFO] [stdout] 893 ~ let hash_arg = match &options.hash { [INFO] [stdout] 894 ~ Some(arg) => arg, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/suse.rs:584:8 [INFO] [stdout] | [INFO] [stdout] 584 | session.modified_paths.len() == 0 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `session.modified_paths.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 `format!` [INFO] [stdout] --> src/suse.rs:604:29 [INFO] [stdout] | [INFO] [stdout] 604 | output.push_str(format!("{}", actions[0]).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `actions[0].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] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/commands.rs:921:5 [INFO] [stdout] | [INFO] [stdout] 921 | let hash_arg; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `hash_arg` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 921 ~ [INFO] [stdout] 922 | let mut after = String::new(); [INFO] [stdout] 923 | [INFO] [stdout] 924 ~ let hash_arg = match &options.hash { [INFO] [stdout] 925 ~ Some(arg) => arg, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/suse.rs:612:14 [INFO] [stdout] | [INFO] [stdout] 612 | Git::cmd(format!("commit -a --no-verify -F /tmp/b2tf-commit-msg"), &kernel_source)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"commit -a --no-verify -F /tmp/b2tf-commit-msg".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] [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/commands.rs:929:5 [INFO] [stdout] | [INFO] [stdout] 929 | / match &options.after { [INFO] [stdout] 930 | | Some(arg) => after = arg.to_string(), [INFO] [stdout] 931 | | None => (), [INFO] [stdout] 932 | | }; [INFO] [stdout] | |_____^ help: try: `if let Some(arg) = &options.after { after = arg.to_string() }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/suse.rs:630:50 [INFO] [stdout] | [INFO] [stdout] 630 | if cols.len() >= 2 && cols[1] == path && cols[0].chars().nth(0).unwrap() == '+' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `cols[0].chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` 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/commands.rs:958:34 [INFO] [stdout] | [INFO] [stdout] 958 | commits.push_str(&line); [INFO] [stdout] | ^^^^^ help: change this to: `line` [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/commands.rs:963:26 [INFO] [stdout] | [INFO] [stdout] 963 | commits.push_str(&line); [INFO] [stdout] | ^^^^^ help: change this to: `line` [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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/commands.rs:964:9 [INFO] [stdout] | [INFO] [stdout] 964 | commits.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `commits.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/suse.rs:654:14 [INFO] [stdout] | [INFO] [stdout] 654 | for g in &*processed_commits { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] = note: `#[warn(clippy::borrow_deref_ref)]` on by default [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 654 - for g in &*processed_commits { [INFO] [stdout] 654 + for g in processed_commits { [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 654 | for g in &**processed_commits { [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/suse.rs:655:37 [INFO] [stdout] | [INFO] [stdout] 655 | if compare_commits(&hashes, &g) { [INFO] [stdout] | ^^ help: change this to: `g` [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: function call inside of `expect` [INFO] [stdout] --> src/git.rs:38:14 [INFO] [stdout] | [INFO] [stdout] 38 | .expect(format!("Failed to execute: {}\n", &query).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to execute: {}\n", &query))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/suse.rs:699:8 [INFO] [stdout] | [INFO] [stdout] 699 | if !check_guard(file_name, &kernel_source)?.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `check_guard(file_name, &kernel_source)?.is_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: function call inside of `expect` [INFO] [stdout] --> src/git.rs:60:14 [INFO] [stdout] | [INFO] [stdout] 60 | .expect(format!("Failed to execute: {}\n", &query).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to execute: {}\n", &query))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/suse.rs:735:30 [INFO] [stdout] | [INFO] [stdout] 735 | let refs = get_suse_tags(&suse_path, &kernel_source, "References")?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `suse_path` [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/suse.rs:735:42 [INFO] [stdout] | [INFO] [stdout] 735 | let refs = get_suse_tags(&suse_path, &kernel_source, "References")?; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `kernel_source` [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: length comparison to one [INFO] [stdout] --> src/suse.rs:736:8 [INFO] [stdout] | [INFO] [stdout] 736 | if refs.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `refs.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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/suse.rs:764:35 [INFO] [stdout] | [INFO] [stdout] 764 | print!("{}", get_ref_link(&r).yellow()); [INFO] [stdout] | ^^ help: change this to: `r` [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 variable `i` is used as a loop counter [INFO] [stdout] --> src/suse.rs:859:5 [INFO] [stdout] | [INFO] [stdout] 859 | for path in &paths { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using: `for (i, path) in (1..).zip(paths.iter())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` 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/suse.rs:885:39 [INFO] [stdout] | [INFO] [stdout] 885 | remove_guard(options, &guard_file_name)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `guard_file_name` [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/suse.rs:901:30 [INFO] [stdout] | [INFO] [stdout] 901 | suse_log(&options, &suse_path.0)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `options` [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: length comparison to zero [INFO] [stdout] --> src/suse.rs:126:12 [INFO] [stdout] | [INFO] [stdout] 126 | if cols.len() > 0 && cols[0] == hash { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cols.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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/suse.rs:918:26 [INFO] [stdout] | [INFO] [stdout] 918 | suse_log(&options, &suse_path.0)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `options` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/suse.rs:173:48 [INFO] [stdout] | [INFO] [stdout] 173 | fn compare_commits(list1: &Vec, list2: &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] 173 - fn compare_commits(list1: &Vec, list2: &Vec) -> bool { [INFO] [stdout] 173 + fn compare_commits(list1: &Vec, list2: &[String]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/suse.rs:935:18 [INFO] [stdout] | [INFO] [stdout] 935 | suse_log(&options, "")?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `options` [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/suse.rs:318:39 [INFO] [stdout] | [INFO] [stdout] 318 | fn strip_number_prefix(old_file_name: &String, commit: &String) -> Result> { [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] 318 ~ fn strip_number_prefix(old_file_name: &str, commit: &String) -> Result> { [INFO] [stdout] 319 ~ let file_name = old_file_name.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/suse.rs:325:29 [INFO] [stdout] | [INFO] [stdout] 325 | let mut new_file_name = format!("{}", file_name); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `file_name.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: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/patch.rs:121:18 [INFO] [stdout] | [INFO] [stdout] 121 | let h1 = String::from(self.section_header.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `self.section_header.clone()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/patch.rs:122:18 [INFO] [stdout] | [INFO] [stdout] 122 | let h2 = String::from(hunk.section_header.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `hunk.section_header.clone()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/patch.rs:138:9 [INFO] [stdout] | [INFO] [stdout] 138 | / if !fuzz { [INFO] [stdout] 139 | | if self.source_start != hunk.source_start || [INFO] [stdout] 140 | | self.source_length != hunk.source_length || [INFO] [stdout] 141 | | self.target_start != hunk.target_start || [INFO] [stdout] ... | [INFO] [stdout] 145 | | } [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] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 138 ~ if !fuzz [INFO] [stdout] 139 ~ && (self.source_start != hunk.source_start || [INFO] [stdout] 140 | self.source_length != hunk.source_length || [INFO] [stdout] 141 | self.target_start != hunk.target_start || [INFO] [stdout] 142 ~ self.target_length != hunk.target_length) { [INFO] [stdout] 143 | return false; [INFO] [stdout] 144 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/suse.rs:447:53 [INFO] [stdout] | [INFO] [stdout] 447 | if !compare_commits(&failed_hashes, &p) { [INFO] [stdout] | ^^ help: change this to: `p` [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: you should consider adding a `Default` implementation for `Options` [INFO] [stdout] --> src/main.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | / pub fn new() -> Options { [INFO] [stdout] 43 | | Options { [INFO] [stdout] 44 | | range_start: None, [INFO] [stdout] 45 | | range_stop: None, [INFO] [stdout] ... | [INFO] [stdout] 62 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 41 + impl Default for Options { [INFO] [stdout] 42 + fn default() -> Self { [INFO] [stdout] 43 + Self::new() [INFO] [stdout] 44 + } [INFO] [stdout] 45 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `prepend_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:75:24 [INFO] [stdout] | [INFO] [stdout] 74 | if prepend_matches.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = prepend_matches` [INFO] [stdout] 75 | let hash = prepend_matches.unwrap().get_one::("hashes to prepend").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `append_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:81:24 [INFO] [stdout] | [INFO] [stdout] 80 | if append_matches.is_some() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = append_matches` [INFO] [stdout] 81 | let hash = append_matches.unwrap().get_one::("hashes to append").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `insert_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:87:24 [INFO] [stdout] | [INFO] [stdout] 86 | if insert_matches.is_some() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = insert_matches` [INFO] [stdout] 87 | let hash = insert_matches.unwrap().get_one::("hashes to append").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `insert_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:90:25 [INFO] [stdout] | [INFO] [stdout] 86 | if insert_matches.is_some() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = insert_matches` [INFO] [stdout] ... [INFO] [stdout] 90 | let after = insert_matches.unwrap().get_one::("insert after this hash").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `diffdiff_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:96:24 [INFO] [stdout] | [INFO] [stdout] 95 | if diffdiff_matches.is_some() { [INFO] [stdout] | ----------------------------- help: try: `if let Some() = diffdiff_matches` [INFO] [stdout] 96 | let skip = diffdiff_matches.unwrap().get_one::("comma separated list of commits to skip").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `compare_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:102:26 [INFO] [stdout] | [INFO] [stdout] 101 | if compare_matches.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = compare_matches` [INFO] [stdout] 102 | let patch1 = compare_matches.unwrap().get_one::("patch 1").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `compare_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:103:26 [INFO] [stdout] | [INFO] [stdout] 101 | if compare_matches.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = compare_matches` [INFO] [stdout] 102 | let patch1 = compare_matches.unwrap().get_one::("patch 1").cloned(); [INFO] [stdout] 103 | let patch2 = compare_matches.unwrap().get_one::("patch 2").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `suse_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:111:33 [INFO] [stdout] | [INFO] [stdout] 110 | if suse_matches.is_some() { [INFO] [stdout] | ------------------------- help: try: `if let Some() = suse_matches` [INFO] [stdout] 111 | let apply_matches = suse_matches.unwrap().subcommand_matches("apply"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `apply_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:113:35 [INFO] [stdout] | [INFO] [stdout] 112 | if apply_matches.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = apply_matches` [INFO] [stdout] 113 | let range_guard = apply_matches.unwrap().get_one::("range guard").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `apply_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:116:36 [INFO] [stdout] | [INFO] [stdout] 112 | if apply_matches.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = apply_matches` [INFO] [stdout] ... [INFO] [stdout] 116 | let guard_prefix = apply_matches.unwrap().get_one::("guard prefix").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/suse.rs:539:8 [INFO] [stdout] | [INFO] [stdout] 539 | if subject.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `subject.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/suse.rs:582:8 [INFO] [stdout] | [INFO] [stdout] 582 | if session.unmerged_paths.len() == 0 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `session.unmerged_paths.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/suse.rs:584:8 [INFO] [stdout] | [INFO] [stdout] 584 | session.modified_paths.len() == 0 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `session.modified_paths.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 seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:168:5 [INFO] [stdout] | [INFO] [stdout] 168 | / match log.load(&work_dir) { [INFO] [stdout] 169 | | Err(_error) => { [INFO] [stdout] 170 | | println!("{}", "\nFailed to open b2tf.log. Run setup to create it.".red()); [INFO] [stdout] 171 | | return Ok(()); [INFO] [stdout] 172 | | }, [INFO] [stdout] 173 | | _ => {}, [INFO] [stdout] 174 | | }; [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] help: try [INFO] [stdout] | [INFO] [stdout] 168 ~ if let Err(_error) = log.load(&work_dir) { [INFO] [stdout] 169 + println!("{}", "\nFailed to open b2tf.log. Run setup to create it.".red()); [INFO] [stdout] 170 + return Ok(()); [INFO] [stdout] 171 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/suse.rs:604:29 [INFO] [stdout] | [INFO] [stdout] 604 | output.push_str(format!("{}", actions[0]).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `actions[0].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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/suse.rs:612:14 [INFO] [stdout] | [INFO] [stdout] 612 | Git::cmd(format!("commit -a --no-verify -F /tmp/b2tf-commit-msg"), &kernel_source)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"commit -a --no-verify -F /tmp/b2tf-commit-msg".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] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/suse.rs:630:50 [INFO] [stdout] | [INFO] [stdout] 630 | if cols.len() >= 2 && cols[1] == path && cols[0].chars().nth(0).unwrap() == '+' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `cols[0].chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/suse.rs:654:14 [INFO] [stdout] | [INFO] [stdout] 654 | for g in &*processed_commits { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] = note: `#[warn(clippy::borrow_deref_ref)]` on by default [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 654 - for g in &*processed_commits { [INFO] [stdout] 654 + for g in processed_commits { [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 654 | for g in &**processed_commits { [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/suse.rs:655:37 [INFO] [stdout] | [INFO] [stdout] 655 | if compare_commits(&hashes, &g) { [INFO] [stdout] | ^^ help: change this to: `g` [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 boolean expression can be simplified [INFO] [stdout] --> src/suse.rs:699:8 [INFO] [stdout] | [INFO] [stdout] 699 | if !check_guard(file_name, &kernel_source)?.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `check_guard(file_name, &kernel_source)?.is_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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/suse.rs:735:30 [INFO] [stdout] | [INFO] [stdout] 735 | let refs = get_suse_tags(&suse_path, &kernel_source, "References")?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `suse_path` [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/suse.rs:735:42 [INFO] [stdout] | [INFO] [stdout] 735 | let refs = get_suse_tags(&suse_path, &kernel_source, "References")?; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `kernel_source` [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: length comparison to one [INFO] [stdout] --> src/suse.rs:736:8 [INFO] [stdout] | [INFO] [stdout] 736 | if refs.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `refs.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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/suse.rs:764:35 [INFO] [stdout] | [INFO] [stdout] 764 | print!("{}", get_ref_link(&r).yellow()); [INFO] [stdout] | ^^ help: change this to: `r` [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 variable `i` is used as a loop counter [INFO] [stdout] --> src/suse.rs:859:5 [INFO] [stdout] | [INFO] [stdout] 859 | for path in &paths { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using: `for (i, path) in (1..).zip(paths.iter())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` 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/suse.rs:885:39 [INFO] [stdout] | [INFO] [stdout] 885 | remove_guard(options, &guard_file_name)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `guard_file_name` [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/suse.rs:901:30 [INFO] [stdout] | [INFO] [stdout] 901 | suse_log(&options, &suse_path.0)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `options` [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/suse.rs:918:26 [INFO] [stdout] | [INFO] [stdout] 918 | suse_log(&options, &suse_path.0)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `options` [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/suse.rs:935:18 [INFO] [stdout] | [INFO] [stdout] 935 | suse_log(&options, "")?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `options` [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: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/patch.rs:121:18 [INFO] [stdout] | [INFO] [stdout] 121 | let h1 = String::from(self.section_header.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `self.section_header.clone()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/patch.rs:122:18 [INFO] [stdout] | [INFO] [stdout] 122 | let h2 = String::from(hunk.section_header.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `hunk.section_header.clone()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/patch.rs:138:9 [INFO] [stdout] | [INFO] [stdout] 138 | / if !fuzz { [INFO] [stdout] 139 | | if self.source_start != hunk.source_start || [INFO] [stdout] 140 | | self.source_length != hunk.source_length || [INFO] [stdout] 141 | | self.target_start != hunk.target_start || [INFO] [stdout] ... | [INFO] [stdout] 145 | | } [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] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 138 ~ if !fuzz [INFO] [stdout] 139 ~ && (self.source_start != hunk.source_start || [INFO] [stdout] 140 | self.source_length != hunk.source_length || [INFO] [stdout] 141 | self.target_start != hunk.target_start || [INFO] [stdout] 142 ~ self.target_length != hunk.target_length) { [INFO] [stdout] 143 | return false; [INFO] [stdout] 144 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Options` [INFO] [stdout] --> src/main.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | / pub fn new() -> Options { [INFO] [stdout] 43 | | Options { [INFO] [stdout] 44 | | range_start: None, [INFO] [stdout] 45 | | range_stop: None, [INFO] [stdout] ... | [INFO] [stdout] 62 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 41 + impl Default for Options { [INFO] [stdout] 42 + fn default() -> Self { [INFO] [stdout] 43 + Self::new() [INFO] [stdout] 44 + } [INFO] [stdout] 45 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `prepend_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:75:24 [INFO] [stdout] | [INFO] [stdout] 74 | if prepend_matches.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = prepend_matches` [INFO] [stdout] 75 | let hash = prepend_matches.unwrap().get_one::("hashes to prepend").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `append_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:81:24 [INFO] [stdout] | [INFO] [stdout] 80 | if append_matches.is_some() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = append_matches` [INFO] [stdout] 81 | let hash = append_matches.unwrap().get_one::("hashes to append").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `insert_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:87:24 [INFO] [stdout] | [INFO] [stdout] 86 | if insert_matches.is_some() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = insert_matches` [INFO] [stdout] 87 | let hash = insert_matches.unwrap().get_one::("hashes to append").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `insert_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:90:25 [INFO] [stdout] | [INFO] [stdout] 86 | if insert_matches.is_some() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = insert_matches` [INFO] [stdout] ... [INFO] [stdout] 90 | let after = insert_matches.unwrap().get_one::("insert after this hash").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `diffdiff_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:96:24 [INFO] [stdout] | [INFO] [stdout] 95 | if diffdiff_matches.is_some() { [INFO] [stdout] | ----------------------------- help: try: `if let Some() = diffdiff_matches` [INFO] [stdout] 96 | let skip = diffdiff_matches.unwrap().get_one::("comma separated list of commits to skip").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `compare_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:102:26 [INFO] [stdout] | [INFO] [stdout] 101 | if compare_matches.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = compare_matches` [INFO] [stdout] 102 | let patch1 = compare_matches.unwrap().get_one::("patch 1").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `compare_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:103:26 [INFO] [stdout] | [INFO] [stdout] 101 | if compare_matches.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = compare_matches` [INFO] [stdout] 102 | let patch1 = compare_matches.unwrap().get_one::("patch 1").cloned(); [INFO] [stdout] 103 | let patch2 = compare_matches.unwrap().get_one::("patch 2").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `suse_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:111:33 [INFO] [stdout] | [INFO] [stdout] 110 | if suse_matches.is_some() { [INFO] [stdout] | ------------------------- help: try: `if let Some() = suse_matches` [INFO] [stdout] 111 | let apply_matches = suse_matches.unwrap().subcommand_matches("apply"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `apply_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:113:35 [INFO] [stdout] | [INFO] [stdout] 112 | if apply_matches.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = apply_matches` [INFO] [stdout] 113 | let range_guard = apply_matches.unwrap().get_one::("range guard").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `apply_matches` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:116:36 [INFO] [stdout] | [INFO] [stdout] 112 | if apply_matches.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = apply_matches` [INFO] [stdout] ... [INFO] [stdout] 116 | let guard_prefix = apply_matches.unwrap().get_one::("guard prefix").cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [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:168:5 [INFO] [stdout] | [INFO] [stdout] 168 | / match log.load(&work_dir) { [INFO] [stdout] 169 | | Err(_error) => { [INFO] [stdout] 170 | | println!("{}", "\nFailed to open b2tf.log. Run setup to create it.".red()); [INFO] [stdout] 171 | | return Ok(()); [INFO] [stdout] 172 | | }, [INFO] [stdout] 173 | | _ => {}, [INFO] [stdout] 174 | | }; [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] help: try [INFO] [stdout] | [INFO] [stdout] 168 ~ if let Err(_error) = log.load(&work_dir) { [INFO] [stdout] 169 + println!("{}", "\nFailed to open b2tf.log. Run setup to create it.".red()); [INFO] [stdout] 170 + return Ok(()); [INFO] [stdout] 171 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 11.44s [INFO] running `Command { std: "docker" "inspect" "ebf673d89f0058220534fcf889e01c6c5583ad0d6a3b1df2de820c9b1d83f085", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "ebf673d89f0058220534fcf889e01c6c5583ad0d6a3b1df2de820c9b1d83f085", kill_on_drop: false }` [INFO] [stdout] ebf673d89f0058220534fcf889e01c6c5583ad0d6a3b1df2de820c9b1d83f085