[INFO] fetching crate rusty-notes 1.4.0... [INFO] linting rusty-notes-1.4.0 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate rusty-notes 1.4.0 into /workspace/builds/worker-1-tc1/source [INFO] started tweaking crates.io crate rusty-notes 1.4.0 [INFO] finished tweaking crates.io crate rusty-notes 1.4.0 [INFO] tweaked toml for crates.io crate rusty-notes 1.4.0 written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate rusty-notes 1.4.0 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 crates.io crate rusty-notes 1.4.0 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded pest_derive v2.7.13 [INFO] [stderr] Downloaded ttl_cache v0.5.1 [INFO] [stderr] Downloaded onig v6.4.0 [INFO] [stderr] Downloaded pest_generator v2.7.13 [INFO] [stderr] Downloaded actix-service v2.0.2 [INFO] [stderr] Downloaded http-range v0.1.5 [INFO] [stderr] Downloaded v_htmlescape v0.15.8 [INFO] [stderr] Downloaded actix-rt v2.10.0 [INFO] [stderr] Downloaded pest_meta v2.7.13 [INFO] [stderr] Downloaded actix-files v0.6.6 [INFO] [stderr] Downloaded anyhow v1.0.89 [INFO] [stderr] Downloaded actix-session v0.9.0 [INFO] [stderr] Downloaded actix-server v2.5.0 [INFO] [stderr] Downloaded comrak v0.21.0 [INFO] [stderr] Downloaded pest v2.7.13 [INFO] [stderr] Downloaded clap v4.5.18 [INFO] [stderr] Downloaded actix-http v3.9.0 [INFO] [stderr] Downloaded clap_builder v4.5.18 [INFO] [stderr] Downloaded addr2line v0.24.1 [INFO] [stderr] Downloaded bytestring v1.3.1 [INFO] [stderr] Downloaded actix-web v4.9.0 [INFO] [stderr] Downloaded impl-more v0.1.6 [INFO] [stderr] Downloaded gimli v0.31.0 [INFO] [stderr] Downloaded bstr v1.10.0 [INFO] [stderr] Downloaded onig_sys v69.8.1 [INFO] [stderr] Downloaded brotli v6.0.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] f7a7ed9b62e55d36a791ce6d369a8825f8eb4a81aafc9ac551542c056a64e3d0 [INFO] running `Command { std: "docker" "start" "-a" "f7a7ed9b62e55d36a791ce6d369a8825f8eb4a81aafc9ac551542c056a64e3d0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "f7a7ed9b62e55d36a791ce6d369a8825f8eb4a81aafc9ac551542c056a64e3d0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "f7a7ed9b62e55d36a791ce6d369a8825f8eb4a81aafc9ac551542c056a64e3d0", kill_on_drop: false }` [INFO] [stdout] f7a7ed9b62e55d36a791ce6d369a8825f8eb4a81aafc9ac551542c056a64e3d0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 994f76a43462c455c45fc6ec82e4b3bea06f21c4ae8ad27f9047dbebcf5691c6 [INFO] running `Command { std: "docker" "start" "-a" "994f76a43462c455c45fc6ec82e4b3bea06f21c4ae8ad27f9047dbebcf5691c6", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.86 [INFO] [stderr] Compiling serde v1.0.210 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Checking generic-array v0.14.7 [INFO] [stderr] Compiling jobserver v0.1.32 [INFO] [stderr] Compiling lock_api v0.4.12 [INFO] [stderr] Compiling pkg-config v0.3.30 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking parking_lot_core v0.9.10 [INFO] [stderr] Checking futures-core v0.3.30 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Compiling cc v1.1.21 [INFO] [stderr] Checking parking_lot v0.12.3 [INFO] [stderr] Compiling quote v1.0.37 [INFO] [stderr] Checking futures-sink v0.3.30 [INFO] [stderr] Checking bytes v1.7.2 [INFO] [stderr] Checking crypto-common v0.1.6 [INFO] [stderr] Compiling slab v0.4.9 [INFO] [stderr] Checking cpufeatures v0.2.14 [INFO] [stderr] Checking block-buffer v0.10.4 [INFO] [stderr] Checking socket2 v0.5.7 [INFO] [stderr] Checking mio v1.0.2 [INFO] [stderr] Checking signal-hook-registry v1.4.2 [INFO] [stderr] Compiling syn v2.0.77 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking futures-channel v0.3.30 [INFO] [stderr] Checking tracing-core v0.1.32 [INFO] [stderr] Checking tokio v1.40.0 [INFO] [stderr] Checking futures-task v0.3.30 [INFO] [stderr] Checking futures-io v0.3.30 [INFO] [stderr] Checking indexmap v2.5.0 [INFO] [stderr] Compiling time-macros v0.2.18 [INFO] [stderr] Checking tracing v0.1.40 [INFO] [stderr] Checking regex-automata v0.4.7 [INFO] [stderr] Checking inout v0.1.3 [INFO] [stderr] Checking miniz_oxide v0.8.0 [INFO] [stderr] Checking cipher v0.4.4 [INFO] [stderr] Checking universal-hash v0.5.1 [INFO] [stderr] Compiling zstd-sys v2.0.13+zstd.1.5.6 [INFO] [stderr] Compiling unicase v2.7.0 [INFO] [stderr] Compiling zstd-safe v7.2.1 [INFO] [stderr] Checking polyval v0.6.2 [INFO] [stderr] Checking flate2 v1.0.33 [INFO] [stderr] Checking http v0.2.12 [INFO] [stderr] Checking time v0.3.36 [INFO] [stderr] Checking phf_shared v0.10.0 [INFO] [stderr] Compiling rustix v0.38.37 [INFO] [stderr] Compiling httparse v1.9.4 [INFO] [stderr] Compiling log v0.4.22 [INFO] [stderr] Checking regex v1.10.6 [INFO] [stderr] Compiling bytestring v1.3.1 [INFO] [stderr] Checking anstyle-parse v0.2.5 [INFO] [stderr] Checking actix-service v2.0.2 [INFO] [stderr] Checking ghash v0.5.1 [INFO] [stderr] Checking brotli-decompressor v4.0.1 [INFO] [stderr] Checking actix-utils v3.0.1 [INFO] [stderr] Checking ctr v0.9.2 [INFO] [stderr] Checking aes v0.8.4 [INFO] [stderr] Compiling onig_sys v69.8.1 [INFO] [stderr] Checking hmac v0.12.1 [INFO] [stderr] Checking aead v0.5.2 [INFO] [stderr] Compiling cookie v0.16.2 [INFO] [stderr] Compiling darling_core v0.14.4 [INFO] [stderr] Compiling ucd-trie v0.1.6 [INFO] [stderr] Checking tokio-util v0.7.12 [INFO] [stderr] Checking actix-rt v2.10.0 [INFO] [stderr] Compiling regex-lite v0.1.6 [INFO] [stderr] Checking unicode-bidi v0.3.15 [INFO] [stderr] Checking anstyle-query v1.1.1 [INFO] [stderr] Checking anstyle v1.0.8 [INFO] [stderr] Checking colorchoice v1.0.2 [INFO] [stderr] Checking actix-codec v0.5.2 [INFO] [stderr] Checking anstream v0.6.15 [INFO] [stderr] Checking brotli v6.0.0 [INFO] [stderr] Checking idna v0.5.0 [INFO] [stderr] Compiling actix-router v0.5.3 [INFO] [stderr] Checking aes-gcm v0.10.3 [INFO] [stderr] Checking hkdf v0.12.4 [INFO] [stderr] Checking crossbeam-epoch v0.9.18 [INFO] [stderr] Checking phf v0.10.1 [INFO] [stderr] Compiling zerocopy-derive v0.7.35 [INFO] [stderr] Compiling serde_derive v1.0.210 [INFO] [stderr] Compiling thiserror-impl v1.0.63 [INFO] [stderr] Compiling futures-macro v0.3.30 [INFO] [stderr] Compiling zerocopy v0.7.35 [INFO] [stderr] Checking futures-util v0.3.30 [INFO] [stderr] Compiling derive_more v0.99.18 [INFO] [stderr] Compiling ppv-lite86 v0.2.20 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking ahash v0.8.11 [INFO] [stderr] Compiling thiserror v1.0.63 [INFO] [stderr] Compiling darling_macro v0.14.4 [INFO] [stderr] Compiling pest v2.7.13 [INFO] [stderr] Compiling darling v0.14.4 [INFO] [stderr] Checking local-channel v0.1.5 [INFO] [stderr] Checking sha2 v0.10.8 [INFO] [stderr] Compiling phf_generator v0.10.0 [INFO] [stderr] Compiling phf_codegen v0.10.0 [INFO] [stderr] Compiling string_cache_codegen v0.5.2 [INFO] [stderr] Compiling phf_generator v0.11.2 [INFO] [stderr] Compiling phf_macros v0.11.2 [INFO] [stderr] Compiling markup5ever v0.11.0 [INFO] [stderr] Checking h2 v0.3.26 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Checking phf_shared v0.11.2 [INFO] [stderr] Checking encoding_rs v0.8.34 [INFO] [stderr] Checking bstr v1.10.0 [INFO] [stderr] Checking unic-char-range v0.9.0 [INFO] [stderr] Checking unic-common v0.9.0 [INFO] [stderr] Checking dtoa v1.0.9 [INFO] [stderr] Checking base64 v0.20.0 [INFO] [stderr] Checking dtoa-short v0.3.5 [INFO] [stderr] Checking unic-char-property v0.9.0 [INFO] [stderr] Compiling pest_meta v2.7.13 [INFO] [stderr] Checking globset v0.4.15 [INFO] [stderr] Checking unic-ucd-version v0.9.0 [INFO] [stderr] Checking phf v0.11.2 [INFO] [stderr] Compiling proc-macro2-diagnostics v0.10.1 [INFO] [stderr] Checking actix-server v2.5.0 [INFO] [stderr] Compiling selectors v0.25.0 [INFO] [stderr] Compiling mime_guess v2.0.5 [INFO] [stderr] Compiling derive_builder_core v0.12.0 [INFO] [stderr] Compiling html5ever v0.26.0 [INFO] [stderr] Compiling actix-web-codegen v4.3.0 [INFO] [stderr] Compiling actix-macros v0.2.4 [INFO] [stderr] Compiling cssparser-macros v0.6.1 [INFO] [stderr] Checking serde_json v1.0.128 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking string_cache v0.8.7 [INFO] [stderr] Checking crossbeam-deque v0.8.5 [INFO] [stderr] Checking terminal_size v0.3.0 [INFO] [stderr] Checking url v2.5.2 [INFO] [stderr] Compiling uncased v0.9.10 [INFO] [stderr] Checking quick-xml v0.32.0 [INFO] [stderr] Compiling anyhow v1.0.89 [INFO] [stderr] Checking impl-more v0.1.6 [INFO] [stderr] Compiling v_htmlescape v0.15.8 [INFO] [stderr] Checking clap_builder v4.5.18 [INFO] [stderr] Checking onig v6.4.0 [INFO] [stderr] Checking servo_arc v0.3.0 [INFO] [stderr] Compiling clap_derive v4.5.18 [INFO] [stderr] Checking ignore v0.4.23 [INFO] [stderr] Checking plist v1.7.0 [INFO] [stderr] Compiling derive_builder_macro v0.12.0 [INFO] [stderr] Checking cssparser v0.31.2 [INFO] [stderr] Checking bincode v1.3.3 [INFO] [stderr] Compiling pest_generator v2.7.13 [INFO] [stderr] Compiling pear_codegen v0.2.9 [INFO] [stderr] Checking unic-ucd-segment v0.9.0 [INFO] [stderr] Compiling figment v0.10.19 [INFO] [stderr] Checking deunicode v1.6.0 [INFO] [stderr] Checking getopts v0.2.21 [INFO] [stderr] Checking pear v0.2.9 [INFO] [stderr] Checking slug v0.1.6 [INFO] [stderr] Checking unic-segment v0.9.0 [INFO] [stderr] Compiling pest_derive v2.7.13 [INFO] [stderr] Checking syntect v5.2.0 [INFO] [stderr] Checking clap v4.5.18 [INFO] [stderr] Checking derive_builder v0.12.0 [INFO] [stderr] Checking globwalk v0.9.1 [INFO] [stderr] Checking futures-executor v0.3.30 [INFO] [stderr] Checking env_filter v0.1.2 [INFO] [stderr] Checking xdg v2.5.2 [INFO] [stderr] Checking humantime v2.1.0 [INFO] [stderr] Checking ego-tree v0.6.3 [INFO] [stderr] Checking http-range v0.1.5 [INFO] [stderr] Checking typed-arena v2.0.2 [INFO] [stderr] Checking entities v1.0.1 [INFO] [stderr] Checking futures v0.3.30 [INFO] [stderr] Checking env_logger v0.11.5 [INFO] [stderr] Checking ttl_cache v0.5.1 [INFO] [stderr] Checking dotenv v0.15.0 [INFO] [stderr] Checking scraper v0.18.1 [INFO] [stderr] Checking htmlescape v0.3.1 [INFO] [stderr] Checking tera v1.20.0 [INFO] [stderr] Checking zstd v0.13.2 [INFO] [stderr] Checking actix-http v3.9.0 [INFO] [stderr] Checking comrak v0.21.0 [INFO] [stderr] Checking actix-web v4.9.0 [INFO] [stderr] Checking actix-files v0.6.6 [INFO] [stderr] Checking actix-session v0.9.0 [INFO] [stderr] Checking rusty-notes v1.4.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/config.rs:31:30 [INFO] [stdout] | [INFO] [stdout] 31 | rusty_dir_notes: dir_notes.into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `dir_notes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/config.rs:32:34 [INFO] [stdout] | [INFO] [stdout] 32 | rusty_dir_templates: dir_templates.into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `dir_templates` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/config.rs:39:26 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn from_env() -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 208 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `figment::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] = note: `#[warn(clippy::result_large_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/notes/web.rs:32:21 [INFO] [stdout] | [INFO] [stdout] 32 | let dir_notes = dir_notes.to_string_lossy().to_owned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] = note: `#[warn(clippy::suspicious_to_owned)]` on by default [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 32 | let dir_notes = dir_notes.to_string_lossy().into_owned(); [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 32 - let dir_notes = dir_notes.to_string_lossy().to_owned(); [INFO] [stdout] 32 + let dir_notes = dir_notes.to_string_lossy().clone(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/notes/web.rs:97:16 [INFO] [stdout] | [INFO] [stdout] 97 | let doc_ = doc_.to_string_lossy().to_owned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 97 | let doc_ = doc_.to_string_lossy().into_owned(); [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 97 - let doc_ = doc_.to_string_lossy().to_owned(); [INFO] [stdout] 97 + let doc_ = doc_.to_string_lossy().clone(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip_while(

).next()` on an `Iterator` [INFO] [stdout] --> src/notes/utils.rs:28:21 [INFO] [stdout] | [INFO] [stdout] 28 | let last_hash = first_line [INFO] [stdout] | _____________________^ [INFO] [stdout] 29 | | .char_indices() [INFO] [stdout] 30 | | .skip_while(|&(_, c)| c == '#') [INFO] [stdout] 31 | | .next() [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: this is more succinctly expressed by calling `.find(!

)` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#skip_while_next [INFO] [stdout] = note: `#[warn(clippy::skip_while_next)]` on by default [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/notes/utils.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | / match path.into_os_string().into_string() { [INFO] [stdout] 59 | | Ok(x) => { [INFO] [stdout] 60 | | if x.contains("/subusers/") { [INFO] [stdout] 61 | | continue; [INFO] [stdout] ... | [INFO] [stdout] 64 | | Err(_) => {} [INFO] [stdout] 65 | | } [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] 58 ~ if let Ok(x) = path.into_os_string().into_string() { [INFO] [stdout] 59 + if x.contains("/subusers/") { [INFO] [stdout] 60 + continue; [INFO] [stdout] 61 + } [INFO] [stdout] 62 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/notes/utils.rs:127:12 [INFO] [stdout] | [INFO] [stdout] 127 | if !parent.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `parent.is_some()` [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: called `unwrap` on `parent` after checking its variant with `is_none` [INFO] [stdout] --> src/notes/utils.rs:128:28 [INFO] [stdout] | [INFO] [stdout] 127 | if !parent.is_none() { [INFO] [stdout] | ---------------- the check is happening here [INFO] [stdout] 128 | let root_dir = parent.unwrap().to_str().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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: unneeded late initialization [INFO] [stdout] --> src/notes/utils.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | let metadata; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `metadata` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 94 ~ [INFO] [stdout] 95 ~ let metadata = match fs::metadata(&file_path) { [INFO] [stdout] 96 | Ok(x) => { [INFO] [stdout] 97 ~ x [INFO] [stdout] 98 | } [INFO] [stdout] ... [INFO] [stdout] 102 | } [INFO] [stdout] 103 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/notes/utils.rs:114:36 [INFO] [stdout] | [INFO] [stdout] 114 | let title = get_note_title(¬e_item); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `note_item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/notes/utils.rs:131:36 [INFO] [stdout] | [INFO] [stdout] 131 | note_item.set_root_dir(&root_dir); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `root_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/notes/utils.rs:174:12 [INFO] [stdout] | [INFO] [stdout] 174 | if !parent.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `parent.is_some()` [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 `unwrap` on `parent` after checking its variant with `is_none` [INFO] [stdout] --> src/notes/utils.rs:175:28 [INFO] [stdout] | [INFO] [stdout] 174 | if !parent.is_none() { [INFO] [stdout] | ---------------- the check is happening here [INFO] [stdout] 175 | let root_dir = parent.unwrap().to_str().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/notes/utils.rs:155:5 [INFO] [stdout] | [INFO] [stdout] 155 | note_list.sort_by(|a, b| b.modified_ts.cmp(&a.modified_ts)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 155 - note_list.sort_by(|a, b| b.modified_ts.cmp(&a.modified_ts)); [INFO] [stdout] 155 + note_list.sort_by_key(|b| std::cmp::Reverse(b.modified_ts)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/notes/utils.rs:161:36 [INFO] [stdout] | [INFO] [stdout] 161 | let title = get_note_title(¬e_item); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `note_item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/notes/utils.rs:178:36 [INFO] [stdout] | [INFO] [stdout] 178 | note_item.set_root_dir(&root_dir); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `root_dir` [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: file opened with `create`, but `truncate` behavior not defined [INFO] [stdout] --> src/notes/utils.rs:240:10 [INFO] [stdout] | [INFO] [stdout] 240 | .create(true) [INFO] [stdout] | ^^^^^^^^^^^^- help: add: `.truncate(true)` [INFO] [stdout] | [INFO] [stdout] = help: if you intend to overwrite an existing file entirely, call `.truncate(true)` [INFO] [stdout] = help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)` [INFO] [stdout] = help: alternatively, use `.append(true)` to append to the file instead of overwriting it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options [INFO] [stdout] = note: `#[warn(clippy::suspicious_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/notes/utils.rs:271:5 [INFO] [stdout] | [INFO] [stdout] 270 | let html = markdown_to_html(txt, &options); [INFO] [stdout] | ------------------------------------------- unnecessary `let` binding [INFO] [stdout] 271 | html [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 270 ~ [INFO] [stdout] 271 ~ markdown_to_html(txt, &options) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/notes/search.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | return; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 21 - if output.stdout.is_empty() { [INFO] [stdout] 22 - return; [INFO] [stdout] 21 + if output.stdout.is_empty() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: spawned process is never `wait()`ed on [INFO] [stdout] --> src/notes/search.rs:73:23 [INFO] [stdout] | [INFO] [stdout] 73 | let process = Command::new("bash") [INFO] [stdout] | _______________________^ [INFO] [stdout] 74 | | .arg("-c") [INFO] [stdout] 75 | | .arg(cmd) [INFO] [stdout] 76 | | .stdin(Stdio::from(current_output)) [INFO] [stdout] 77 | | .stdout(Stdio::piped()) [INFO] [stdout] 78 | | .spawn() [INFO] [stdout] 79 | | .expect("Failed to execute command in pipeline"); [INFO] [stdout] | |____________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: consider calling `.wait()` [INFO] [stdout] = note: not doing so might leave behind zombie processes [INFO] [stdout] = note: see https://doc.rust-lang.org/stable/std/process/struct.Child.html#warning [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zombie_processes [INFO] [stdout] = note: `#[warn(clippy::zombie_processes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/notes/search.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 85 | / for line in reader.lines() { [INFO] [stdout] 86 | | if let Ok(line) = line { [INFO] [stdout] 87 | | if line.trim().is_empty() || !line.ends_with(".md") { [INFO] [stdout] 88 | | continue; [INFO] [stdout] ... | [INFO] [stdout] 95 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/notes/search.rs:86:9 [INFO] [stdout] | [INFO] [stdout] 86 | / if let Ok(line) = line { [INFO] [stdout] 87 | | if line.trim().is_empty() || !line.ends_with(".md") { [INFO] [stdout] 88 | | continue; [INFO] [stdout] ... | [INFO] [stdout] 93 | | note_list.push(line.trim().to_owned()); [INFO] [stdout] 94 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 85 ~ for line in reader.lines().flatten() { [INFO] [stdout] 86 + if line.trim().is_empty() || !line.ends_with(".md") { [INFO] [stdout] 87 + continue; [INFO] [stdout] 88 + } [INFO] [stdout] 89 + if note_list.iter().any(|x| *x == line) { [INFO] [stdout] 90 + continue; [INFO] [stdout] 91 + } [INFO] [stdout] 92 + note_list.push(line.trim().to_owned()); [INFO] [stdout] 93 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/notes/search.rs:90:16 [INFO] [stdout] | [INFO] [stdout] 90 | if note_list.iter().any(|x| *x == line) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `note_list.contains(&line)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/highlighter.rs:31:22 [INFO] [stdout] | [INFO] [stdout] 31 | let re = Regex::new(r"code class=.language-([A-Za-z0-9]+).").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/highlighter.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | for item_code in item.select(&select_code) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/highlighter.rs:62:41 [INFO] [stdout] | [INFO] [stdout] 62 | &raw_code, &syntax_set, &syntax, [INFO] [stdout] | ^^^^^^^ help: change this to: `syntax` [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/main.rs:51:21 [INFO] [stdout] | [INFO] [stdout] 51 | .route(&format!("{}", notes_prefix), web::get().to(notes::web::home)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `notes_prefix.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: redundant closure [INFO] [stdout] --> src/main.rs:60:38 [INFO] [stdout] | [INFO] [stdout] 60 | .default_service(web::to(|| HttpResponse::NotFound())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `HttpResponse::NotFound` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/config.rs:31:30 [INFO] [stdout] | [INFO] [stdout] 31 | rusty_dir_notes: dir_notes.into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `dir_notes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/config.rs:32:34 [INFO] [stdout] | [INFO] [stdout] 32 | rusty_dir_templates: dir_templates.into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `dir_templates` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/config.rs:39:26 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn from_env() -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 208 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `figment::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] = note: `#[warn(clippy::result_large_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/notes/web.rs:32:21 [INFO] [stdout] | [INFO] [stdout] 32 | let dir_notes = dir_notes.to_string_lossy().to_owned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] = note: `#[warn(clippy::suspicious_to_owned)]` on by default [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 32 | let dir_notes = dir_notes.to_string_lossy().into_owned(); [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 32 - let dir_notes = dir_notes.to_string_lossy().to_owned(); [INFO] [stdout] 32 + let dir_notes = dir_notes.to_string_lossy().clone(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/notes/web.rs:97:16 [INFO] [stdout] | [INFO] [stdout] 97 | let doc_ = doc_.to_string_lossy().to_owned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 97 | let doc_ = doc_.to_string_lossy().into_owned(); [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 97 - let doc_ = doc_.to_string_lossy().to_owned(); [INFO] [stdout] 97 + let doc_ = doc_.to_string_lossy().clone(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip_while(

).next()` on an `Iterator` [INFO] [stdout] --> src/notes/utils.rs:28:21 [INFO] [stdout] | [INFO] [stdout] 28 | let last_hash = first_line [INFO] [stdout] | _____________________^ [INFO] [stdout] 29 | | .char_indices() [INFO] [stdout] 30 | | .skip_while(|&(_, c)| c == '#') [INFO] [stdout] 31 | | .next() [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: this is more succinctly expressed by calling `.find(!

)` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#skip_while_next [INFO] [stdout] = note: `#[warn(clippy::skip_while_next)]` on by default [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/notes/utils.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | / match path.into_os_string().into_string() { [INFO] [stdout] 59 | | Ok(x) => { [INFO] [stdout] 60 | | if x.contains("/subusers/") { [INFO] [stdout] 61 | | continue; [INFO] [stdout] ... | [INFO] [stdout] 64 | | Err(_) => {} [INFO] [stdout] 65 | | } [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] 58 ~ if let Ok(x) = path.into_os_string().into_string() { [INFO] [stdout] 59 + if x.contains("/subusers/") { [INFO] [stdout] 60 + continue; [INFO] [stdout] 61 + } [INFO] [stdout] 62 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/notes/utils.rs:127:12 [INFO] [stdout] | [INFO] [stdout] 127 | if !parent.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `parent.is_some()` [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: called `unwrap` on `parent` after checking its variant with `is_none` [INFO] [stdout] --> src/notes/utils.rs:128:28 [INFO] [stdout] | [INFO] [stdout] 127 | if !parent.is_none() { [INFO] [stdout] | ---------------- the check is happening here [INFO] [stdout] 128 | let root_dir = parent.unwrap().to_str().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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: unneeded late initialization [INFO] [stdout] --> src/notes/utils.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | let metadata; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `metadata` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 94 ~ [INFO] [stdout] 95 ~ let metadata = match fs::metadata(&file_path) { [INFO] [stdout] 96 | Ok(x) => { [INFO] [stdout] 97 ~ x [INFO] [stdout] 98 | } [INFO] [stdout] ... [INFO] [stdout] 102 | } [INFO] [stdout] 103 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/notes/utils.rs:114:36 [INFO] [stdout] | [INFO] [stdout] 114 | let title = get_note_title(¬e_item); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `note_item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/notes/utils.rs:131:36 [INFO] [stdout] | [INFO] [stdout] 131 | note_item.set_root_dir(&root_dir); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `root_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/notes/utils.rs:174:12 [INFO] [stdout] | [INFO] [stdout] 174 | if !parent.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `parent.is_some()` [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 `unwrap` on `parent` after checking its variant with `is_none` [INFO] [stdout] --> src/notes/utils.rs:175:28 [INFO] [stdout] | [INFO] [stdout] 174 | if !parent.is_none() { [INFO] [stdout] | ---------------- the check is happening here [INFO] [stdout] 175 | let root_dir = parent.unwrap().to_str().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/notes/utils.rs:155:5 [INFO] [stdout] | [INFO] [stdout] 155 | note_list.sort_by(|a, b| b.modified_ts.cmp(&a.modified_ts)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 155 - note_list.sort_by(|a, b| b.modified_ts.cmp(&a.modified_ts)); [INFO] [stdout] 155 + note_list.sort_by_key(|b| std::cmp::Reverse(b.modified_ts)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/notes/utils.rs:161:36 [INFO] [stdout] | [INFO] [stdout] 161 | let title = get_note_title(¬e_item); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `note_item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/notes/utils.rs:178:36 [INFO] [stdout] | [INFO] [stdout] 178 | note_item.set_root_dir(&root_dir); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `root_dir` [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: file opened with `create`, but `truncate` behavior not defined [INFO] [stdout] --> src/notes/utils.rs:240:10 [INFO] [stdout] | [INFO] [stdout] 240 | .create(true) [INFO] [stdout] | ^^^^^^^^^^^^- help: add: `.truncate(true)` [INFO] [stdout] | [INFO] [stdout] = help: if you intend to overwrite an existing file entirely, call `.truncate(true)` [INFO] [stdout] = help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)` [INFO] [stdout] = help: alternatively, use `.append(true)` to append to the file instead of overwriting it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options [INFO] [stdout] = note: `#[warn(clippy::suspicious_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/notes/utils.rs:271:5 [INFO] [stdout] | [INFO] [stdout] 270 | let html = markdown_to_html(txt, &options); [INFO] [stdout] | ------------------------------------------- unnecessary `let` binding [INFO] [stdout] 271 | html [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 270 ~ [INFO] [stdout] 271 ~ markdown_to_html(txt, &options) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/notes/search.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | return; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 21 - if output.stdout.is_empty() { [INFO] [stdout] 22 - return; [INFO] [stdout] 21 + if output.stdout.is_empty() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: spawned process is never `wait()`ed on [INFO] [stdout] --> src/notes/search.rs:73:23 [INFO] [stdout] | [INFO] [stdout] 73 | let process = Command::new("bash") [INFO] [stdout] | _______________________^ [INFO] [stdout] 74 | | .arg("-c") [INFO] [stdout] 75 | | .arg(cmd) [INFO] [stdout] 76 | | .stdin(Stdio::from(current_output)) [INFO] [stdout] 77 | | .stdout(Stdio::piped()) [INFO] [stdout] 78 | | .spawn() [INFO] [stdout] 79 | | .expect("Failed to execute command in pipeline"); [INFO] [stdout] | |____________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: consider calling `.wait()` [INFO] [stdout] = note: not doing so might leave behind zombie processes [INFO] [stdout] = note: see https://doc.rust-lang.org/stable/std/process/struct.Child.html#warning [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zombie_processes [INFO] [stdout] = note: `#[warn(clippy::zombie_processes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/notes/search.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 85 | / for line in reader.lines() { [INFO] [stdout] 86 | | if let Ok(line) = line { [INFO] [stdout] 87 | | if line.trim().is_empty() || !line.ends_with(".md") { [INFO] [stdout] 88 | | continue; [INFO] [stdout] ... | [INFO] [stdout] 95 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/notes/search.rs:86:9 [INFO] [stdout] | [INFO] [stdout] 86 | / if let Ok(line) = line { [INFO] [stdout] 87 | | if line.trim().is_empty() || !line.ends_with(".md") { [INFO] [stdout] 88 | | continue; [INFO] [stdout] ... | [INFO] [stdout] 93 | | note_list.push(line.trim().to_owned()); [INFO] [stdout] 94 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 85 ~ for line in reader.lines().flatten() { [INFO] [stdout] 86 + if line.trim().is_empty() || !line.ends_with(".md") { [INFO] [stdout] 87 + continue; [INFO] [stdout] 88 + } [INFO] [stdout] 89 + if note_list.iter().any(|x| *x == line) { [INFO] [stdout] 90 + continue; [INFO] [stdout] 91 + } [INFO] [stdout] 92 + note_list.push(line.trim().to_owned()); [INFO] [stdout] 93 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/notes/search.rs:90:16 [INFO] [stdout] | [INFO] [stdout] 90 | if note_list.iter().any(|x| *x == line) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `note_list.contains(&line)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/highlighter.rs:31:22 [INFO] [stdout] | [INFO] [stdout] 31 | let re = Regex::new(r"code class=.language-([A-Za-z0-9]+).").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/highlighter.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | for item_code in item.select(&select_code) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/highlighter.rs:62:41 [INFO] [stdout] | [INFO] [stdout] 62 | &raw_code, &syntax_set, &syntax, [INFO] [stdout] | ^^^^^^^ help: change this to: `syntax` [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/main.rs:51:21 [INFO] [stdout] | [INFO] [stdout] 51 | .route(&format!("{}", notes_prefix), web::get().to(notes::web::home)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `notes_prefix.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: redundant closure [INFO] [stdout] --> src/main.rs:60:38 [INFO] [stdout] | [INFO] [stdout] 60 | .default_service(web::to(|| HttpResponse::NotFound())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `HttpResponse::NotFound` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2m 13s [INFO] running `Command { std: "docker" "inspect" "994f76a43462c455c45fc6ec82e4b3bea06f21c4ae8ad27f9047dbebcf5691c6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "994f76a43462c455c45fc6ec82e4b3bea06f21c4ae8ad27f9047dbebcf5691c6", kill_on_drop: false }` [INFO] [stdout] 994f76a43462c455c45fc6ec82e4b3bea06f21c4ae8ad27f9047dbebcf5691c6