[INFO] cloning repository https://github.com/freiguy1/rust-notes [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/freiguy1/rust-notes" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ffreiguy1%2Frust-notes", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ffreiguy1%2Frust-notes'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 1eaf624fdfd461889b8debfde6d08807695cdd13 [INFO] linting freiguy1/rust-notes against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ffreiguy1%2Frust-notes" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/freiguy1/rust-notes [INFO] finished tweaking git repo https://github.com/freiguy1/rust-notes [INFO] tweaked toml for git repo https://github.com/freiguy1/rust-notes written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/freiguy1/rust-notes 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/freiguy1/rust-notes 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 docopt v1.1.0 [INFO] [stderr] Downloaded handlebars v3.5.1 [INFO] [stderr] Downloaded syn v1.0.51 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] bfe0ecc009f189b64de22f60e3269d84533a714cc596890d652010a57c6ba9d5 [INFO] running `Command { std: "docker" "start" "-a" "bfe0ecc009f189b64de22f60e3269d84533a714cc596890d652010a57c6ba9d5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "bfe0ecc009f189b64de22f60e3269d84533a714cc596890d652010a57c6ba9d5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "bfe0ecc009f189b64de22f60e3269d84533a714cc596890d652010a57c6ba9d5", kill_on_drop: false }` [INFO] [stdout] bfe0ecc009f189b64de22f60e3269d84533a714cc596890d652010a57c6ba9d5 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] 7451e3134700e1d8f5b2ee74a53df6e0283f2dbcd33854b5533ee6b4b0de6259 [INFO] running `Command { std: "docker" "start" "-a" "7451e3134700e1d8f5b2ee74a53df6e0283f2dbcd33854b5533ee6b4b0de6259", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.24 [INFO] [stderr] Compiling syn v1.0.51 [INFO] [stderr] Compiling serde_derive v1.0.117 [INFO] [stderr] Compiling memchr v2.3.4 [INFO] [stderr] Compiling serde v1.0.117 [INFO] [stderr] Compiling log v0.4.11 [INFO] [stderr] Compiling serde_json v1.0.59 [INFO] [stderr] Checking ucd-trie v0.1.3 [INFO] [stderr] Checking itoa v0.4.6 [INFO] [stderr] Compiling pulldown-cmark v0.8.0 [INFO] [stderr] Compiling unicase v2.6.0 [INFO] [stderr] Checking regex-syntax v0.6.21 [INFO] [stderr] Checking getopts v0.2.21 [INFO] [stderr] Checking quick-error v2.0.0 [INFO] [stderr] Checking strsim v0.9.3 [INFO] [stderr] Checking pest v2.1.3 [INFO] [stderr] Checking aho-corasick v0.7.15 [INFO] [stderr] Compiling quote v1.0.7 [INFO] [stderr] Checking regex v1.4.2 [INFO] [stderr] Compiling pest_generator v2.1.3 [INFO] [stderr] Compiling pest_derive v2.1.0 [INFO] [stderr] Checking docopt v1.1.0 [INFO] [stderr] Checking handlebars v3.5.1 [INFO] [stderr] Checking rust-notes v0.0.1 (/opt/rustwide/workdir) [INFO] [stdout] warning: statics have by default a `'static` lifetime [INFO] [stdout] --> src/file_type/dir.rs:12:19 [INFO] [stdout] | [INFO] [stdout] 12 | static TYPE_STR: &'static str = "dir"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/file_type/dir.rs:148:13 [INFO] [stdout] | [INFO] [stdout] 148 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statics have by default a `'static` lifetime [INFO] [stdout] --> src/file_type/dir.rs:12:19 [INFO] [stdout] | [INFO] [stdout] 12 | static TYPE_STR: &'static str = "dir"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/file_type/dir.rs:149:13 [INFO] [stdout] | [INFO] [stdout] 149 | parents: parents, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `parents` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/file_type/dir.rs:150:13 [INFO] [stdout] | [INFO] [stdout] 150 | children: children, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `children` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statics have by default a `'static` lifetime [INFO] [stdout] --> src/file_type/markdown.rs:13:19 [INFO] [stdout] | [INFO] [stdout] 13 | static TYPE_STR: &'static str = "markdown"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/file_type/markdown.rs:121:13 [INFO] [stdout] | [INFO] [stdout] 121 | parents: parents, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `parents` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statics have by default a `'static` lifetime [INFO] [stdout] --> src/file_type/unknown.rs:8:19 [INFO] [stdout] | [INFO] [stdout] 8 | static TYPE_STR: &'static str = "unknown"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/file_type/mod.rs:81:21 [INFO] [stdout] | [INFO] [stdout] 81 | url: url, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `url` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/file_type/dir.rs:148:13 [INFO] [stdout] | [INFO] [stdout] 148 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/file_type/dir.rs:149:13 [INFO] [stdout] | [INFO] [stdout] 149 | parents: parents, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `parents` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/file_type/dir.rs:150:13 [INFO] [stdout] | [INFO] [stdout] 150 | children: children, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `children` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statics have by default a `'static` lifetime [INFO] [stdout] --> src/main.rs:12:16 [INFO] [stdout] | [INFO] [stdout] 12 | static USAGE: &'static str = " [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statics have by default a `'static` lifetime [INFO] [stdout] --> src/file_type/markdown.rs:13:19 [INFO] [stdout] | [INFO] [stdout] 13 | static TYPE_STR: &'static str = "markdown"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/file_type/markdown.rs:121:13 [INFO] [stdout] | [INFO] [stdout] 121 | parents: parents, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `parents` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/main.rs:142:13 [INFO] [stdout] | [INFO] [stdout] 142 | context: context, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `context` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/main.rs:143:13 [INFO] [stdout] | [INFO] [stdout] 143 | file_type_manager: file_type_manager, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `file_type_manager` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statics have by default a `'static` lifetime [INFO] [stdout] --> src/file_type/unknown.rs:8:19 [INFO] [stdout] | [INFO] [stdout] 8 | static TYPE_STR: &'static str = "unknown"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/file_type/mod.rs:81:21 [INFO] [stdout] | [INFO] [stdout] 81 | url: url, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `url` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statics have by default a `'static` lifetime [INFO] [stdout] --> src/main.rs:12:16 [INFO] [stdout] | [INFO] [stdout] 12 | static USAGE: &'static str = " [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/main.rs:142:13 [INFO] [stdout] | [INFO] [stdout] 142 | context: context, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `context` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/main.rs:143:13 [INFO] [stdout] | [INFO] [stdout] 143 | file_type_manager: file_type_manager, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `file_type_manager` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/dir.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | if metadata(&path) [INFO] [stdout] | ____________^ [INFO] [stdout] 19 | | .ok() [INFO] [stdout] 20 | | .expect("Error fetching metadata for file") [INFO] [stdout] | |_______________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] = note: `#[warn(clippy::ok_expect)]` on by default [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 18 - if metadata(&path) [INFO] [stdout] 19 - .ok() [INFO] [stdout] 20 - .expect("Error fetching metadata for file") [INFO] [stdout] 18 + if metadata(&path).expect("Error fetching metadata for file") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/file_type/dir.rs:18:21 [INFO] [stdout] | [INFO] [stdout] 18 | if metadata(&path) [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/dir.rs:36:12 [INFO] [stdout] | [INFO] [stdout] 36 | if !metadata(&header_hbs_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(&header_hbs_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: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/dir.rs:41:12 [INFO] [stdout] | [INFO] [stdout] 41 | if !metadata(&footer_hbs_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(&footer_hbs_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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/dir.rs:47:12 [INFO] [stdout] | [INFO] [stdout] 47 | if !metadata(&dir_hbs_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(&dir_hbs_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] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/dir.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 59 | / app_context [INFO] [stdout] 60 | | .handlebars [INFO] [stdout] 61 | | .register_template_string( [INFO] [stdout] 62 | | dir_template_name, [INFO] [stdout] ... | [INFO] [stdout] 68 | | .ok() [INFO] [stdout] 69 | | .expect("Error registering header|dir|footer template"); [INFO] [stdout] | |___________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 67 - ) [INFO] [stdout] 68 - .ok() [INFO] [stdout] 69 - .expect("Error registering header|dir|footer template"); [INFO] [stdout] 67 + ).expect("Error registering header|dir|footer template"); [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/file_type/dir.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 85 | / match fs::read_dir(&self.path) { [INFO] [stdout] 86 | | Ok(items) => { [INFO] [stdout] 87 | | for item in items { [INFO] [stdout] 88 | | let item = item.unwrap().path(); [INFO] [stdout] ... | [INFO] [stdout] 97 | | Err(_) => (), [INFO] [stdout] 98 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 85 ~ if let Ok(items) = fs::read_dir(&self.path) { [INFO] [stdout] 86 + for item in items { [INFO] [stdout] 87 + let item = item.unwrap().path(); [INFO] [stdout] 88 + let child = self.file_type_manager.create_file_type(&item); [INFO] [stdout] 89 + result.push(Child { [INFO] [stdout] 90 + name: String::from(item.file_stem().unwrap().to_str().unwrap()), [INFO] [stdout] 91 + url: child.get_url(context), [INFO] [stdout] 92 + file_type: String::from(child.get_type_str()), [INFO] [stdout] 93 + }); [INFO] [stdout] 94 + } [INFO] [stdout] 95 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/file_type/dir.rs:100:9 [INFO] [stdout] | [INFO] [stdout] 100 | (&mut result).sort_by(|a, b| { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `result` [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 creates an owned instance just for comparison [INFO] [stdout] --> src/file_type/dir.rs:101:31 [INFO] [stdout] | [INFO] [stdout] 101 | if a.file_type == String::from(TYPE_STR) && b.file_type != String::from(TYPE_STR) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `TYPE_STR` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/file_type/dir.rs:101:72 [INFO] [stdout] | [INFO] [stdout] 101 | if a.file_type == String::from(TYPE_STR) && b.file_type != String::from(TYPE_STR) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `TYPE_STR` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/file_type/dir.rs:103:38 [INFO] [stdout] | [INFO] [stdout] 103 | } else if a.file_type != String::from(TYPE_STR) && b.file_type == String::from(TYPE_STR) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `TYPE_STR` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/file_type/dir.rs:103:79 [INFO] [stdout] | [INFO] [stdout] 103 | } else if a.file_type != String::from(TYPE_STR) && b.file_type == String::from(TYPE_STR) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `TYPE_STR` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/dir.rs:136:12 [INFO] [stdout] | [INFO] [stdout] 136 | if !metadata(&new_dir).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(&new_dir).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] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/file_type/dir.rs:134:46 [INFO] [stdout] | [INFO] [stdout] 134 | let new_dir = context.root_dest.join(&relative); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `relative` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/dir.rs:137:13 [INFO] [stdout] | [INFO] [stdout] 137 | / fs::create_dir(&new_dir) [INFO] [stdout] 138 | | .ok() [INFO] [stdout] 139 | | .expect("Cannot create destination subdir"); [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 137 - fs::create_dir(&new_dir) [INFO] [stdout] 138 - .ok() [INFO] [stdout] 139 - .expect("Cannot create destination subdir"); [INFO] [stdout] 137 + fs::create_dir(&new_dir).expect("Cannot create destination subdir"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/file_type/dir.rs:146:62 [INFO] [stdout] | [INFO] [stdout] 146 | let parents = create_parent_links(&context.base_url, &relative, true); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `relative` [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 `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/dir.rs:156:32 [INFO] [stdout] | [INFO] [stdout] 156 | let mut file = File::create(&new_dir_index) [INFO] [stdout] | ________________________________^ [INFO] [stdout] 157 | | .ok() [INFO] [stdout] 158 | | .expect("Could not create dir index.html file"); [INFO] [stdout] | |___________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 156 - let mut file = File::create(&new_dir_index) [INFO] [stdout] 157 - .ok() [INFO] [stdout] 158 - .expect("Could not create dir index.html file"); [INFO] [stdout] 156 + let mut file = File::create(&new_dir_index).expect("Could not create dir index.html file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/dir.rs:160:17 [INFO] [stdout] | [INFO] [stdout] 160 | / file.write_all(rendered.as_bytes()) [INFO] [stdout] 161 | | .ok() [INFO] [stdout] 162 | | .expect("Could not write html to file"); [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 160 - file.write_all(rendered.as_bytes()) [INFO] [stdout] 161 - .ok() [INFO] [stdout] 162 - .expect("Could not write html to file"); [INFO] [stdout] 160 + file.write_all(rendered.as_bytes()).expect("Could not write html to file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/markdown.rs:20:29 [INFO] [stdout] | [INFO] [stdout] 20 | let path_metadata = metadata(&path).ok().expect("Could not fetch file metadata"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 20 - let path_metadata = metadata(&path).ok().expect("Could not fetch file metadata"); [INFO] [stdout] 20 + let path_metadata = metadata(&path).expect("Could not fetch file metadata"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/file_type/markdown.rs:20:38 [INFO] [stdout] | [INFO] [stdout] 20 | let path_metadata = metadata(&path).ok().expect("Could not fetch file metadata"); [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/markdown.rs:36:12 [INFO] [stdout] | [INFO] [stdout] 36 | if !metadata(&header_hbs_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(&header_hbs_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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/markdown.rs:41:12 [INFO] [stdout] | [INFO] [stdout] 41 | if !metadata(&footer_hbs_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(&footer_hbs_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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/markdown.rs:46:12 [INFO] [stdout] | [INFO] [stdout] 46 | if !metadata(¬e_hbs_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(¬e_hbs_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] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/markdown.rs:53:9 [INFO] [stdout] | [INFO] [stdout] 53 | / app_context [INFO] [stdout] 54 | | .handlebars [INFO] [stdout] 55 | | .register_template_string( [INFO] [stdout] 56 | | TYPE_STR, [INFO] [stdout] ... | [INFO] [stdout] 62 | | .ok() [INFO] [stdout] 63 | | .expect("Error registering header|note|footer template"); [INFO] [stdout] | |____________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 61 - ) [INFO] [stdout] 62 - .ok() [INFO] [stdout] 63 - .expect("Error registering header|note|footer template"); [INFO] [stdout] 61 + ).expect("Error registering header|note|footer template"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> src/file_type/markdown.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 89 | / format!( [INFO] [stdout] 90 | | "{}{}{}", [INFO] [stdout] 91 | | context.base_url, [INFO] [stdout] 92 | | parent_relative, [INFO] [stdout] 93 | | format!("{}.html", file_name) [INFO] [stdout] 94 | | ) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/markdown.rs:109:9 [INFO] [stdout] | [INFO] [stdout] 109 | / File::open(&self.path) [INFO] [stdout] 110 | | .ok() [INFO] [stdout] 111 | | .unwrap() [INFO] [stdout] 112 | | .read_to_string(&mut source_contents) [INFO] [stdout] 113 | | .ok() [INFO] [stdout] 114 | | .expect("Could not read markdown file"); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 112 - .read_to_string(&mut source_contents) [INFO] [stdout] 113 - .ok() [INFO] [stdout] 114 - .expect("Could not read markdown file"); [INFO] [stdout] 112 + .read_to_string(&mut source_contents).expect("Could not read markdown file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/file_type/markdown.rs:117:62 [INFO] [stdout] | [INFO] [stdout] 117 | let parents = create_parent_links(&context.base_url, &relative, false); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `relative` [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 use of `format!` [INFO] [stdout] --> src/file_type/markdown.rs:122:22 [INFO] [stdout] | [INFO] [stdout] 122 | content: format!("{}", content), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `content.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: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/markdown.rs:128:32 [INFO] [stdout] | [INFO] [stdout] 128 | let mut file = File::create(&dest_file) [INFO] [stdout] | ________________________________^ [INFO] [stdout] 129 | | .ok() [INFO] [stdout] 130 | | .expect("Could not create markdown html file"); [INFO] [stdout] | |__________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 128 - let mut file = File::create(&dest_file) [INFO] [stdout] 129 - .ok() [INFO] [stdout] 130 - .expect("Could not create markdown html file"); [INFO] [stdout] 128 + let mut file = File::create(&dest_file).expect("Could not create markdown html file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/markdown.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | / file.write_all(rendered.as_bytes()) [INFO] [stdout] 133 | | .ok() [INFO] [stdout] 134 | | .expect("Could not write html to file"); [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 132 - file.write_all(rendered.as_bytes()) [INFO] [stdout] 133 - .ok() [INFO] [stdout] 134 - .expect("Could not write html to file"); [INFO] [stdout] 132 + file.write_all(rendered.as_bytes()).expect("Could not write html to file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/file_type/markdown.rs:161:25 [INFO] [stdout] | [INFO] [stdout] 161 | let p = Parser::new(&text); [INFO] [stdout] | ^^^^^ help: change this to: `text` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/file_type/unknown.rs:55:50 [INFO] [stdout] | [INFO] [stdout] 55 | let destination = context.root_dest.join(&relative); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `relative` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/unknown.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | / fs::copy(&self.path, &destination) [INFO] [stdout] 57 | | .ok() [INFO] [stdout] 58 | | .expect("Problem copying unknown file"); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 56 - fs::copy(&self.path, &destination) [INFO] [stdout] 57 - .ok() [INFO] [stdout] 58 - .expect("Problem copying unknown file"); [INFO] [stdout] 56 + fs::copy(&self.path, &destination).expect("Problem copying unknown file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `result_maybe` after checking its variant with `is_some` [INFO] [stdout] --> src/file_type/mod.rs:52:24 [INFO] [stdout] | [INFO] [stdout] 51 | if result_maybe.is_some() { [INFO] [stdout] | ------------------------- help: try: `if let Some() = result_maybe` [INFO] [stdout] 52 | return result_maybe.unwrap(); [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: useless use of `format!` [INFO] [stdout] --> src/file_type/mod.rs:71:18 [INFO] [stdout] | [INFO] [stdout] 71 | url: format!("{}", base_url), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `base_url.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: the borrowed expression implements the required traits [INFO] [stdout] --> src/file_type/mod.rs:92:37 [INFO] [stdout] | [INFO] [stdout] 92 | let mut file = match File::open(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [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/file_type/mod.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | / match file.read_to_string(&mut contents) { [INFO] [stdout] 98 | | Err(_) => return Err("Could not read file."), [INFO] [stdout] 99 | | _ => (), [INFO] [stdout] 100 | | } [INFO] [stdout] | |_____^ help: try: `if let Err(_) = file.read_to_string(&mut contents) { return Err("Could not read file.") }` [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 `ok().expect()` on a `Result` value [INFO] [stdout] --> src/util.rs:30:45 [INFO] [stdout] | [INFO] [stdout] 30 | let path_metadata = fs::metadata(&path) [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 31 | | .ok() [INFO] [stdout] 32 | | .expect("Error fetching metadata for file"); [INFO] [stdout] | |_______________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 30 - let path_metadata = fs::metadata(&path) [INFO] [stdout] 31 - .ok() [INFO] [stdout] 32 - .expect("Error fetching metadata for file"); [INFO] [stdout] 30 + let path_metadata = fs::metadata(&path).expect("Error fetching metadata for file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | / fs::create_dir(dest) [INFO] [stdout] 41 | | .ok() [INFO] [stdout] 42 | | .expect("Problem copying directory"); [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 40 - fs::create_dir(dest) [INFO] [stdout] 41 - .ok() [INFO] [stdout] 42 - .expect("Problem copying directory"); [INFO] [stdout] 40 + fs::create_dir(dest).expect("Problem copying directory"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:43:17 [INFO] [stdout] | [INFO] [stdout] 43 | for item in util::walk_dir(source) [INFO] [stdout] | _________________^ [INFO] [stdout] 44 | | .ok() [INFO] [stdout] 45 | | .expect("Problem copying directory") [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 43 - for item in util::walk_dir(source) [INFO] [stdout] 44 - .ok() [INFO] [stdout] 45 - .expect("Problem copying directory") [INFO] [stdout] 43 + for item in util::walk_dir(source).expect("Problem copying directory") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:47:20 [INFO] [stdout] | [INFO] [stdout] 47 | let item = item.ok().expect("Problem copying directory").path(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 47 - let item = item.ok().expect("Problem copying directory").path(); [INFO] [stdout] 47 + let item = item.expect("Problem copying directory").path(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:48:29 [INFO] [stdout] | [INFO] [stdout] 48 | let item_metadata = fs::metadata(&item) [INFO] [stdout] | _____________________________^ [INFO] [stdout] 49 | | .ok() [INFO] [stdout] 50 | | .expect("Error fetching file metadata"); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 48 - let item_metadata = fs::metadata(&item) [INFO] [stdout] 49 - .ok() [INFO] [stdout] 50 - .expect("Error fetching file metadata"); [INFO] [stdout] 48 + let item_metadata = fs::metadata(&item).expect("Error fetching file metadata"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:52:43 [INFO] [stdout] | [INFO] [stdout] 52 | let dest_path = dest.clone().join(&relative); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `relative` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | / fs::copy(&item, &dest_path) [INFO] [stdout] 55 | | .ok() [INFO] [stdout] 56 | | .expect("Problem copying directory"); [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 54 - fs::copy(&item, &dest_path) [INFO] [stdout] 55 - .ok() [INFO] [stdout] 56 - .expect("Problem copying directory"); [INFO] [stdout] 54 + fs::copy(&item, &dest_path).expect("Problem copying directory"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/dir.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | if metadata(&path) [INFO] [stdout] | ____________^ [INFO] [stdout] 19 | | .ok() [INFO] [stdout] 20 | | .expect("Error fetching metadata for file") [INFO] [stdout] | |_______________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] = note: `#[warn(clippy::ok_expect)]` on by default [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 18 - if metadata(&path) [INFO] [stdout] 19 - .ok() [INFO] [stdout] 20 - .expect("Error fetching metadata for file") [INFO] [stdout] 18 + if metadata(&path).expect("Error fetching metadata for file") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/file_type/dir.rs:18:21 [INFO] [stdout] | [INFO] [stdout] 18 | if metadata(&path) [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:58:13 [INFO] [stdout] | [INFO] [stdout] 58 | / fs::create_dir(&dest_path) [INFO] [stdout] 59 | | .ok() [INFO] [stdout] 60 | | .expect("Problem copying directory"); [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 58 - fs::create_dir(&dest_path) [INFO] [stdout] 59 - .ok() [INFO] [stdout] 60 - .expect("Problem copying directory"); [INFO] [stdout] 58 + fs::create_dir(&dest_path).expect("Problem copying directory"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:87:36 [INFO] [stdout] | [INFO] [stdout] 87 | let source_path_metadata = fs::metadata(source_path).ok().expect(&format!( [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 88 | | "Error fetching file metadata. Source path: {:?}", [INFO] [stdout] 89 | | source_path [INFO] [stdout] 90 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 87 - let source_path_metadata = fs::metadata(source_path).ok().expect(&format!( [INFO] [stdout] 87 + let source_path_metadata = fs::metadata(source_path).expect(&format!( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/main.rs:87:67 [INFO] [stdout] | [INFO] [stdout] 87 | let source_path_metadata = fs::metadata(source_path).ok().expect(&format!( [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 88 | | "Error fetching file metadata. Source path: {:?}", [INFO] [stdout] 89 | | source_path [INFO] [stdout] 90 | | )); [INFO] [stdout] | |__________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 87 ~ let source_path_metadata = fs::metadata(source_path).ok().unwrap_or_else(|| panic!("Error fetching file metadata. Source path: {:?}", [INFO] [stdout] 88 ~ source_path)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/dir.rs:36:12 [INFO] [stdout] | [INFO] [stdout] 36 | if !metadata(&header_hbs_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(&header_hbs_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: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/dir.rs:41:12 [INFO] [stdout] | [INFO] [stdout] 41 | if !metadata(&footer_hbs_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(&footer_hbs_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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/dir.rs:47:12 [INFO] [stdout] | [INFO] [stdout] 47 | if !metadata(&dir_hbs_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(&dir_hbs_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] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:92:34 [INFO] [stdout] | [INFO] [stdout] 92 | let dest_path_metadata = fs::metadata(dest_path).ok().expect(&format!( [INFO] [stdout] | __________________________________^ [INFO] [stdout] 93 | | "Error fetching file metadata. Dest path: {:?}", [INFO] [stdout] 94 | | dest_path [INFO] [stdout] 95 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 92 - let dest_path_metadata = fs::metadata(dest_path).ok().expect(&format!( [INFO] [stdout] 92 + let dest_path_metadata = fs::metadata(dest_path).expect(&format!( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/main.rs:92:63 [INFO] [stdout] | [INFO] [stdout] 92 | let dest_path_metadata = fs::metadata(dest_path).ok().expect(&format!( [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 93 | | "Error fetching file metadata. Dest path: {:?}", [INFO] [stdout] 94 | | dest_path [INFO] [stdout] 95 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 92 ~ let dest_path_metadata = fs::metadata(dest_path).ok().unwrap_or_else(|| panic!("Error fetching file metadata. Dest path: {:?}", [INFO] [stdout] 93 ~ dest_path)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:102:13 [INFO] [stdout] | [INFO] [stdout] 102 | / match fs::create_dir_all(&dest_path) { [INFO] [stdout] 103 | | Err(_) => return Err("Cannot create destination directory"), [INFO] [stdout] 104 | | _ => (), [INFO] [stdout] 105 | | } [INFO] [stdout] | |_____________^ help: try: `if let Err(_) = fs::create_dir_all(&dest_path) { return Err("Cannot create destination directory") }` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:102:38 [INFO] [stdout] | [INFO] [stdout] 102 | match fs::create_dir_all(&dest_path) { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `dest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:110:42 [INFO] [stdout] | [INFO] [stdout] 110 | let notes_source_path_metadata = fs::metadata(source_path) [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 111 | | .ok() [INFO] [stdout] 112 | | .expect("Error fetching file metadata"); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 110 - let notes_source_path_metadata = fs::metadata(source_path) [INFO] [stdout] 111 - .ok() [INFO] [stdout] 112 - .expect("Error fetching file metadata"); [INFO] [stdout] 110 + let notes_source_path_metadata = fs::metadata(source_path).expect("Error fetching file metadata"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/dir.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 59 | / app_context [INFO] [stdout] 60 | | .handlebars [INFO] [stdout] 61 | | .register_template_string( [INFO] [stdout] 62 | | dir_template_name, [INFO] [stdout] ... | [INFO] [stdout] 68 | | .ok() [INFO] [stdout] 69 | | .expect("Error registering header|dir|footer template"); [INFO] [stdout] | |___________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 67 - ) [INFO] [stdout] 68 - .ok() [INFO] [stdout] 69 - .expect("Error registering header|dir|footer template"); [INFO] [stdout] 67 + ).expect("Error registering header|dir|footer template"); [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/file_type/dir.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 85 | / match fs::read_dir(&self.path) { [INFO] [stdout] 86 | | Ok(items) => { [INFO] [stdout] 87 | | for item in items { [INFO] [stdout] 88 | | let item = item.unwrap().path(); [INFO] [stdout] ... | [INFO] [stdout] 97 | | Err(_) => (), [INFO] [stdout] 98 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 85 ~ if let Ok(items) = fs::read_dir(&self.path) { [INFO] [stdout] 86 + for item in items { [INFO] [stdout] 87 + let item = item.unwrap().path(); [INFO] [stdout] 88 + let child = self.file_type_manager.create_file_type(&item); [INFO] [stdout] 89 + result.push(Child { [INFO] [stdout] 90 + name: String::from(item.file_stem().unwrap().to_str().unwrap()), [INFO] [stdout] 91 + url: child.get_url(context), [INFO] [stdout] 92 + file_type: String::from(child.get_type_str()), [INFO] [stdout] 93 + }); [INFO] [stdout] 94 + } [INFO] [stdout] 95 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:150:43 [INFO] [stdout] | [INFO] [stdout] 150 | let assets_source_path_metadata = fs::metadata(&assets_source_path) [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 151 | | .ok() [INFO] [stdout] 152 | | .expect("Error fetching file metadata"); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 150 - let assets_source_path_metadata = fs::metadata(&assets_source_path) [INFO] [stdout] 151 - .ok() [INFO] [stdout] 152 - .expect("Error fetching file metadata"); [INFO] [stdout] 150 + let assets_source_path_metadata = fs::metadata(&assets_source_path).expect("Error fetching file metadata"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/file_type/dir.rs:100:9 [INFO] [stdout] | [INFO] [stdout] 100 | (&mut result).sort_by(|a, b| { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `result` [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: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:166:34 [INFO] [stdout] | [INFO] [stdout] 166 | let entry_metadata = fs::metadata(entry.path()) [INFO] [stdout] | __________________________________^ [INFO] [stdout] 167 | | .ok() [INFO] [stdout] 168 | | .expect("Error fetching file metadata"); [INFO] [stdout] | |_______________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 166 - let entry_metadata = fs::metadata(entry.path()) [INFO] [stdout] 167 - .ok() [INFO] [stdout] 168 - .expect("Error fetching file metadata"); [INFO] [stdout] 166 + let entry_metadata = fs::metadata(entry.path()).expect("Error fetching file metadata"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:170:17 [INFO] [stdout] | [INFO] [stdout] 170 | / fs::remove_file(entry.path()) [INFO] [stdout] 171 | | .ok() [INFO] [stdout] 172 | | .expect("Could not remove file"); [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 170 - fs::remove_file(entry.path()) [INFO] [stdout] 171 - .ok() [INFO] [stdout] 172 - .expect("Could not remove file"); [INFO] [stdout] 170 + fs::remove_file(entry.path()).expect("Could not remove file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/file_type/dir.rs:101:31 [INFO] [stdout] | [INFO] [stdout] 101 | if a.file_type == String::from(TYPE_STR) && b.file_type != String::from(TYPE_STR) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `TYPE_STR` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/file_type/dir.rs:101:72 [INFO] [stdout] | [INFO] [stdout] 101 | if a.file_type == String::from(TYPE_STR) && b.file_type != String::from(TYPE_STR) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `TYPE_STR` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/file_type/dir.rs:103:38 [INFO] [stdout] | [INFO] [stdout] 103 | } else if a.file_type != String::from(TYPE_STR) && b.file_type == String::from(TYPE_STR) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `TYPE_STR` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/file_type/dir.rs:103:79 [INFO] [stdout] | [INFO] [stdout] 103 | } else if a.file_type != String::from(TYPE_STR) && b.file_type == String::from(TYPE_STR) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `TYPE_STR` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:174:17 [INFO] [stdout] | [INFO] [stdout] 174 | / fs::remove_dir_all(entry.path()) [INFO] [stdout] 175 | | .ok() [INFO] [stdout] 176 | | .expect("Could not remove directory"); [INFO] [stdout] | |_________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 174 - fs::remove_dir_all(entry.path()) [INFO] [stdout] 175 - .ok() [INFO] [stdout] 176 - .expect("Could not remove directory"); [INFO] [stdout] 174 + fs::remove_dir_all(entry.path()).expect("Could not remove directory"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/dir.rs:136:12 [INFO] [stdout] | [INFO] [stdout] 136 | if !metadata(&new_dir).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(&new_dir).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] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/file_type/dir.rs:134:46 [INFO] [stdout] | [INFO] [stdout] 134 | let new_dir = context.root_dest.join(&relative); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `relative` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/dir.rs:137:13 [INFO] [stdout] | [INFO] [stdout] 137 | / fs::create_dir(&new_dir) [INFO] [stdout] 138 | | .ok() [INFO] [stdout] 139 | | .expect("Cannot create destination subdir"); [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 137 - fs::create_dir(&new_dir) [INFO] [stdout] 138 - .ok() [INFO] [stdout] 139 - .expect("Cannot create destination subdir"); [INFO] [stdout] 137 + fs::create_dir(&new_dir).expect("Cannot create destination subdir"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/file_type/dir.rs:146:62 [INFO] [stdout] | [INFO] [stdout] 146 | let parents = create_parent_links(&context.base_url, &relative, true); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `relative` [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 `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/dir.rs:156:32 [INFO] [stdout] | [INFO] [stdout] 156 | let mut file = File::create(&new_dir_index) [INFO] [stdout] | ________________________________^ [INFO] [stdout] 157 | | .ok() [INFO] [stdout] 158 | | .expect("Could not create dir index.html file"); [INFO] [stdout] | |___________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 156 - let mut file = File::create(&new_dir_index) [INFO] [stdout] 157 - .ok() [INFO] [stdout] 158 - .expect("Could not create dir index.html file"); [INFO] [stdout] 156 + let mut file = File::create(&new_dir_index).expect("Could not create dir index.html file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/dir.rs:160:17 [INFO] [stdout] | [INFO] [stdout] 160 | / file.write_all(rendered.as_bytes()) [INFO] [stdout] 161 | | .ok() [INFO] [stdout] 162 | | .expect("Could not write html to file"); [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 160 - file.write_all(rendered.as_bytes()) [INFO] [stdout] 161 - .ok() [INFO] [stdout] 162 - .expect("Could not write html to file"); [INFO] [stdout] 160 + file.write_all(rendered.as_bytes()).expect("Could not write html to file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/markdown.rs:20:29 [INFO] [stdout] | [INFO] [stdout] 20 | let path_metadata = metadata(&path).ok().expect("Could not fetch file metadata"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 20 - let path_metadata = metadata(&path).ok().expect("Could not fetch file metadata"); [INFO] [stdout] 20 + let path_metadata = metadata(&path).expect("Could not fetch file metadata"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/file_type/markdown.rs:20:38 [INFO] [stdout] | [INFO] [stdout] 20 | let path_metadata = metadata(&path).ok().expect("Could not fetch file metadata"); [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/markdown.rs:36:12 [INFO] [stdout] | [INFO] [stdout] 36 | if !metadata(&header_hbs_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(&header_hbs_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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/markdown.rs:41:12 [INFO] [stdout] | [INFO] [stdout] 41 | if !metadata(&footer_hbs_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(&footer_hbs_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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/file_type/markdown.rs:46:12 [INFO] [stdout] | [INFO] [stdout] 46 | if !metadata(¬e_hbs_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `metadata(¬e_hbs_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] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/main.rs:52:29 [INFO] [stdout] | [INFO] [stdout] 52 | let dest_path = dest.clone().join(&relative); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::path::Path` does not implement `Clone`, so calling `clone` on `&std::path::Path` copies the reference, which does not do anything and can be removed [INFO] [stdout] = note: `#[warn(noop_method_call)]` on by default [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 52 - let dest_path = dest.clone().join(&relative); [INFO] [stdout] 52 + let dest_path = dest.join(&relative); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/file_type/mod.rs:73:42 [INFO] [stdout] | [INFO] [stdout] 73 | let mut temp = PathBuf::from(path.clone().parent().unwrap()); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::path::Path` does not implement `Clone`, so calling `clone` on `&std::path::Path` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 73 - let mut temp = PathBuf::from(path.clone().parent().unwrap()); [INFO] [stdout] 73 + let mut temp = PathBuf::from(path.parent().unwrap()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/markdown.rs:53:9 [INFO] [stdout] | [INFO] [stdout] 53 | / app_context [INFO] [stdout] 54 | | .handlebars [INFO] [stdout] 55 | | .register_template_string( [INFO] [stdout] 56 | | TYPE_STR, [INFO] [stdout] ... | [INFO] [stdout] 62 | | .ok() [INFO] [stdout] 63 | | .expect("Error registering header|note|footer template"); [INFO] [stdout] | |____________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 61 - ) [INFO] [stdout] 62 - .ok() [INFO] [stdout] 63 - .expect("Error registering header|note|footer template"); [INFO] [stdout] 61 + ).expect("Error registering header|note|footer template"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: eliding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> src/util.rs:53:87 [INFO] [stdout] | [INFO] [stdout] 53 | fn my_relative_from<'a, P: ?Sized + AsRef>(&'a self, base: &'a P) -> Option<&Path>; [INFO] [stdout] | -- -- ^^^^^ the same lifetime is elided here [INFO] [stdout] | | | [INFO] [stdout] | | the lifetime is named here [INFO] [stdout] | the lifetime is named here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 53 | fn my_relative_from<'a, P: ?Sized + AsRef>(&'a self, base: &'a P) -> Option<&'a Path>; [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: eliding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> src/util.rs:57:87 [INFO] [stdout] | [INFO] [stdout] 57 | fn my_relative_from<'a, P: ?Sized + AsRef>(&'a self, base: &'a P) -> Option<&Path> { [INFO] [stdout] | -- -- ^^^^^ the same lifetime is elided here [INFO] [stdout] | | | [INFO] [stdout] | | the lifetime is named here [INFO] [stdout] | the lifetime is named here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 57 | fn my_relative_from<'a, P: ?Sized + AsRef>(&'a self, base: &'a P) -> Option<&'a Path> { [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> src/file_type/markdown.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 89 | / format!( [INFO] [stdout] 90 | | "{}{}{}", [INFO] [stdout] 91 | | context.base_url, [INFO] [stdout] 92 | | parent_relative, [INFO] [stdout] 93 | | format!("{}.html", file_name) [INFO] [stdout] 94 | | ) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/markdown.rs:109:9 [INFO] [stdout] | [INFO] [stdout] 109 | / File::open(&self.path) [INFO] [stdout] 110 | | .ok() [INFO] [stdout] 111 | | .unwrap() [INFO] [stdout] 112 | | .read_to_string(&mut source_contents) [INFO] [stdout] 113 | | .ok() [INFO] [stdout] 114 | | .expect("Could not read markdown file"); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 112 - .read_to_string(&mut source_contents) [INFO] [stdout] 113 - .ok() [INFO] [stdout] 114 - .expect("Could not read markdown file"); [INFO] [stdout] 112 + .read_to_string(&mut source_contents).expect("Could not read markdown file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/file_type/markdown.rs:117:62 [INFO] [stdout] | [INFO] [stdout] 117 | let parents = create_parent_links(&context.base_url, &relative, false); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `relative` [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 use of `format!` [INFO] [stdout] --> src/file_type/markdown.rs:122:22 [INFO] [stdout] | [INFO] [stdout] 122 | content: format!("{}", content), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `content.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: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/markdown.rs:128:32 [INFO] [stdout] | [INFO] [stdout] 128 | let mut file = File::create(&dest_file) [INFO] [stdout] | ________________________________^ [INFO] [stdout] 129 | | .ok() [INFO] [stdout] 130 | | .expect("Could not create markdown html file"); [INFO] [stdout] | |__________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 128 - let mut file = File::create(&dest_file) [INFO] [stdout] 129 - .ok() [INFO] [stdout] 130 - .expect("Could not create markdown html file"); [INFO] [stdout] 128 + let mut file = File::create(&dest_file).expect("Could not create markdown html file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/markdown.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | / file.write_all(rendered.as_bytes()) [INFO] [stdout] 133 | | .ok() [INFO] [stdout] 134 | | .expect("Could not write html to file"); [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 132 - file.write_all(rendered.as_bytes()) [INFO] [stdout] 133 - .ok() [INFO] [stdout] 134 - .expect("Could not write html to file"); [INFO] [stdout] 132 + file.write_all(rendered.as_bytes()).expect("Could not write html to file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/file_type/markdown.rs:161:25 [INFO] [stdout] | [INFO] [stdout] 161 | let p = Parser::new(&text); [INFO] [stdout] | ^^^^^ help: change this to: `text` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/file_type/unknown.rs:55:50 [INFO] [stdout] | [INFO] [stdout] 55 | let destination = context.root_dest.join(&relative); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `relative` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/file_type/unknown.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | / fs::copy(&self.path, &destination) [INFO] [stdout] 57 | | .ok() [INFO] [stdout] 58 | | .expect("Problem copying unknown file"); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 56 - fs::copy(&self.path, &destination) [INFO] [stdout] 57 - .ok() [INFO] [stdout] 58 - .expect("Problem copying unknown file"); [INFO] [stdout] 56 + fs::copy(&self.path, &destination).expect("Problem copying unknown file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `result_maybe` after checking its variant with `is_some` [INFO] [stdout] --> src/file_type/mod.rs:52:24 [INFO] [stdout] | [INFO] [stdout] 51 | if result_maybe.is_some() { [INFO] [stdout] | ------------------------- help: try: `if let Some() = result_maybe` [INFO] [stdout] 52 | return result_maybe.unwrap(); [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: useless use of `format!` [INFO] [stdout] --> src/file_type/mod.rs:71:18 [INFO] [stdout] | [INFO] [stdout] 71 | url: format!("{}", base_url), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `base_url.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: the borrowed expression implements the required traits [INFO] [stdout] --> src/file_type/mod.rs:92:37 [INFO] [stdout] | [INFO] [stdout] 92 | let mut file = match File::open(&path) { [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [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/file_type/mod.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | / match file.read_to_string(&mut contents) { [INFO] [stdout] 98 | | Err(_) => return Err("Could not read file."), [INFO] [stdout] 99 | | _ => (), [INFO] [stdout] 100 | | } [INFO] [stdout] | |_____^ help: try: `if let Err(_) = file.read_to_string(&mut contents) { return Err("Could not read file.") }` [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 `ok().expect()` on a `Result` value [INFO] [stdout] --> src/util.rs:30:45 [INFO] [stdout] | [INFO] [stdout] 30 | let path_metadata = fs::metadata(&path) [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 31 | | .ok() [INFO] [stdout] 32 | | .expect("Error fetching metadata for file"); [INFO] [stdout] | |_______________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 30 - let path_metadata = fs::metadata(&path) [INFO] [stdout] 31 - .ok() [INFO] [stdout] 32 - .expect("Error fetching metadata for file"); [INFO] [stdout] 30 + let path_metadata = fs::metadata(&path).expect("Error fetching metadata for file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | / fs::create_dir(dest) [INFO] [stdout] 41 | | .ok() [INFO] [stdout] 42 | | .expect("Problem copying directory"); [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 40 - fs::create_dir(dest) [INFO] [stdout] 41 - .ok() [INFO] [stdout] 42 - .expect("Problem copying directory"); [INFO] [stdout] 40 + fs::create_dir(dest).expect("Problem copying directory"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:43:17 [INFO] [stdout] | [INFO] [stdout] 43 | for item in util::walk_dir(source) [INFO] [stdout] | _________________^ [INFO] [stdout] 44 | | .ok() [INFO] [stdout] 45 | | .expect("Problem copying directory") [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 43 - for item in util::walk_dir(source) [INFO] [stdout] 44 - .ok() [INFO] [stdout] 45 - .expect("Problem copying directory") [INFO] [stdout] 43 + for item in util::walk_dir(source).expect("Problem copying directory") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:47:20 [INFO] [stdout] | [INFO] [stdout] 47 | let item = item.ok().expect("Problem copying directory").path(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 47 - let item = item.ok().expect("Problem copying directory").path(); [INFO] [stdout] 47 + let item = item.expect("Problem copying directory").path(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:48:29 [INFO] [stdout] | [INFO] [stdout] 48 | let item_metadata = fs::metadata(&item) [INFO] [stdout] | _____________________________^ [INFO] [stdout] 49 | | .ok() [INFO] [stdout] 50 | | .expect("Error fetching file metadata"); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 48 - let item_metadata = fs::metadata(&item) [INFO] [stdout] 49 - .ok() [INFO] [stdout] 50 - .expect("Error fetching file metadata"); [INFO] [stdout] 48 + let item_metadata = fs::metadata(&item).expect("Error fetching file metadata"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:52:43 [INFO] [stdout] | [INFO] [stdout] 52 | let dest_path = dest.clone().join(&relative); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `relative` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | / fs::copy(&item, &dest_path) [INFO] [stdout] 55 | | .ok() [INFO] [stdout] 56 | | .expect("Problem copying directory"); [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 54 - fs::copy(&item, &dest_path) [INFO] [stdout] 55 - .ok() [INFO] [stdout] 56 - .expect("Problem copying directory"); [INFO] [stdout] 54 + fs::copy(&item, &dest_path).expect("Problem copying directory"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:58:13 [INFO] [stdout] | [INFO] [stdout] 58 | / fs::create_dir(&dest_path) [INFO] [stdout] 59 | | .ok() [INFO] [stdout] 60 | | .expect("Problem copying directory"); [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 58 - fs::create_dir(&dest_path) [INFO] [stdout] 59 - .ok() [INFO] [stdout] 60 - .expect("Problem copying directory"); [INFO] [stdout] 58 + fs::create_dir(&dest_path).expect("Problem copying directory"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:87:36 [INFO] [stdout] | [INFO] [stdout] 87 | let source_path_metadata = fs::metadata(source_path).ok().expect(&format!( [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 88 | | "Error fetching file metadata. Source path: {:?}", [INFO] [stdout] 89 | | source_path [INFO] [stdout] 90 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 87 - let source_path_metadata = fs::metadata(source_path).ok().expect(&format!( [INFO] [stdout] 87 + let source_path_metadata = fs::metadata(source_path).expect(&format!( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/main.rs:87:67 [INFO] [stdout] | [INFO] [stdout] 87 | let source_path_metadata = fs::metadata(source_path).ok().expect(&format!( [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 88 | | "Error fetching file metadata. Source path: {:?}", [INFO] [stdout] 89 | | source_path [INFO] [stdout] 90 | | )); [INFO] [stdout] | |__________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 87 ~ let source_path_metadata = fs::metadata(source_path).ok().unwrap_or_else(|| panic!("Error fetching file metadata. Source path: {:?}", [INFO] [stdout] 88 ~ source_path)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:92:34 [INFO] [stdout] | [INFO] [stdout] 92 | let dest_path_metadata = fs::metadata(dest_path).ok().expect(&format!( [INFO] [stdout] | __________________________________^ [INFO] [stdout] 93 | | "Error fetching file metadata. Dest path: {:?}", [INFO] [stdout] 94 | | dest_path [INFO] [stdout] 95 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 92 - let dest_path_metadata = fs::metadata(dest_path).ok().expect(&format!( [INFO] [stdout] 92 + let dest_path_metadata = fs::metadata(dest_path).expect(&format!( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/main.rs:92:63 [INFO] [stdout] | [INFO] [stdout] 92 | let dest_path_metadata = fs::metadata(dest_path).ok().expect(&format!( [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 93 | | "Error fetching file metadata. Dest path: {:?}", [INFO] [stdout] 94 | | dest_path [INFO] [stdout] 95 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 92 ~ let dest_path_metadata = fs::metadata(dest_path).ok().unwrap_or_else(|| panic!("Error fetching file metadata. Dest path: {:?}", [INFO] [stdout] 93 ~ dest_path)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:102:13 [INFO] [stdout] | [INFO] [stdout] 102 | / match fs::create_dir_all(&dest_path) { [INFO] [stdout] 103 | | Err(_) => return Err("Cannot create destination directory"), [INFO] [stdout] 104 | | _ => (), [INFO] [stdout] 105 | | } [INFO] [stdout] | |_____________^ help: try: `if let Err(_) = fs::create_dir_all(&dest_path) { return Err("Cannot create destination directory") }` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:102:38 [INFO] [stdout] | [INFO] [stdout] 102 | match fs::create_dir_all(&dest_path) { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `dest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:110:42 [INFO] [stdout] | [INFO] [stdout] 110 | let notes_source_path_metadata = fs::metadata(source_path) [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 111 | | .ok() [INFO] [stdout] 112 | | .expect("Error fetching file metadata"); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 110 - let notes_source_path_metadata = fs::metadata(source_path) [INFO] [stdout] 111 - .ok() [INFO] [stdout] 112 - .expect("Error fetching file metadata"); [INFO] [stdout] 110 + let notes_source_path_metadata = fs::metadata(source_path).expect("Error fetching file metadata"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:150:43 [INFO] [stdout] | [INFO] [stdout] 150 | let assets_source_path_metadata = fs::metadata(&assets_source_path) [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 151 | | .ok() [INFO] [stdout] 152 | | .expect("Error fetching file metadata"); [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 150 - let assets_source_path_metadata = fs::metadata(&assets_source_path) [INFO] [stdout] 151 - .ok() [INFO] [stdout] 152 - .expect("Error fetching file metadata"); [INFO] [stdout] 150 + let assets_source_path_metadata = fs::metadata(&assets_source_path).expect("Error fetching file metadata"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:166:34 [INFO] [stdout] | [INFO] [stdout] 166 | let entry_metadata = fs::metadata(entry.path()) [INFO] [stdout] | __________________________________^ [INFO] [stdout] 167 | | .ok() [INFO] [stdout] 168 | | .expect("Error fetching file metadata"); [INFO] [stdout] | |_______________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 166 - let entry_metadata = fs::metadata(entry.path()) [INFO] [stdout] 167 - .ok() [INFO] [stdout] 168 - .expect("Error fetching file metadata"); [INFO] [stdout] 166 + let entry_metadata = fs::metadata(entry.path()).expect("Error fetching file metadata"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:170:17 [INFO] [stdout] | [INFO] [stdout] 170 | / fs::remove_file(entry.path()) [INFO] [stdout] 171 | | .ok() [INFO] [stdout] 172 | | .expect("Could not remove file"); [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 170 - fs::remove_file(entry.path()) [INFO] [stdout] 171 - .ok() [INFO] [stdout] 172 - .expect("Could not remove file"); [INFO] [stdout] 170 + fs::remove_file(entry.path()).expect("Could not remove file"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:174:17 [INFO] [stdout] | [INFO] [stdout] 174 | / fs::remove_dir_all(entry.path()) [INFO] [stdout] 175 | | .ok() [INFO] [stdout] 176 | | .expect("Could not remove directory"); [INFO] [stdout] | |_________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 174 - fs::remove_dir_all(entry.path()) [INFO] [stdout] 175 - .ok() [INFO] [stdout] 176 - .expect("Could not remove directory"); [INFO] [stdout] 174 + fs::remove_dir_all(entry.path()).expect("Could not remove directory"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/main.rs:52:29 [INFO] [stdout] | [INFO] [stdout] 52 | let dest_path = dest.clone().join(&relative); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::path::Path` does not implement `Clone`, so calling `clone` on `&std::path::Path` copies the reference, which does not do anything and can be removed [INFO] [stdout] = note: `#[warn(noop_method_call)]` on by default [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 52 - let dest_path = dest.clone().join(&relative); [INFO] [stdout] 52 + let dest_path = dest.join(&relative); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/file_type/mod.rs:73:42 [INFO] [stdout] | [INFO] [stdout] 73 | let mut temp = PathBuf::from(path.clone().parent().unwrap()); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the type `std::path::Path` does not implement `Clone`, so calling `clone` on `&std::path::Path` copies the reference, which does not do anything and can be removed [INFO] [stdout] help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] 73 - let mut temp = PathBuf::from(path.clone().parent().unwrap()); [INFO] [stdout] 73 + let mut temp = PathBuf::from(path.parent().unwrap()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: eliding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> src/util.rs:53:87 [INFO] [stdout] | [INFO] [stdout] 53 | fn my_relative_from<'a, P: ?Sized + AsRef>(&'a self, base: &'a P) -> Option<&Path>; [INFO] [stdout] | -- -- ^^^^^ the same lifetime is elided here [INFO] [stdout] | | | [INFO] [stdout] | | the lifetime is named here [INFO] [stdout] | the lifetime is named here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 53 | fn my_relative_from<'a, P: ?Sized + AsRef>(&'a self, base: &'a P) -> Option<&'a Path>; [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: eliding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> src/util.rs:57:87 [INFO] [stdout] | [INFO] [stdout] 57 | fn my_relative_from<'a, P: ?Sized + AsRef>(&'a self, base: &'a P) -> Option<&Path> { [INFO] [stdout] | -- -- ^^^^^ the same lifetime is elided here [INFO] [stdout] | | | [INFO] [stdout] | | the lifetime is named here [INFO] [stdout] | the lifetime is named here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 57 | fn my_relative_from<'a, P: ?Sized + AsRef>(&'a self, base: &'a P) -> Option<&'a Path> { [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 13.27s [INFO] running `Command { std: "docker" "inspect" "7451e3134700e1d8f5b2ee74a53df6e0283f2dbcd33854b5533ee6b4b0de6259", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7451e3134700e1d8f5b2ee74a53df6e0283f2dbcd33854b5533ee6b4b0de6259", kill_on_drop: false }` [INFO] [stdout] 7451e3134700e1d8f5b2ee74a53df6e0283f2dbcd33854b5533ee6b4b0de6259