[INFO] cloning repository https://github.com/Tehforsch/pundit [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Tehforsch/pundit" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FTehforsch%2Fpundit", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FTehforsch%2Fpundit'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 1fa3daa2e22b9374d377de58c3e416ebe8948c71 [INFO] linting Tehforsch/pundit against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FTehforsch%2Fpundit" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/Tehforsch/pundit [INFO] finished tweaking git repo https://github.com/Tehforsch/pundit [INFO] tweaked toml for git repo https://github.com/Tehforsch/pundit written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Tehforsch/pundit 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/Tehforsch/pundit 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 ryu v1.0.16 [INFO] [stderr] Downloaded serde_yaml v0.8.26 [INFO] [stderr] Downloaded proc-macro2 v1.0.75 [INFO] [stderr] Downloaded fixedbitset v0.2.0 [INFO] [stderr] Downloaded wasm-bindgen-shared v0.2.89 [INFO] [stderr] Downloaded prost-derive v0.8.0 [INFO] [stderr] Downloaded wasm-bindgen-macro v0.2.89 [INFO] [stderr] Downloaded iana-time-zone v0.1.59 [INFO] [stderr] Downloaded rustc-serialize v0.3.25 [INFO] [stderr] Downloaded ahash v0.4.8 [INFO] [stderr] Downloaded js-sys v0.3.66 [INFO] [stderr] Downloaded serde v1.0.194 [INFO] [stderr] Downloaded serde_derive v1.0.194 [INFO] [stderr] Downloaded rusqlite v0.24.2 [INFO] [stderr] Downloaded petgraph v0.5.1 [INFO] [stderr] Downloaded serde_json v1.0.111 [INFO] [stderr] Downloaded wasm-bindgen v0.2.89 [INFO] [stderr] Downloaded wasm-bindgen-backend v0.2.89 [INFO] [stderr] Downloaded wasm-bindgen-macro-support v0.2.89 [INFO] [stderr] Downloaded dissimilar v1.0.7 [INFO] [stderr] Downloaded prost v0.8.0 [INFO] [stderr] Downloaded prost-types v0.8.0 [INFO] [stderr] Downloaded tempfile v3.9.0 [INFO] [stderr] Downloaded pkg-config v0.3.28 [INFO] [stderr] Downloaded libsqlite3-sys v0.20.1 [INFO] [stderr] Downloaded prost-build v0.8.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 7052a60dca440e19e726d7733eee242329a827a6b36c1ce4b99ec25f1b74e23b [INFO] running `Command { std: "docker" "start" "-a" "7052a60dca440e19e726d7733eee242329a827a6b36c1ce4b99ec25f1b74e23b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "7052a60dca440e19e726d7733eee242329a827a6b36c1ce4b99ec25f1b74e23b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7052a60dca440e19e726d7733eee242329a827a6b36c1ce4b99ec25f1b74e23b", kill_on_drop: false }` [INFO] [stdout] 7052a60dca440e19e726d7733eee242329a827a6b36c1ce4b99ec25f1b74e23b [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 57953bae84a7079fcb53123668fa9b72ac2eb8c5fed873f991f30c9e0893bb1d [INFO] running `Command { std: "docker" "start" "-a" "57953bae84a7079fcb53123668fa9b72ac2eb8c5fed873f991f30c9e0893bb1d", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.151 [INFO] [stderr] Compiling proc-macro2 v1.0.75 [INFO] [stderr] Compiling getrandom v0.1.16 [INFO] [stderr] Compiling anyhow v1.0.79 [INFO] [stderr] Compiling serde v1.0.194 [INFO] [stderr] Compiling pkg-config v0.3.28 [INFO] [stderr] Checking memchr v2.7.1 [INFO] [stderr] Checking ahash v0.4.8 [INFO] [stderr] Compiling gcc v0.3.55 [INFO] [stderr] Compiling either v1.9.0 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Compiling proc-macro-error-attr v1.0.4 [INFO] [stderr] Compiling proc-macro-error v1.0.4 [INFO] [stderr] Compiling indexmap v1.9.3 [INFO] [stderr] Compiling num-traits v0.2.17 [INFO] [stderr] Checking os_str_bytes v6.6.1 [INFO] [stderr] Checking linked-hash-map v0.5.6 [INFO] [stderr] Compiling itertools v0.10.5 [INFO] [stderr] Checking ryu v1.0.16 [INFO] [stderr] Compiling serde_json v1.0.111 [INFO] [stderr] Checking regex-syntax v0.8.2 [INFO] [stderr] Checking hashbrown v0.9.1 [INFO] [stderr] Compiling heck v0.4.1 [INFO] [stderr] Checking clap_lex v0.2.4 [INFO] [stderr] Checking yaml-rust v0.4.5 [INFO] [stderr] Checking rustc-serialize v0.3.25 [INFO] [stderr] Checking iana-time-zone v0.1.59 [INFO] [stderr] Checking textwrap v0.16.0 [INFO] [stderr] Checking fallible-iterator v0.2.0 [INFO] [stderr] Checking bytes v1.5.0 [INFO] [stderr] Checking aho-corasick v1.1.2 [INFO] [stderr] Checking hashlink v0.6.0 [INFO] [stderr] Checking fallible-streaming-iterator v0.1.9 [INFO] [stderr] Checking smallvec v1.11.2 [INFO] [stderr] Checking itoa v1.0.10 [INFO] [stderr] Checking termcolor v1.4.0 [INFO] [stderr] Checking strsim v0.10.0 [INFO] [stderr] Compiling quote v1.0.35 [INFO] [stderr] Compiling libsqlite3-sys v0.20.1 [INFO] [stderr] Checking log v0.4.20 [INFO] [stderr] Checking remove_dir_all v0.5.3 [INFO] [stderr] Checking walkdir v2.4.0 [INFO] [stderr] Compiling rust-crypto v0.2.36 [INFO] [stderr] Checking dissimilar v1.0.7 [INFO] [stderr] Compiling syn v2.0.48 [INFO] [stderr] Checking itertools v0.9.0 [INFO] [stderr] Checking chrono v0.4.31 [INFO] [stderr] Checking rusqlite v0.24.2 [INFO] [stderr] Checking rand v0.4.6 [INFO] [stderr] Checking dirs-sys v0.3.7 [INFO] [stderr] Checking time v0.1.45 [INFO] [stderr] Checking dirs-sys-next v0.1.2 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Checking regex-automata v0.4.3 [INFO] [stderr] Checking dirs v4.0.0 [INFO] [stderr] Checking dirs-next v2.0.0 [INFO] [stderr] Checking shellexpand v2.1.2 [INFO] [stderr] Checking rand_core v0.5.1 [INFO] [stderr] Checking rand v0.3.23 [INFO] [stderr] Checking tempdir v0.3.7 [INFO] [stderr] Checking rand_chacha v0.2.2 [INFO] [stderr] Checking rand v0.7.3 [INFO] [stderr] Checking regex v1.10.2 [INFO] [stderr] Compiling serde_derive v1.0.194 [INFO] [stderr] Compiling prost-derive v0.8.0 [INFO] [stderr] Compiling clap_derive v3.2.25 [INFO] [stderr] Checking prost v0.8.0 [INFO] [stderr] Checking clap v3.2.25 [INFO] [stderr] Checking serde_yaml v0.8.26 [INFO] [stderr] Checking generational-arena v0.2.9 [INFO] [stderr] Checking pundit v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/note.rs:62:13 [INFO] [stdout] | [INFO] [stdout] 62 | filename: filename, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `filename` [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/note.rs:62:13 [INFO] [stdout] | [INFO] [stdout] 62 | filename: filename, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `filename` [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: struct `InvalidNoteError` is never constructed [INFO] [stdout] --> src/note.rs:27:8 [INFO] [stdout] | [INFO] [stdout] 27 | struct InvalidNoteError; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `InvalidTitleError` is never constructed [INFO] [stdout] --> src/note.rs:29:8 [INFO] [stdout] | [INFO] [stdout] 29 | struct InvalidTitleError; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `InvalidNoteError` is never constructed [INFO] [stdout] --> src/note.rs:27:8 [INFO] [stdout] | [INFO] [stdout] 27 | struct InvalidNoteError; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `InvalidTitleError` is never constructed [INFO] [stdout] --> src/note.rs:29:8 [INFO] [stdout] | [INFO] [stdout] 29 | struct InvalidTitleError; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/anki/mod.rs:202:67 [INFO] [stdout] | [INFO] [stdout] 202 | let sfld_contents = get_sort_field_contents(&sort_field_name, &model, note_info)?; [INFO] [stdout] | ^^^^^^ help: change this to: `model` [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/anki/mod.rs:223:31 [INFO] [stdout] | [INFO] [stdout] 223 | Ok(match is_note_id_field(&sort_field_name) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `sort_field_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/anki/mod.rs:344:5 [INFO] [stdout] | [INFO] [stdout] 344 | Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 344 - Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] 344 + connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/anki/mod.rs:344:67 [INFO] [stdout] | [INFO] [stdout] 344 | Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 344 - Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] 344 + Ok(connection.query_row("select ver from col", NO_PARAMS, |r| r.get(0))?) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/anki/mod.rs:202:67 [INFO] [stdout] | [INFO] [stdout] 202 | let sfld_contents = get_sort_field_contents(&sort_field_name, &model, note_info)?; [INFO] [stdout] | ^^^^^^ help: change this to: `model` [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/anki/mod.rs:223:31 [INFO] [stdout] | [INFO] [stdout] 223 | Ok(match is_note_id_field(&sort_field_name) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `sort_field_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/anki/mod.rs:344:5 [INFO] [stdout] | [INFO] [stdout] 344 | Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 344 - Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] 344 + connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/anki/mod.rs:344:67 [INFO] [stdout] | [INFO] [stdout] 344 | Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 344 - Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] 344 + Ok(connection.query_row("select ver from col", NO_PARAMS, |r| r.get(0))?) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `flat_map` with an identity function [INFO] [stdout] --> src/dir_utils.rs:19:10 [INFO] [stdout] | [INFO] [stdout] 19 | .flat_map(|it| it); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_identity [INFO] [stdout] = note: `#[warn(clippy::flat_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `.write(true)` because there is `.append(true)` [INFO] [stdout] --> src/file_utils.rs:9:38 [INFO] [stdout] | [INFO] [stdout] 9 | let mut file = OpenOptions::new().write(true).append(true).open(filename)?; [INFO] [stdout] | ^^^^^^^^^^^^ help: remove `.write(true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_open_options [INFO] [stdout] = note: `#[warn(clippy::ineffective_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/filter_options.rs:33:14 [INFO] [stdout] | [INFO] [stdout] 33 | .map(|f_name| Path::new(f_name)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Path::new` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/filter_options.rs:34:52 [INFO] [stdout] | [INFO] [stdout] 34 | .any(|f| note_is_in_subfolder(base_folder, &f, note)) [INFO] [stdout] | ^^ help: change this to: `f` [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 following explicit lifetimes could be elided: 'b [INFO] [stdout] --> src/graph.rs:21:27 [INFO] [stdout] | [INFO] [stdout] 21 | fn depth_first_search<'a, 'b>( [INFO] [stdout] | ^^ [INFO] [stdout] 22 | visited: &'b mut HashMap, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 21 ~ fn depth_first_search<'a>( [INFO] [stdout] 22 ~ visited: &mut HashMap, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/graph.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 25 | level: i32, [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_level` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/graph.rs:30:64 [INFO] [stdout] | [INFO] [stdout] 30 | depth_first_search(visited, notes, ¬es[*index], level + 1); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/journal.rs:76:26 [INFO] [stdout] | [INFO] [stdout] 76 | fn get_date_via_selector<'a, F>( [INFO] [stdout] | ^^ [INFO] [stdout] 77 | notes: &'a Notes, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 76 ~ fn get_date_via_selector( [INFO] [stdout] 77 ~ notes: &Notes, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/journal.rs:96:14 [INFO] [stdout] | [INFO] [stdout] 96 | .map(|note| JournalInfo::get_date_from_note(note)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `JournalInfo::get_date_from_note` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/journal.rs:100:31 [INFO] [stdout] | [INFO] [stdout] 100 | fn previous_date(entry_dates: &Vec, date: &NaiveDate) -> NaiveDate { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - fn previous_date(entry_dates: &Vec, date: &NaiveDate) -> NaiveDate { [INFO] [stdout] 100 + fn previous_date(entry_dates: &[NaiveDate], date: &NaiveDate) -> NaiveDate { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option<&NaiveDate>` which implements the `Copy` trait [INFO] [stdout] --> src/journal.rs:101:26 [INFO] [stdout] | [INFO] [stdout] 101 | let previous_entry = entry_dates.iter().filter(|d| d < &date).max().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `entry_dates.iter().filter(|d| d < &date).max()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `NaiveDate` which implements the `Copy` trait [INFO] [stdout] --> src/journal.rs:102:5 [INFO] [stdout] | [INFO] [stdout] 102 | previous_entry.unwrap_or(date).clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*previous_entry.unwrap_or(date)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/journal.rs:105:27 [INFO] [stdout] | [INFO] [stdout] 105 | fn next_date(entry_dates: &Vec, date: &NaiveDate) -> NaiveDate { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 105 - fn next_date(entry_dates: &Vec, date: &NaiveDate) -> NaiveDate { [INFO] [stdout] 105 + fn next_date(entry_dates: &[NaiveDate], date: &NaiveDate) -> NaiveDate { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option<&NaiveDate>` which implements the `Copy` trait [INFO] [stdout] --> src/journal.rs:106:26 [INFO] [stdout] | [INFO] [stdout] 106 | let previous_entry = entry_dates.iter().filter(|d| d > &date).min().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `entry_dates.iter().filter(|d| d > &date).min()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `NaiveDate` which implements the `Copy` trait [INFO] [stdout] --> src/journal.rs:107:5 [INFO] [stdout] | [INFO] [stdout] 107 | previous_entry.unwrap_or(date).clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*previous_entry.unwrap_or(date)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/journal_info.rs:32:39 [INFO] [stdout] | [INFO] [stdout] 32 | pub fn get_link_text_to_base_note<'a>(&self, notes: &'a Notes) -> Result { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 32 - pub fn get_link_text_to_base_note<'a>(&self, notes: &'a Notes) -> Result { [INFO] [stdout] 32 + pub fn get_link_text_to_base_note(&self, notes: &Notes) -> Result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/journal_info.rs:79:5 [INFO] [stdout] | [INFO] [stdout] 75 | / let folder = match config::JOURNAL_IN_SUBFOLDERS { [INFO] [stdout] 76 | | true => base_folder.join(journal_name), [INFO] [stdout] 77 | | false => base_folder.to_path_buf(), [INFO] [stdout] 78 | | }; [INFO] [stdout] | |______- unnecessary `let` binding [INFO] [stdout] 79 | folder [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] 75 ~ [INFO] [stdout] 76 ~ match config::JOURNAL_IN_SUBFOLDERS { [INFO] [stdout] 77 + true => base_folder.join(journal_name), [INFO] [stdout] 78 + false => base_folder.to_path_buf(), [INFO] [stdout] 79 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/journal_info.rs:90:36 [INFO] [stdout] | [INFO] [stdout] 90 | fn ensure_journal_base_note_exists<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] 91 | notes: &'a mut Notes, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 90 ~ fn ensure_journal_base_note_exists( [INFO] [stdout] 91 ~ notes: &mut Notes, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/journal_info.rs:95:32 [INFO] [stdout] | [INFO] [stdout] 95 | find_or_create_note(notes, &journal_folder, &name)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `journal_folder` [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/journal_info.rs:95:49 [INFO] [stdout] | [INFO] [stdout] 95 | find_or_create_note(notes, &journal_folder, &name)?; [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/note.rs:55:19 [INFO] [stdout] | [INFO] [stdout] 55 | .join(&get_filename_from_title(&title, date_time)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `get_filename_from_title(&title, date_time)` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/note.rs:55:44 [INFO] [stdout] | [INFO] [stdout] 55 | .join(&get_filename_from_title(&title, date_time)) [INFO] [stdout] | ^^^^^^ help: change this to: `title` [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: use of `flat_map` with an identity function [INFO] [stdout] --> src/dir_utils.rs:19:10 [INFO] [stdout] | [INFO] [stdout] 19 | .flat_map(|it| it); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_identity [INFO] [stdout] = note: `#[warn(clippy::flat_map_identity)]` 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/note.rs:139:5 [INFO] [stdout] | [INFO] [stdout] 139 | / match notes.find_by_title(title) { [INFO] [stdout] 140 | | Some(n) => { [INFO] [stdout] 141 | | return Err(anyhow!( [INFO] [stdout] 142 | | "Note with title: {} already exists at {:?}", [INFO] [stdout] ... | [INFO] [stdout] 147 | | None => {} [INFO] [stdout] 148 | | }; [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] 139 ~ if let Some(n) = notes.find_by_title(title) { [INFO] [stdout] 140 + return Err(anyhow!( [INFO] [stdout] 141 + "Note with title: {} already exists at {:?}", [INFO] [stdout] 142 + title, [INFO] [stdout] 143 + n.filename [INFO] [stdout] 144 + )) [INFO] [stdout] 145 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `.write(true)` because there is `.append(true)` [INFO] [stdout] --> src/file_utils.rs:9:38 [INFO] [stdout] | [INFO] [stdout] 9 | let mut file = OpenOptions::new().write(true).append(true).open(filename)?; [INFO] [stdout] | ^^^^^^^^^^^^ help: remove `.write(true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_open_options [INFO] [stdout] = note: `#[warn(clippy::ineffective_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/note_arg.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | / notes [INFO] [stdout] 19 | | .iter() [INFO] [stdout] 20 | | .filter(|n| n.filename == self.filename.canonicalize().unwrap()) [INFO] [stdout] 21 | | .next() [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 18 ~ notes [INFO] [stdout] 19 + .iter().find(|n| n.filename == self.filename.canonicalize().unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/filter_options.rs:33:14 [INFO] [stdout] | [INFO] [stdout] 33 | .map(|f_name| Path::new(f_name)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Path::new` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/filter_options.rs:34:52 [INFO] [stdout] | [INFO] [stdout] 34 | .any(|f| note_is_in_subfolder(base_folder, &f, note)) [INFO] [stdout] | ^^ help: change this to: `f` [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/note_utils.rs:37:66 [INFO] [stdout] | [INFO] [stdout] 37 | let new_note = create_new_note_from_title(notes, folder, &title)?; [INFO] [stdout] | ^^^^^^ help: change this to: `title` [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/note_utils.rs:51:44 [INFO] [stdout] | [INFO] [stdout] 51 | append_to_file(¬e.filename, &content)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `content` [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: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/notes.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | Ok(serde_yaml::from_str(&data).context("Reading pundit database contents")?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 30 - Ok(serde_yaml::from_str(&data).context("Reading pundit database contents")?) [INFO] [stdout] 30 + serde_yaml::from_str(&data).context("Reading pundit database contents") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'b [INFO] [stdout] --> src/graph.rs:21:27 [INFO] [stdout] | [INFO] [stdout] 21 | fn depth_first_search<'a, 'b>( [INFO] [stdout] | ^^ [INFO] [stdout] 22 | visited: &'b mut HashMap, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 21 ~ fn depth_first_search<'a>( [INFO] [stdout] 22 ~ visited: &mut HashMap, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/graph.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 25 | level: i32, [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_level` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/graph.rs:30:64 [INFO] [stdout] | [INFO] [stdout] 30 | depth_first_search(visited, notes, ¬es[*index], level + 1); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/journal.rs:76:26 [INFO] [stdout] | [INFO] [stdout] 76 | fn get_date_via_selector<'a, F>( [INFO] [stdout] | ^^ [INFO] [stdout] 77 | notes: &'a Notes, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 76 ~ fn get_date_via_selector( [INFO] [stdout] 77 ~ notes: &Notes, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Notes` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/notes.rs:56:5 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/journal.rs:96:14 [INFO] [stdout] | [INFO] [stdout] 96 | .map(|note| JournalInfo::get_date_from_note(note)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `JournalInfo::get_date_from_note` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/journal.rs:100:31 [INFO] [stdout] | [INFO] [stdout] 100 | fn previous_date(entry_dates: &Vec, date: &NaiveDate) -> NaiveDate { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - fn previous_date(entry_dates: &Vec, date: &NaiveDate) -> NaiveDate { [INFO] [stdout] 100 + fn previous_date(entry_dates: &[NaiveDate], date: &NaiveDate) -> NaiveDate { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/notes.rs:97:9 [INFO] [stdout] | [INFO] [stdout] 96 | let idx = self.arena.insert(note); [INFO] [stdout] | ---------------------------------- unnecessary `let` binding [INFO] [stdout] 97 | idx [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] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 96 ~ [INFO] [stdout] 97 ~ self.arena.insert(note) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement with `?` operator [INFO] [stdout] --> src/notes.rs:105:13 [INFO] [stdout] | [INFO] [stdout] 105 | return Err(anyhow!(format!( [INFO] [stdout] | ^^^^^^^ help: remove it [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return_with_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_return_with_question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/notes.rs:223:10 [INFO] [stdout] | [INFO] [stdout] 223 | .expect(&format!("Invalid filename for note: {:?}", ¬e.filename)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Invalid filename for note: {:?}", ¬e.filename))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option<&NaiveDate>` which implements the `Copy` trait [INFO] [stdout] --> src/journal.rs:101:26 [INFO] [stdout] | [INFO] [stdout] 101 | let previous_entry = entry_dates.iter().filter(|d| d < &date).max().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `entry_dates.iter().filter(|d| d < &date).max()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `NaiveDate` which implements the `Copy` trait [INFO] [stdout] --> src/journal.rs:102:5 [INFO] [stdout] | [INFO] [stdout] 102 | previous_entry.unwrap_or(date).clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*previous_entry.unwrap_or(date)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/journal.rs:105:27 [INFO] [stdout] | [INFO] [stdout] 105 | fn next_date(entry_dates: &Vec, date: &NaiveDate) -> NaiveDate { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 105 - fn next_date(entry_dates: &Vec, date: &NaiveDate) -> NaiveDate { [INFO] [stdout] 105 + fn next_date(entry_dates: &[NaiveDate], date: &NaiveDate) -> NaiveDate { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option<&NaiveDate>` which implements the `Copy` trait [INFO] [stdout] --> src/journal.rs:106:26 [INFO] [stdout] | [INFO] [stdout] 106 | let previous_entry = entry_dates.iter().filter(|d| d > &date).min().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `entry_dates.iter().filter(|d| d > &date).min()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `NaiveDate` which implements the `Copy` trait [INFO] [stdout] --> src/journal.rs:107:5 [INFO] [stdout] | [INFO] [stdout] 107 | previous_entry.unwrap_or(date).clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*previous_entry.unwrap_or(date)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/journal_info.rs:32:39 [INFO] [stdout] | [INFO] [stdout] 32 | pub fn get_link_text_to_base_note<'a>(&self, notes: &'a Notes) -> Result { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 32 - pub fn get_link_text_to_base_note<'a>(&self, notes: &'a Notes) -> Result { [INFO] [stdout] 32 + pub fn get_link_text_to_base_note(&self, notes: &Notes) -> Result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/journal_info.rs:79:5 [INFO] [stdout] | [INFO] [stdout] 75 | / let folder = match config::JOURNAL_IN_SUBFOLDERS { [INFO] [stdout] 76 | | true => base_folder.join(journal_name), [INFO] [stdout] 77 | | false => base_folder.to_path_buf(), [INFO] [stdout] 78 | | }; [INFO] [stdout] | |______- unnecessary `let` binding [INFO] [stdout] 79 | folder [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] 75 ~ [INFO] [stdout] 76 ~ match config::JOURNAL_IN_SUBFOLDERS { [INFO] [stdout] 77 + true => base_folder.join(journal_name), [INFO] [stdout] 78 + false => base_folder.to_path_buf(), [INFO] [stdout] 79 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/journal_info.rs:90:36 [INFO] [stdout] | [INFO] [stdout] 90 | fn ensure_journal_base_note_exists<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] 91 | notes: &'a mut Notes, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 90 ~ fn ensure_journal_base_note_exists( [INFO] [stdout] 91 ~ notes: &mut Notes, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/journal_info.rs:95:32 [INFO] [stdout] | [INFO] [stdout] 95 | find_or_create_note(notes, &journal_folder, &name)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `journal_folder` [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/journal_info.rs:95:49 [INFO] [stdout] | [INFO] [stdout] 95 | find_or_create_note(notes, &journal_folder, &name)?; [INFO] [stdout] | ^^^^^ help: change this to: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pankit/mod.rs:127:36 [INFO] [stdout] | [INFO] [stdout] 127 | execute_action(connection, &mut pankit_db, action)?; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `pankit_db` [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/pankit/mod.rs:189:27 [INFO] [stdout] | [INFO] [stdout] 189 | add_anki_note(&connection, anki_note) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `connection` [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/pankit/mod.rs:192:31 [INFO] [stdout] | [INFO] [stdout] 192 | add_anki_card(&connection, anki_card).context("While adding anki card")?; [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `connection` [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/note.rs:55:19 [INFO] [stdout] | [INFO] [stdout] 55 | .join(&get_filename_from_title(&title, date_time)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `get_filename_from_title(&title, date_time)` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pankit/mod.rs:339:34 [INFO] [stdout] | [INFO] [stdout] 339 | serde_yaml::from_str(&data).context(format!("Reading note contents: {}", data)); [INFO] [stdout] | ^^^^^ help: change this to: `data` [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/note.rs:55:44 [INFO] [stdout] | [INFO] [stdout] 55 | .join(&get_filename_from_title(&title, date_time)) [INFO] [stdout] | ^^^^^^ help: change this to: `title` [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/pankit/mod.rs:359:29 [INFO] [stdout] | [INFO] [stdout] 359 | print_anki_note(id, &model, &deck, false); [INFO] [stdout] | ^^^^^^ help: change this to: `model` [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/pankit/mod.rs:359:37 [INFO] [stdout] | [INFO] [stdout] 359 | print_anki_note(id, &model, &deck, false); [INFO] [stdout] | ^^^^^ help: change this to: `deck` [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/pankit/mod.rs:365:29 [INFO] [stdout] | [INFO] [stdout] 365 | print_anki_note(id, &model, &deck, true); [INFO] [stdout] | ^^^^^^ help: change this to: `model` [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/pankit/mod.rs:365:37 [INFO] [stdout] | [INFO] [stdout] 365 | print_anki_note(id, &model, &deck, true); [INFO] [stdout] | ^^^^^ help: change this to: `deck` [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/pankit/mod.rs:407:13 [INFO] [stdout] | [INFO] [stdout] 407 | / format!( [INFO] [stdout] 408 | | "{}", [INFO] [stdout] 409 | | ANKI_NOTE_FIELD_TEMPLATE.replace("{fieldName}", &field_name) [INFO] [stdout] 410 | | ) [INFO] [stdout] | |_____________^ help: consider using `.to_string()`: `ANKI_NOTE_FIELD_TEMPLATE.replace("{fieldName}", &field_name).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pankit/mod.rs:409:65 [INFO] [stdout] | [INFO] [stdout] 409 | ANKI_NOTE_FIELD_TEMPLATE.replace("{fieldName}", &field_name) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `field_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/pankit/mod.rs:414:18 [INFO] [stdout] | [INFO] [stdout] 414 | let result = format!( [INFO] [stdout] | __________________^ [INFO] [stdout] 415 | | "{}", [INFO] [stdout] 416 | | template [INFO] [stdout] 417 | | .replace("{id}", &format!("{}", id)) [INFO] [stdout] ... | [INFO] [stdout] 420 | | .replace("{fields}", &fields_string) [INFO] [stdout] 421 | | ); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] help: consider using `.to_string()` [INFO] [stdout] | [INFO] [stdout] 414 ~ let result = template [INFO] [stdout] 415 + .replace("{id}", &format!("{}", id)) [INFO] [stdout] 416 + .replace("{model}", &model.name) [INFO] [stdout] 417 + .replace("{deck}", &deck.name) [INFO] [stdout] 418 ~ .replace("{fields}", &fields_string).to_string(); [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/note.rs:139:5 [INFO] [stdout] | [INFO] [stdout] 139 | / match notes.find_by_title(title) { [INFO] [stdout] 140 | | Some(n) => { [INFO] [stdout] 141 | | return Err(anyhow!( [INFO] [stdout] 142 | | "Note with title: {} already exists at {:?}", [INFO] [stdout] ... | [INFO] [stdout] 147 | | None => {} [INFO] [stdout] 148 | | }; [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] 139 ~ if let Some(n) = notes.find_by_title(title) { [INFO] [stdout] 140 + return Err(anyhow!( [INFO] [stdout] 141 + "Note with title: {} already exists at {:?}", [INFO] [stdout] 142 + title, [INFO] [stdout] 143 + n.filename [INFO] [stdout] 144 + )) [INFO] [stdout] 145 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/note_arg.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | / notes [INFO] [stdout] 19 | | .iter() [INFO] [stdout] 20 | | .filter(|n| n.filename == self.filename.canonicalize().unwrap()) [INFO] [stdout] 21 | | .next() [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 18 ~ notes [INFO] [stdout] 19 + .iter().find(|n| n.filename == self.filename.canonicalize().unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/paper.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 89 | &title, [INFO] [stdout] | ^^^^^^ help: change this to: `title` [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/note_utils.rs:37:66 [INFO] [stdout] | [INFO] [stdout] 37 | let new_note = create_new_note_from_title(notes, folder, &title)?; [INFO] [stdout] | ^^^^^^ help: change this to: `title` [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/note_utils.rs:51:44 [INFO] [stdout] | [INFO] [stdout] 51 | append_to_file(¬e.filename, &content)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `content` [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: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/notes.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | Ok(serde_yaml::from_str(&data).context("Reading pundit database contents")?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 30 - Ok(serde_yaml::from_str(&data).context("Reading pundit database contents")?) [INFO] [stdout] 30 + serde_yaml::from_str(&data).context("Reading pundit database contents") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Notes` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/notes.rs:56:5 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/notes.rs:97:9 [INFO] [stdout] | [INFO] [stdout] 96 | let idx = self.arena.insert(note); [INFO] [stdout] | ---------------------------------- unnecessary `let` binding [INFO] [stdout] 97 | idx [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] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 96 ~ [INFO] [stdout] 97 ~ self.arena.insert(note) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement with `?` operator [INFO] [stdout] --> src/notes.rs:105:13 [INFO] [stdout] | [INFO] [stdout] 105 | return Err(anyhow!(format!( [INFO] [stdout] | ^^^^^^^ help: remove it [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return_with_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_return_with_question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/notes.rs:223:10 [INFO] [stdout] | [INFO] [stdout] 223 | .expect(&format!("Invalid filename for note: {:?}", ¬e.filename)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Invalid filename for note: {:?}", ¬e.filename))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pankit/mod.rs:127:36 [INFO] [stdout] | [INFO] [stdout] 127 | execute_action(connection, &mut pankit_db, action)?; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `pankit_db` [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/pankit/mod.rs:189:27 [INFO] [stdout] | [INFO] [stdout] 189 | add_anki_note(&connection, anki_note) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `connection` [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/pankit/mod.rs:192:31 [INFO] [stdout] | [INFO] [stdout] 192 | add_anki_card(&connection, anki_card).context("While adding anki card")?; [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `connection` [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/pankit/mod.rs:339:34 [INFO] [stdout] | [INFO] [stdout] 339 | serde_yaml::from_str(&data).context(format!("Reading note contents: {}", data)); [INFO] [stdout] | ^^^^^ help: change this to: `data` [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/pankit/mod.rs:359:29 [INFO] [stdout] | [INFO] [stdout] 359 | print_anki_note(id, &model, &deck, false); [INFO] [stdout] | ^^^^^^ help: change this to: `model` [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/pankit/mod.rs:359:37 [INFO] [stdout] | [INFO] [stdout] 359 | print_anki_note(id, &model, &deck, false); [INFO] [stdout] | ^^^^^ help: change this to: `deck` [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/pankit/mod.rs:365:29 [INFO] [stdout] | [INFO] [stdout] 365 | print_anki_note(id, &model, &deck, true); [INFO] [stdout] | ^^^^^^ help: change this to: `model` [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/pankit/mod.rs:365:37 [INFO] [stdout] | [INFO] [stdout] 365 | print_anki_note(id, &model, &deck, true); [INFO] [stdout] | ^^^^^ help: change this to: `deck` [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/pankit/mod.rs:407:13 [INFO] [stdout] | [INFO] [stdout] 407 | / format!( [INFO] [stdout] 408 | | "{}", [INFO] [stdout] 409 | | ANKI_NOTE_FIELD_TEMPLATE.replace("{fieldName}", &field_name) [INFO] [stdout] 410 | | ) [INFO] [stdout] | |_____________^ help: consider using `.to_string()`: `ANKI_NOTE_FIELD_TEMPLATE.replace("{fieldName}", &field_name).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pankit/mod.rs:409:65 [INFO] [stdout] | [INFO] [stdout] 409 | ANKI_NOTE_FIELD_TEMPLATE.replace("{fieldName}", &field_name) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `field_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/pankit/mod.rs:414:18 [INFO] [stdout] | [INFO] [stdout] 414 | let result = format!( [INFO] [stdout] | __________________^ [INFO] [stdout] 415 | | "{}", [INFO] [stdout] 416 | | template [INFO] [stdout] 417 | | .replace("{id}", &format!("{}", id)) [INFO] [stdout] ... | [INFO] [stdout] 420 | | .replace("{fields}", &fields_string) [INFO] [stdout] 421 | | ); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] help: consider using `.to_string()` [INFO] [stdout] | [INFO] [stdout] 414 ~ let result = template [INFO] [stdout] 415 + .replace("{id}", &format!("{}", id)) [INFO] [stdout] 416 + .replace("{model}", &model.name) [INFO] [stdout] 417 + .replace("{deck}", &deck.name) [INFO] [stdout] 418 ~ .replace("{fields}", &fields_string).to_string(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/paper.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 89 | &title, [INFO] [stdout] | ^^^^^^ help: change this to: `title` [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: redundant field names in struct initialization [INFO] [stdout] --> tests/ankitool.rs:112:9 [INFO] [stdout] | [INFO] [stdout] 112 | env: env, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `env` [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: this boolean expression can be simplified [INFO] [stdout] --> tests/setup/dir_diff.rs:122:59 [INFO] [stdout] | [INFO] [stdout] 122 | get_first_difference(a_base, b_base).map(|difference| !difference.is_none()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `difference.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: unneeded unit return type [INFO] [stdout] --> tests/setup/dir_diff.rs:125:52 [INFO] [stdout] | [INFO] [stdout] 125 | pub fn check_dir_diff(source: &Path, target: &Path) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> tests/setup/mod.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 84 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> tests/setup/mod.rs:91:10 [INFO] [stdout] | [INFO] [stdout] 91 | .expect(&format!("Failed to run command: {}", command)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to run command: {}", command))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:111:34 [INFO] [stdout] | [INFO] [stdout] 111 | &convert_args(&new_args, &env.dir.path())?, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `env.dir.path()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:144:34 [INFO] [stdout] | [INFO] [stdout] 144 | &convert_args(&new_args, &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_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:176:9 [INFO] [stdout] | [INFO] [stdout] 176 | &args, [INFO] [stdout] | ^^^^^ help: change this to: `args` [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: field `0` is never read [INFO] [stdout] --> tests/setup/dir_diff.rs:20:8 [INFO] [stdout] | [INFO] [stdout] 20 | Io(std::io::Error), [INFO] [stdout] | -- ^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `Error` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 20 - Io(std::io::Error), [INFO] [stdout] 20 + Io(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> tests/setup/dir_diff.rs:22:13 [INFO] [stdout] | [INFO] [stdout] 22 | WalkDir(walkdir::Error), [INFO] [stdout] | ------- ^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `Error` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 22 - WalkDir(walkdir::Error), [INFO] [stdout] 22 + WalkDir(()), [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] --> tests/setup/mod.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 218 | / match path.file_name() { [INFO] [stdout] 219 | | Some(filename) => { [INFO] [stdout] 220 | | let dest_path = dest.join(filename); [INFO] [stdout] 221 | | fs::copy(&path, &dest_path).context(format!( [INFO] [stdout] ... | [INFO] [stdout] 227 | | None => {} [INFO] [stdout] 228 | | } [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] 218 ~ if let Some(filename) = path.file_name() { [INFO] [stdout] 219 + let dest_path = dest.join(filename); [INFO] [stdout] 220 + fs::copy(&path, &dest_path).context(format!( [INFO] [stdout] 221 + "Error copying {} to {}", [INFO] [stdout] 222 + &path.to_str().unwrap(), [INFO] [stdout] 223 + &dest_path.to_str().unwrap() [INFO] [stdout] 224 + ))?; [INFO] [stdout] 225 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> tests/pundit.rs:16:43 [INFO] [stdout] | [INFO] [stdout] 16 | assert!(out.output.lines().all(|line| line != "")); [INFO] [stdout] | ^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> tests/setup/dir_diff.rs:122:59 [INFO] [stdout] | [INFO] [stdout] 122 | get_first_difference(a_base, b_base).map(|difference| !difference.is_none()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `difference.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: unneeded unit return type [INFO] [stdout] --> tests/setup/dir_diff.rs:125:52 [INFO] [stdout] | [INFO] [stdout] 125 | pub fn check_dir_diff(source: &Path, target: &Path) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> tests/setup/mod.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 84 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> tests/setup/mod.rs:91:10 [INFO] [stdout] | [INFO] [stdout] 91 | .expect(&format!("Failed to run command: {}", command)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to run command: {}", command))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:111:34 [INFO] [stdout] | [INFO] [stdout] 111 | &convert_args(&new_args, &env.dir.path())?, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `env.dir.path()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> tests/setup/mod.rs:140:31 [INFO] [stdout] | [INFO] [stdout] 140 | let path = &env.dir.path().clone(); [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] 140 - let path = &env.dir.path().clone(); [INFO] [stdout] 140 + let path = &env.dir.path(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:144:34 [INFO] [stdout] | [INFO] [stdout] 144 | &convert_args(&new_args, &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_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:176:9 [INFO] [stdout] | [INFO] [stdout] 176 | &args, [INFO] [stdout] | ^^^^^ help: change this to: `args` [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] --> tests/setup/dir_diff.rs:122:59 [INFO] [stdout] | [INFO] [stdout] 122 | get_first_difference(a_base, b_base).map(|difference| !difference.is_none()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `difference.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> tests/setup/mod.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 218 | / match path.file_name() { [INFO] [stdout] 219 | | Some(filename) => { [INFO] [stdout] 220 | | let dest_path = dest.join(filename); [INFO] [stdout] 221 | | fs::copy(&path, &dest_path).context(format!( [INFO] [stdout] ... | [INFO] [stdout] 227 | | None => {} [INFO] [stdout] 228 | | } [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] 218 ~ if let Some(filename) = path.file_name() { [INFO] [stdout] 219 + let dest_path = dest.join(filename); [INFO] [stdout] 220 + fs::copy(&path, &dest_path).context(format!( [INFO] [stdout] 221 + "Error copying {} to {}", [INFO] [stdout] 222 + &path.to_str().unwrap(), [INFO] [stdout] 223 + &dest_path.to_str().unwrap() [INFO] [stdout] 224 + ))?; [INFO] [stdout] 225 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> tests/setup/dir_diff.rs:125:52 [INFO] [stdout] | [INFO] [stdout] 125 | pub fn check_dir_diff(source: &Path, target: &Path) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/pankit.rs:109:22 [INFO] [stdout] | [INFO] [stdout] 109 | RelativePath(&DEFAULT_ANKI_SOURCE_COLLECTION_NAME), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `DEFAULT_ANKI_SOURCE_COLLECTION_NAME` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/pankit.rs:110:22 [INFO] [stdout] | [INFO] [stdout] 110 | RelativePath(&DEFAULT_PANKIT_FILE_NAME), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `DEFAULT_PANKIT_FILE_NAME` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> tests/setup/mod.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 84 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> tests/setup/mod.rs:91:10 [INFO] [stdout] | [INFO] [stdout] 91 | .expect(&format!("Failed to run command: {}", command)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to run command: {}", command))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:111:34 [INFO] [stdout] | [INFO] [stdout] 111 | &convert_args(&new_args, &env.dir.path())?, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `env.dir.path()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> tests/setup/mod.rs:140:31 [INFO] [stdout] | [INFO] [stdout] 140 | let path = &env.dir.path().clone(); [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] 140 - let path = &env.dir.path().clone(); [INFO] [stdout] 140 + let path = &env.dir.path(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:144:34 [INFO] [stdout] | [INFO] [stdout] 144 | &convert_args(&new_args, &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_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:176:9 [INFO] [stdout] | [INFO] [stdout] 176 | &args, [INFO] [stdout] | ^^^^^ help: change this to: `args` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> tests/setup/mod.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 218 | / match path.file_name() { [INFO] [stdout] 219 | | Some(filename) => { [INFO] [stdout] 220 | | let dest_path = dest.join(filename); [INFO] [stdout] 221 | | fs::copy(&path, &dest_path).context(format!( [INFO] [stdout] ... | [INFO] [stdout] 227 | | None => {} [INFO] [stdout] 228 | | } [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] 218 ~ if let Some(filename) = path.file_name() { [INFO] [stdout] 219 + let dest_path = dest.join(filename); [INFO] [stdout] 220 + fs::copy(&path, &dest_path).context(format!( [INFO] [stdout] 221 + "Error copying {} to {}", [INFO] [stdout] 222 + &path.to_str().unwrap(), [INFO] [stdout] 223 + &dest_path.to_str().unwrap() [INFO] [stdout] 224 + ))?; [INFO] [stdout] 225 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/pundit.rs:45:14 [INFO] [stdout] | [INFO] [stdout] 45 | fn get_notes<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] 46 | notes: &'a Notes, [INFO] [stdout] | ^^ [INFO] [stdout] 47 | filter: Option, [INFO] [stdout] 48 | ) -> impl Iterator { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 45 ~ fn get_notes( [INFO] [stdout] 46 ~ notes: &Notes, [INFO] [stdout] 47 | filter: Option, [INFO] [stdout] 48 ~ ) -> impl Iterator { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/pundit.rs:55:23 [INFO] [stdout] | [INFO] [stdout] 55 | fn get_notes_filtered<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] 56 | notes: &'a Notes, [INFO] [stdout] | ^^ [INFO] [stdout] 57 | filter: FilterOptions, [INFO] [stdout] 58 | ) -> impl Iterator { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 55 ~ fn get_notes_filtered( [INFO] [stdout] 56 ~ notes: &Notes, [INFO] [stdout] 57 | filter: FilterOptions, [INFO] [stdout] 58 ~ ) -> impl Iterator { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/pundit.rs:146:9 [INFO] [stdout] | [INFO] [stdout] 146 | return Ok(Some(create_new_note_from_query(all_notes, query)?)); [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] 146 - return Ok(Some(create_new_note_from_query(all_notes, query)?)); [INFO] [stdout] 146 + Ok(Some(create_new_note_from_query(all_notes, query)?)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `.iter().next()` on an array [INFO] [stdout] --> tests/pundit_journal.rs:25:18 [INFO] [stdout] | [INFO] [stdout] 25 | let folder = folders.iter().next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try calling: `folders.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_next_slice [INFO] [stdout] = note: `#[warn(clippy::iter_next_slice)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> tests/setup/mod.rs:140:31 [INFO] [stdout] | [INFO] [stdout] 140 | let path = &env.dir.path().clone(); [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] 140 - let path = &env.dir.path().clone(); [INFO] [stdout] 140 + let path = &env.dir.path(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/pundit.rs:137:12 [INFO] [stdout] | [INFO] [stdout] 137 | if query.trim_start_matches(" ") == "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `query.trim_start_matches(" ").is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> tests/setup/dir_diff.rs:122:59 [INFO] [stdout] | [INFO] [stdout] 122 | get_first_difference(a_base, b_base).map(|difference| !difference.is_none()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `difference.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: unneeded unit return type [INFO] [stdout] --> tests/setup/dir_diff.rs:125:52 [INFO] [stdout] | [INFO] [stdout] 125 | pub fn check_dir_diff(source: &Path, target: &Path) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> tests/setup/mod.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 84 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> tests/setup/mod.rs:91:10 [INFO] [stdout] | [INFO] [stdout] 91 | .expect(&format!("Failed to run command: {}", command)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to run command: {}", command))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:111:34 [INFO] [stdout] | [INFO] [stdout] 111 | &convert_args(&new_args, &env.dir.path())?, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `env.dir.path()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:144:34 [INFO] [stdout] | [INFO] [stdout] 144 | &convert_args(&new_args, &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_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:176:9 [INFO] [stdout] | [INFO] [stdout] 176 | &args, [INFO] [stdout] | ^^^^^ help: change this to: `args` [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: comparison to empty slice [INFO] [stdout] --> src/pundit.rs:145:8 [INFO] [stdout] | [INFO] [stdout] 145 | if key != "" || note_info_split.len() != 3 { [INFO] [stdout] | ^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!key.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pundit.rs:222:28 [INFO] [stdout] | [INFO] [stdout] 222 | list_backlinks(¬es, ¬e, l.show_path); [INFO] [stdout] | ^^^^^^ help: change this to: `notes` [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/pundit.rs:222:36 [INFO] [stdout] | [INFO] [stdout] 222 | list_backlinks(¬es, ¬e, l.show_path); [INFO] [stdout] | ^^^^^ help: change this to: `note` [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/pundit.rs:226:48 [INFO] [stdout] | [INFO] [stdout] 226 | find_backlinked_note_interactively(¬es, note)?; [INFO] [stdout] | ^^^^^^ help: change this to: `notes` [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/pundit.rs:230:37 [INFO] [stdout] | [INFO] [stdout] 230 | show_link_interactively(¬es, ¬e1, l.filter)?; [INFO] [stdout] | ^^^^^^ help: change this to: `notes` [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/pundit.rs:230:45 [INFO] [stdout] | [INFO] [stdout] 230 | show_link_interactively(¬es, ¬e1, l.filter)?; [INFO] [stdout] | ^^^^^^ help: change this to: `note1` [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/pundit.rs:235:23 [INFO] [stdout] | [INFO] [stdout] 235 | show_link(¬e1, ¬e2)?; [INFO] [stdout] | ^^^^^^ help: change this to: `note1` [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/pundit.rs:235:31 [INFO] [stdout] | [INFO] [stdout] 235 | show_link(¬e1, ¬e2)?; [INFO] [stdout] | ^^^^^^ help: change this to: `note2` [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/pundit.rs:242:37 [INFO] [stdout] | [INFO] [stdout] 242 | find_note_interactively(¬es, l.filter)?; [INFO] [stdout] | ^^^^^^ help: change this to: `notes` [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/pundit.rs:251:25 [INFO] [stdout] | [INFO] [stdout] 251 | delete_note(¬es, ¬e); [INFO] [stdout] | ^^^^^^ help: change this to: `notes` [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/pundit.rs:251:33 [INFO] [stdout] | [INFO] [stdout] 251 | delete_note(¬es, ¬e); [INFO] [stdout] | ^^^^^ help: change this to: `note` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> tests/setup/mod.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 218 | / match path.file_name() { [INFO] [stdout] 219 | | Some(filename) => { [INFO] [stdout] 220 | | let dest_path = dest.join(filename); [INFO] [stdout] 221 | | fs::copy(&path, &dest_path).context(format!( [INFO] [stdout] ... | [INFO] [stdout] 227 | | None => {} [INFO] [stdout] 228 | | } [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] 218 ~ if let Some(filename) = path.file_name() { [INFO] [stdout] 219 + let dest_path = dest.join(filename); [INFO] [stdout] 220 + fs::copy(&path, &dest_path).context(format!( [INFO] [stdout] 221 + "Error copying {} to {}", [INFO] [stdout] 222 + &path.to_str().unwrap(), [INFO] [stdout] 223 + &dest_path.to_str().unwrap() [INFO] [stdout] 224 + ))?; [INFO] [stdout] 225 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pundit.rs:262:68 [INFO] [stdout] | [INFO] [stdout] 262 | pundit::pankit::update_anki(&l.database, &l.pankit_db, ¬es, l.conflict_handling)? [INFO] [stdout] | ^^^^^^ help: change this to: `notes` [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 following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/pundit.rs:45:14 [INFO] [stdout] | [INFO] [stdout] 45 | fn get_notes<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] 46 | notes: &'a Notes, [INFO] [stdout] | ^^ [INFO] [stdout] 47 | filter: Option, [INFO] [stdout] 48 | ) -> impl Iterator { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 45 ~ fn get_notes( [INFO] [stdout] 46 ~ notes: &Notes, [INFO] [stdout] 47 | filter: Option, [INFO] [stdout] 48 ~ ) -> impl Iterator { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/pundit.rs:55:23 [INFO] [stdout] | [INFO] [stdout] 55 | fn get_notes_filtered<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] 56 | notes: &'a Notes, [INFO] [stdout] | ^^ [INFO] [stdout] 57 | filter: FilterOptions, [INFO] [stdout] 58 | ) -> impl Iterator { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 55 ~ fn get_notes_filtered( [INFO] [stdout] 56 ~ notes: &Notes, [INFO] [stdout] 57 | filter: FilterOptions, [INFO] [stdout] 58 ~ ) -> impl Iterator { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pundit.rs:268:42 [INFO] [stdout] | [INFO] [stdout] 268 | pundit::journal::run_journal(&mut notes, &l)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `notes` [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/pundit.rs:271:38 [INFO] [stdout] | [INFO] [stdout] 271 | pundit::paper::run_paper(&mut notes, &l)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `notes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/pundit.rs:146:9 [INFO] [stdout] | [INFO] [stdout] 146 | return Ok(Some(create_new_note_from_query(all_notes, query)?)); [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] 146 - return Ok(Some(create_new_note_from_query(all_notes, query)?)); [INFO] [stdout] 146 + Ok(Some(create_new_note_from_query(all_notes, query)?)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/pundit.rs:137:12 [INFO] [stdout] | [INFO] [stdout] 137 | if query.trim_start_matches(" ") == "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `query.trim_start_matches(" ").is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> tests/setup/mod.rs:140:31 [INFO] [stdout] | [INFO] [stdout] 140 | let path = &env.dir.path().clone(); [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] 140 - let path = &env.dir.path().clone(); [INFO] [stdout] 140 + let path = &env.dir.path(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/pundit.rs:145:8 [INFO] [stdout] | [INFO] [stdout] 145 | if key != "" || note_info_split.len() != 3 { [INFO] [stdout] | ^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!key.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `success` is never read [INFO] [stdout] --> tests/setup/mod.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 30 | pub struct TestOutput { [INFO] [stdout] | ---------- field in this struct [INFO] [stdout] 31 | pub env: TestEnv, [INFO] [stdout] 32 | pub success: bool, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> tests/setup/dir_diff.rs:20:8 [INFO] [stdout] | [INFO] [stdout] 20 | Io(std::io::Error), [INFO] [stdout] | -- ^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `Error` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 20 - Io(std::io::Error), [INFO] [stdout] 20 + Io(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> tests/setup/dir_diff.rs:22:13 [INFO] [stdout] | [INFO] [stdout] 22 | WalkDir(walkdir::Error), [INFO] [stdout] | ------- ^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `Error` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 22 - WalkDir(walkdir::Error), [INFO] [stdout] 22 + WalkDir(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pundit.rs:222:28 [INFO] [stdout] | [INFO] [stdout] 222 | list_backlinks(¬es, ¬e, l.show_path); [INFO] [stdout] | ^^^^^^ help: change this to: `notes` [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/pundit.rs:222:36 [INFO] [stdout] | [INFO] [stdout] 222 | list_backlinks(¬es, ¬e, l.show_path); [INFO] [stdout] | ^^^^^ help: change this to: `note` [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/pundit.rs:226:48 [INFO] [stdout] | [INFO] [stdout] 226 | find_backlinked_note_interactively(¬es, note)?; [INFO] [stdout] | ^^^^^^ help: change this to: `notes` [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/pundit.rs:230:37 [INFO] [stdout] | [INFO] [stdout] 230 | show_link_interactively(¬es, ¬e1, l.filter)?; [INFO] [stdout] | ^^^^^^ help: change this to: `notes` [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/pundit.rs:230:45 [INFO] [stdout] | [INFO] [stdout] 230 | show_link_interactively(¬es, ¬e1, l.filter)?; [INFO] [stdout] | ^^^^^^ help: change this to: `note1` [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/pundit.rs:235:23 [INFO] [stdout] | [INFO] [stdout] 235 | show_link(¬e1, ¬e2)?; [INFO] [stdout] | ^^^^^^ help: change this to: `note1` [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/pundit.rs:235:31 [INFO] [stdout] | [INFO] [stdout] 235 | show_link(¬e1, ¬e2)?; [INFO] [stdout] | ^^^^^^ help: change this to: `note2` [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/pundit.rs:242:37 [INFO] [stdout] | [INFO] [stdout] 242 | find_note_interactively(¬es, l.filter)?; [INFO] [stdout] | ^^^^^^ help: change this to: `notes` [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/pundit.rs:251:25 [INFO] [stdout] | [INFO] [stdout] 251 | delete_note(¬es, ¬e); [INFO] [stdout] | ^^^^^^ help: change this to: `notes` [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/pundit.rs:251:33 [INFO] [stdout] | [INFO] [stdout] 251 | delete_note(¬es, ¬e); [INFO] [stdout] | ^^^^^ help: change this to: `note` [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/pundit.rs:262:68 [INFO] [stdout] | [INFO] [stdout] 262 | pundit::pankit::update_anki(&l.database, &l.pankit_db, ¬es, l.conflict_handling)? [INFO] [stdout] | ^^^^^^ help: change this to: `notes` [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/pundit.rs:268:42 [INFO] [stdout] | [INFO] [stdout] 268 | pundit::journal::run_journal(&mut notes, &l)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `notes` [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/pundit.rs:271:38 [INFO] [stdout] | [INFO] [stdout] 271 | pundit::paper::run_paper(&mut notes, &l)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `notes` [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] --> tests/setup/dir_diff.rs:122:59 [INFO] [stdout] | [INFO] [stdout] 122 | get_first_difference(a_base, b_base).map(|difference| !difference.is_none()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `difference.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: unneeded unit return type [INFO] [stdout] --> tests/setup/dir_diff.rs:125:52 [INFO] [stdout] | [INFO] [stdout] 125 | pub fn check_dir_diff(source: &Path, target: &Path) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> tests/setup/mod.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 84 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> tests/setup/mod.rs:91:10 [INFO] [stdout] | [INFO] [stdout] 91 | .expect(&format!("Failed to run command: {}", command)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to run command: {}", command))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:111:34 [INFO] [stdout] | [INFO] [stdout] 111 | &convert_args(&new_args, &env.dir.path())?, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `env.dir.path()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:144:34 [INFO] [stdout] | [INFO] [stdout] 144 | &convert_args(&new_args, &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_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/setup/mod.rs:176:9 [INFO] [stdout] | [INFO] [stdout] 176 | &args, [INFO] [stdout] | ^^^^^ help: change this to: `args` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> tests/setup/mod.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 218 | / match path.file_name() { [INFO] [stdout] 219 | | Some(filename) => { [INFO] [stdout] 220 | | let dest_path = dest.join(filename); [INFO] [stdout] 221 | | fs::copy(&path, &dest_path).context(format!( [INFO] [stdout] ... | [INFO] [stdout] 227 | | None => {} [INFO] [stdout] 228 | | } [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] 218 ~ if let Some(filename) = path.file_name() { [INFO] [stdout] 219 + let dest_path = dest.join(filename); [INFO] [stdout] 220 + fs::copy(&path, &dest_path).context(format!( [INFO] [stdout] 221 + "Error copying {} to {}", [INFO] [stdout] 222 + &path.to_str().unwrap(), [INFO] [stdout] 223 + &dest_path.to_str().unwrap() [INFO] [stdout] 224 + ))?; [INFO] [stdout] 225 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/ankitool.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | &Path::new(TEST_SETUPS_PATH), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Path::new(TEST_SETUPS_PATH)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> tests/ankitool.rs:105:39 [INFO] [stdout] | [INFO] [stdout] 105 | let db_path = env.dir.path().join(&DEFAULT_ANKI_SOURCE_COLLECTION_NAME); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `DEFAULT_ANKI_SOURCE_COLLECTION_NAME` [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: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> tests/setup/mod.rs:140:31 [INFO] [stdout] | [INFO] [stdout] 140 | let path = &env.dir.path().clone(); [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] 140 - let path = &env.dir.path().clone(); [INFO] [stdout] 140 + let path = &env.dir.path(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/anki/mod.rs:202:67 [INFO] [stdout] | [INFO] [stdout] 202 | let sfld_contents = get_sort_field_contents(&sort_field_name, &model, note_info)?; [INFO] [stdout] | ^^^^^^ help: change this to: `model` [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/anki/mod.rs:223:31 [INFO] [stdout] | [INFO] [stdout] 223 | Ok(match is_note_id_field(&sort_field_name) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `sort_field_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/anki/mod.rs:344:5 [INFO] [stdout] | [INFO] [stdout] 344 | Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 344 - Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] 344 + connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/anki/mod.rs:344:67 [INFO] [stdout] | [INFO] [stdout] 344 | Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 344 - Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] 344 + Ok(connection.query_row("select ver from col", NO_PARAMS, |r| r.get(0))?) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/anki/mod.rs:202:67 [INFO] [stdout] | [INFO] [stdout] 202 | let sfld_contents = get_sort_field_contents(&sort_field_name, &model, note_info)?; [INFO] [stdout] | ^^^^^^ help: change this to: `model` [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/anki/mod.rs:223:31 [INFO] [stdout] | [INFO] [stdout] 223 | Ok(match is_note_id_field(&sort_field_name) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `sort_field_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ankitool.rs:66:54 [INFO] [stdout] | [INFO] [stdout] 66 | AnkiSubCommand::ListModels(_) => list_models(&collection)?, [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `collection` [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/ankitool.rs:67:52 [INFO] [stdout] | [INFO] [stdout] 67 | AnkiSubCommand::ListDecks(_) => list_decks(&collection)?, [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `collection` [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/ankitool.rs:68:54 [INFO] [stdout] | [INFO] [stdout] 68 | AnkiSubCommand::ListFields(l) => list_fields(&collection, &l.model)?, [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `collection` [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/ankitool.rs:69:60 [INFO] [stdout] | [INFO] [stdout] 69 | AnkiSubCommand::ListTemplates(l) => list_templates(&collection, &l.model)?, [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `collection` [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: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/anki/mod.rs:344:5 [INFO] [stdout] | [INFO] [stdout] 344 | Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 344 - Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] 344 + connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/anki/mod.rs:344:67 [INFO] [stdout] | [INFO] [stdout] 344 | Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 344 - Ok(connection.query_row("select ver from col", NO_PARAMS, |r| Ok(r.get(0)?))?) [INFO] [stdout] 344 + Ok(connection.query_row("select ver from col", NO_PARAMS, |r| r.get(0))?) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ankitool.rs:66:54 [INFO] [stdout] | [INFO] [stdout] 66 | AnkiSubCommand::ListModels(_) => list_models(&collection)?, [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `collection` [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/ankitool.rs:67:52 [INFO] [stdout] | [INFO] [stdout] 67 | AnkiSubCommand::ListDecks(_) => list_decks(&collection)?, [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `collection` [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/ankitool.rs:68:54 [INFO] [stdout] | [INFO] [stdout] 68 | AnkiSubCommand::ListFields(l) => list_fields(&collection, &l.model)?, [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `collection` [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/ankitool.rs:69:60 [INFO] [stdout] | [INFO] [stdout] 69 | AnkiSubCommand::ListTemplates(l) => list_templates(&collection, &l.model)?, [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `collection` [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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 22.13s [INFO] running `Command { std: "docker" "inspect" "57953bae84a7079fcb53123668fa9b72ac2eb8c5fed873f991f30c9e0893bb1d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "57953bae84a7079fcb53123668fa9b72ac2eb8c5fed873f991f30c9e0893bb1d", kill_on_drop: false }` [INFO] [stdout] 57953bae84a7079fcb53123668fa9b72ac2eb8c5fed873f991f30c9e0893bb1d