[INFO] cloning repository https://github.com/JetShen/RustBackup [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/JetShen/RustBackup" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FJetShen%2FRustBackup", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FJetShen%2FRustBackup'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 0cd9f657ce4cb9f1171af8baf3cd450f4a0ef00b [INFO] linting JetShen/RustBackup against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FJetShen%2FRustBackup" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/JetShen/RustBackup [INFO] finished tweaking git repo https://github.com/JetShen/RustBackup [INFO] tweaked toml for git repo https://github.com/JetShen/RustBackup written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/JetShen/RustBackup 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/JetShen/RustBackup 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] Downloading crates ... [INFO] [stderr] Downloaded chrono v0.4.31 [INFO] [stderr] Downloaded libc v0.2.149 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 123b5690c89434da83fb53f25ea69983d12c14cf46196d2baa1c4b65f555a16e [INFO] running `Command { std: "docker" "start" "-a" "123b5690c89434da83fb53f25ea69983d12c14cf46196d2baa1c4b65f555a16e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "123b5690c89434da83fb53f25ea69983d12c14cf46196d2baa1c4b65f555a16e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "123b5690c89434da83fb53f25ea69983d12c14cf46196d2baa1c4b65f555a16e", kill_on_drop: false }` [INFO] [stdout] 123b5690c89434da83fb53f25ea69983d12c14cf46196d2baa1c4b65f555a16e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 507ebb18b578ea9bd57001aa7a8800a38e198d08e4e7f467946a185a54ce38af [INFO] running `Command { std: "docker" "start" "-a" "507ebb18b578ea9bd57001aa7a8800a38e198d08e4e7f467946a185a54ce38af", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.67 [INFO] [stderr] Compiling serde v1.0.188 [INFO] [stderr] Compiling serde_json v1.0.107 [INFO] [stderr] Checking ryu v1.0.15 [INFO] [stderr] Compiling num-traits v0.2.17 [INFO] [stderr] Compiling quote v1.0.33 [INFO] [stderr] Compiling syn v2.0.37 [INFO] [stderr] Checking chrono v0.4.31 [INFO] [stderr] Compiling serde_derive v1.0.188 [INFO] [stderr] Checking seguridad v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/comands/check.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | if !fs::metadata(path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(path).is_err()` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/comands/check_args.rs:3:30 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn check_args(argumts : &Vec)-> i32{ [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] 3 - pub fn check_args(argumts : &Vec)-> i32{ [INFO] [stdout] 3 + pub fn check_args(argumts : &[String])-> i32{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/comands/log.rs:17:21 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn log(paths : &Vec){ [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] 17 - pub fn log(paths : &Vec){ [INFO] [stdout] 17 + pub fn log(paths : &[String]){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this item has comments with 4 forward slashes (`////`). These look like doc comments, but they aren't [INFO] [stdout] --> src/comands/check_log.rs:3:1 [INFO] [stdout] | [INFO] [stdout] 3 | / //// Checks if the file "log.json" exists in the specified location. [INFO] [stdout] 4 | | /// [INFO] [stdout] 5 | | /// # Arguments [INFO] [stdout] 6 | | /// [INFO] [stdout] ... | [INFO] [stdout] 11 | | /// `true` if the file exists, `false` otherwise. [INFO] [stdout] 12 | | pub fn check_log(destination_path: &str) -> bool { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#four_forward_slashes [INFO] [stdout] = note: `#[warn(clippy::four_forward_slashes)]` on by default [INFO] [stdout] help: make this a doc comment by removing one `/` [INFO] [stdout] | [INFO] [stdout] 3 - //// Checks if the file "log.json" exists in the specified location. [INFO] [stdout] 4 - /// [INFO] [stdout] 3 + /// Checks if the file "log.json" exists in the specified location. [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/comands/copy_all.rs:3:25 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn copy_all(paths : &Vec){ [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] 3 - pub fn copy_all(paths : &Vec){ [INFO] [stdout] 3 + pub fn copy_all(paths : &[String]){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/comands/copy_modify.rs:16:28 [INFO] [stdout] | [INFO] [stdout] 16 | pub fn compy_modify(paths: &Vec) { [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] 16 - pub fn compy_modify(paths: &Vec) { [INFO] [stdout] 16 + pub fn compy_modify(paths: &[String]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/comands/copy_modify.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | / for entry in entries { [INFO] [stdout] 28 | | if let Ok(entry) = entry { [INFO] [stdout] 29 | | let file_path = entry.path(); [INFO] [stdout] 30 | | let file_name = file_path.file_name().unwrap().to_str().unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 45 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/comands/copy_modify.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | / if let Ok(entry) = entry { [INFO] [stdout] 29 | | let file_path = entry.path(); [INFO] [stdout] 30 | | let file_name = file_path.file_name().unwrap().to_str().unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 44 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 27 ~ for entry in entries.flatten() { [INFO] [stdout] 28 + let file_path = entry.path(); [INFO] [stdout] 29 + let file_name = file_path.file_name().unwrap().to_str().unwrap(); [INFO] [stdout] 30 + [INFO] [stdout] 31 + if let Some(file_info) = files_info.iter().find(|info| info.name == file_name) { [INFO] [stdout] 32 + let modified_time = entry.metadata().unwrap().modified().unwrap(); [INFO] [stdout] 33 + let duration = modified_time.duration_since(SystemTime::UNIX_EPOCH).unwrap(); [INFO] [stdout] 34 + let log_date = NaiveDate::parse_from_str(&file_info.copydate, "%d-%m-%Y").expect("Failed to parse log date"); [INFO] [stdout] 35 + let epoch = NaiveDate::from_ymd_opt(1970, 1, 1).unwrap(); [INFO] [stdout] 36 + [INFO] [stdout] 37 + if duration > Duration::from_secs(0) && duration > log_date.signed_duration_since(epoch).to_std().unwrap() { [INFO] [stdout] 38 + println!("The file {} has been modified since the last time", file_info.name); [INFO] [stdout] 39 + } else { [INFO] [stdout] 40 + println!("The file {} has not been modified since last time", file_info.name); [INFO] [stdout] 41 + } [INFO] [stdout] 42 + } [INFO] [stdout] 43 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:17:47 [INFO] [stdout] | [INFO] [stdout] 17 | let exist = comands::check_log::check_log(&destination_path); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `destination_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/comands/check.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | if !fs::metadata(path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(path).is_err()` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/comands/check_args.rs:3:30 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn check_args(argumts : &Vec)-> i32{ [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] 3 - pub fn check_args(argumts : &Vec)-> i32{ [INFO] [stdout] 3 + pub fn check_args(argumts : &[String])-> i32{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/comands/log.rs:17:21 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn log(paths : &Vec){ [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] 17 - pub fn log(paths : &Vec){ [INFO] [stdout] 17 + pub fn log(paths : &[String]){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this item has comments with 4 forward slashes (`////`). These look like doc comments, but they aren't [INFO] [stdout] --> src/comands/check_log.rs:3:1 [INFO] [stdout] | [INFO] [stdout] 3 | / //// Checks if the file "log.json" exists in the specified location. [INFO] [stdout] 4 | | /// [INFO] [stdout] 5 | | /// # Arguments [INFO] [stdout] 6 | | /// [INFO] [stdout] ... | [INFO] [stdout] 11 | | /// `true` if the file exists, `false` otherwise. [INFO] [stdout] 12 | | pub fn check_log(destination_path: &str) -> bool { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#four_forward_slashes [INFO] [stdout] = note: `#[warn(clippy::four_forward_slashes)]` on by default [INFO] [stdout] help: make this a doc comment by removing one `/` [INFO] [stdout] | [INFO] [stdout] 3 - //// Checks if the file "log.json" exists in the specified location. [INFO] [stdout] 4 - /// [INFO] [stdout] 3 + /// Checks if the file "log.json" exists in the specified location. [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/comands/copy_all.rs:3:25 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn copy_all(paths : &Vec){ [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] 3 - pub fn copy_all(paths : &Vec){ [INFO] [stdout] 3 + pub fn copy_all(paths : &[String]){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/comands/copy_modify.rs:16:28 [INFO] [stdout] | [INFO] [stdout] 16 | pub fn compy_modify(paths: &Vec) { [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] 16 - pub fn compy_modify(paths: &Vec) { [INFO] [stdout] 16 + pub fn compy_modify(paths: &[String]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/comands/copy_modify.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | / for entry in entries { [INFO] [stdout] 28 | | if let Ok(entry) = entry { [INFO] [stdout] 29 | | let file_path = entry.path(); [INFO] [stdout] 30 | | let file_name = file_path.file_name().unwrap().to_str().unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 45 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/comands/copy_modify.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | / if let Ok(entry) = entry { [INFO] [stdout] 29 | | let file_path = entry.path(); [INFO] [stdout] 30 | | let file_name = file_path.file_name().unwrap().to_str().unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 44 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 27 ~ for entry in entries.flatten() { [INFO] [stdout] 28 + let file_path = entry.path(); [INFO] [stdout] 29 + let file_name = file_path.file_name().unwrap().to_str().unwrap(); [INFO] [stdout] 30 + [INFO] [stdout] 31 + if let Some(file_info) = files_info.iter().find(|info| info.name == file_name) { [INFO] [stdout] 32 + let modified_time = entry.metadata().unwrap().modified().unwrap(); [INFO] [stdout] 33 + let duration = modified_time.duration_since(SystemTime::UNIX_EPOCH).unwrap(); [INFO] [stdout] 34 + let log_date = NaiveDate::parse_from_str(&file_info.copydate, "%d-%m-%Y").expect("Failed to parse log date"); [INFO] [stdout] 35 + let epoch = NaiveDate::from_ymd_opt(1970, 1, 1).unwrap(); [INFO] [stdout] 36 + [INFO] [stdout] 37 + if duration > Duration::from_secs(0) && duration > log_date.signed_duration_since(epoch).to_std().unwrap() { [INFO] [stdout] 38 + println!("The file {} has been modified since the last time", file_info.name); [INFO] [stdout] 39 + } else { [INFO] [stdout] 40 + println!("The file {} has not been modified since last time", file_info.name); [INFO] [stdout] 41 + } [INFO] [stdout] 42 + } [INFO] [stdout] 43 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:17:47 [INFO] [stdout] | [INFO] [stdout] 17 | let exist = comands::check_log::check_log(&destination_path); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `destination_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 13.37s [INFO] running `Command { std: "docker" "inspect" "507ebb18b578ea9bd57001aa7a8800a38e198d08e4e7f467946a185a54ce38af", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "507ebb18b578ea9bd57001aa7a8800a38e198d08e4e7f467946a185a54ce38af", kill_on_drop: false }` [INFO] [stdout] 507ebb18b578ea9bd57001aa7a8800a38e198d08e4e7f467946a185a54ce38af