[INFO] cloning repository https://github.com/lifegpc/pixiv_downloader [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/lifegpc/pixiv_downloader" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Flifegpc%2Fpixiv_downloader", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Flifegpc%2Fpixiv_downloader'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 8173d2a6b35dd8814da71ba3b8d703b3a078fb9f [INFO] linting lifegpc/pixiv_downloader against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Flifegpc%2Fpixiv_downloader" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/lifegpc/pixiv_downloader [INFO] finished tweaking git repo https://github.com/lifegpc/pixiv_downloader [INFO] tweaked toml for git repo https://github.com/lifegpc/pixiv_downloader written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/lifegpc/pixiv_downloader 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/lifegpc/pixiv_downloader 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 git repository `https://github.com/lifegpc/async-trait` [INFO] [stderr] Updating git repository `https://github.com/lifegpc/buf_redux` [INFO] [stderr] Updating git repository `https://github.com/Stebalien/tempfile` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Updating git repository `https://github.com/lifegpc/multipart` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded wreq-util v2.2.1 [INFO] [stderr] Downloaded parse-size v1.0.0 [INFO] [stderr] Downloaded http-content-range v0.1.2 [INFO] [stderr] Downloaded int-enum-impl v0.5.0 [INFO] [stderr] Downloaded derive-getters v0.5.0 [INFO] [stderr] Downloaded RustyXML v0.3.0 [INFO] [stderr] Downloaded dateparser v0.2.1 [INFO] [stderr] Downloaded xml5ever v0.18.1 [INFO] [stderr] Downloaded tokio-boring2 v4.15.13 [INFO] [stderr] Downloaded c_fixed_string v0.2.0 [INFO] [stderr] Downloaded hyper2 v1.5.5 [INFO] [stderr] Downloaded rusqlite v0.29.0 [INFO] [stderr] Downloaded flagset v0.4.5 [INFO] [stderr] Downloaded http2 v0.4.21 [INFO] [stderr] Downloaded boring2 v4.15.13 [INFO] [stderr] Downloaded hyper v0.14.29 [INFO] [stderr] Downloaded gettext v0.4.0 [INFO] [stderr] Downloaded wreq v5.1.0 [INFO] [stderr] Downloaded markup5ever_rcdom v0.3.0 [INFO] [stderr] Downloaded int-enum v0.5.0 [INFO] [stderr] Downloaded boring-sys2 v4.15.13 [INFO] [stderr] Downloaded libsqlite3-sys v0.26.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] 3a5b9235812d080fdfef55dc8ad2177f142b2d5b09ef039c43b6249f69bb499c [INFO] running `Command { std: "docker" "start" "-a" "3a5b9235812d080fdfef55dc8ad2177f142b2d5b09ef039c43b6249f69bb499c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "3a5b9235812d080fdfef55dc8ad2177f142b2d5b09ef039c43b6249f69bb499c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3a5b9235812d080fdfef55dc8ad2177f142b2d5b09ef039c43b6249f69bb499c", kill_on_drop: false }` [INFO] [stdout] 3a5b9235812d080fdfef55dc8ad2177f142b2d5b09ef039c43b6249f69bb499c [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] 57d3cba449acf96a6deb18da32668cc9d71203f9cabea0249324e0837becffe8 [INFO] running `Command { std: "docker" "start" "-a" "57d3cba449acf96a6deb18da32668cc9d71203f9cabea0249324e0837becffe8", kill_on_drop: false }` [INFO] [stderr] Compiling serde v1.0.203 [INFO] [stderr] Compiling siphasher v0.3.11 [INFO] [stderr] Compiling ppv-lite86 v0.2.17 [INFO] [stderr] Compiling libloading v0.8.4 [INFO] [stderr] Compiling regex-automata v0.4.7 [INFO] [stderr] Compiling nom v7.1.3 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Compiling bindgen v0.70.1 [INFO] [stderr] Compiling either v1.13.0 [INFO] [stderr] Compiling syn v2.0.101 [INFO] [stderr] Compiling getrandom v0.2.15 [INFO] [stderr] Checking mio v0.8.11 [INFO] [stderr] Compiling cc v1.2.25 [INFO] [stderr] Compiling bitflags v2.9.1 [INFO] [stderr] Checking miniz_oxide v0.7.4 [INFO] [stderr] Compiling fslock v0.2.1 [INFO] [stderr] Compiling itertools v0.10.5 [INFO] [stderr] Checking parking_lot_core v0.9.10 [INFO] [stderr] Checking encoding_index_tests v0.1.4 [INFO] [stderr] Checking indexmap v2.2.6 [INFO] [stderr] Compiling rand_core v0.6.4 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Compiling phf_shared v0.11.2 [INFO] [stderr] Compiling phf_shared v0.10.0 [INFO] [stderr] Checking parking_lot v0.12.3 [INFO] [stderr] Compiling clang-sys v1.8.1 [INFO] [stderr] Checking http v1.3.1 [INFO] [stderr] Compiling num-bigint v0.2.6 [INFO] [stderr] Compiling thiserror v1.0.61 [INFO] [stderr] Checking mac v0.1.1 [INFO] [stderr] Checking tinyvec v1.6.1 [INFO] [stderr] Compiling rand_chacha v0.3.1 [INFO] [stderr] Checking futf v0.1.5 [INFO] [stderr] Checking flate2 v1.0.30 [INFO] [stderr] Checking brotli v8.0.1 [INFO] [stderr] Compiling num-rational v0.2.4 [INFO] [stderr] Compiling rand v0.8.5 [INFO] [stderr] Compiling num-complex v0.2.4 [INFO] [stderr] Compiling hashbrown v0.14.5 [INFO] [stderr] Compiling num-integer v0.1.46 [INFO] [stderr] Checking precomputed-hash v0.1.1 [INFO] [stderr] Checking tendril v0.4.3 [INFO] [stderr] Compiling cmake v0.1.50 [INFO] [stderr] Checking unicode-normalization v0.1.23 [INFO] [stderr] Checking phf v0.11.2 [INFO] [stderr] Checking http-body v1.0.1 [INFO] [stderr] Checking rustls-pki-types v1.12.0 [INFO] [stderr] Compiling toml_datetime v0.6.6 [INFO] [stderr] Checking idna v0.5.0 [INFO] [stderr] Compiling num-iter v0.1.45 [INFO] [stderr] Compiling phf_generator v0.10.0 [INFO] [stderr] Compiling phf_generator v0.11.2 [INFO] [stderr] Checking webpki-root-certs v1.0.0 [INFO] [stderr] Compiling string_cache_codegen v0.5.2 [INFO] [stderr] Checking sync_wrapper v1.0.2 [INFO] [stderr] Compiling phf_codegen v0.11.2 [INFO] [stderr] Compiling portable-atomic v1.6.0 [INFO] [stderr] Compiling serde_json v1.0.120 [INFO] [stderr] Checking webpki-root-certs v0.26.11 [INFO] [stderr] Compiling zstd-sys v2.0.15+zstd.1.5.7 [INFO] [stderr] Checking linked_hash_set v0.1.5 [INFO] [stderr] Compiling markup5ever v0.12.1 [INFO] [stderr] Checking http-body-util v0.1.3 [INFO] [stderr] Checking ordered-float v2.10.1 [INFO] [stderr] Compiling regex v1.10.5 [INFO] [stderr] Checking url v2.5.2 [INFO] [stderr] Checking encoding-index-singlebyte v1.20141219.5 [INFO] [stderr] Checking encoding-index-tradchinese v1.20141219.5 [INFO] [stderr] Compiling toml_edit v0.19.15 [INFO] [stderr] Checking encoding-index-simpchinese v1.20141219.5 [INFO] [stderr] Compiling num v0.2.1 [INFO] [stderr] Compiling cexpr v0.6.0 [INFO] [stderr] Checking encoding-index-korean v1.20141219.5 [INFO] [stderr] Checking encoding-index-japanese v1.20141219.5 [INFO] [stderr] Checking lru v0.13.0 [INFO] [stderr] Checking antidote v1.0.0 [INFO] [stderr] Compiling convert_case v0.6.0 [INFO] [stderr] Compiling parse_duration v2.1.1 [INFO] [stderr] Checking console v0.15.8 [INFO] [stderr] Checking thread-id v4.2.1 [INFO] [stderr] Compiling json v0.12.4 [INFO] [stderr] Checking encoding v0.2.33 [INFO] [stderr] Compiling pixiv_downloader v0.0.1 (/opt/rustwide/workdir) [INFO] [stderr] Checking fancy-regex v0.11.0 [INFO] [stderr] Checking getopts v0.2.21 [INFO] [stderr] Checking subprocess v0.2.9 [INFO] [stderr] Checking gettext v0.4.0 [INFO] [stderr] Checking http v0.2.12 [INFO] [stderr] Checking is-terminal v0.4.12 [INFO] [stderr] Checking parse-size v1.0.0 [INFO] [stderr] Checking indicatif v0.17.8 [INFO] [stderr] Checking http-content-range v0.1.2 [INFO] [stderr] Checking urlparse v0.7.3 [INFO] [stderr] Checking RustyXML v0.3.0 [INFO] [stderr] Compiling proc-macro-crate v1.3.1 [INFO] [stderr] Compiling darling_core v0.20.10 [INFO] [stderr] Compiling serde_derive v1.0.203 [INFO] [stderr] Compiling tokio-macros v2.3.0 [INFO] [stderr] Compiling futures-macro v0.3.30 [INFO] [stderr] Compiling thiserror-impl v1.0.61 [INFO] [stderr] Compiling foreign-types-macros v0.2.3 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling typed-builder-macro v0.21.0 [INFO] [stderr] Compiling html5ever v0.27.0 [INFO] [stderr] Compiling derive_more v0.99.18 [INFO] [stderr] Compiling derive-getters v0.5.0 [INFO] [stderr] Compiling proc_macros v0.0.1 (/opt/rustwide/workdir/proc_macros) [INFO] [stderr] Checking foreign-types v0.5.0 [INFO] [stderr] Checking futures-util v0.3.30 [INFO] [stderr] Checking tokio v1.38.0 [INFO] [stderr] Compiling derivative v2.2.0 [INFO] [stderr] Compiling int-enum-impl v0.5.0 [INFO] [stderr] Compiling modular-bitfield-impl v0.11.2 [INFO] [stderr] Compiling darling_macro v0.20.10 [INFO] [stderr] Checking typed-builder v0.21.0 [INFO] [stderr] Compiling darling v0.20.10 [INFO] [stderr] Compiling derive_builder_core v0.20.1 [INFO] [stderr] Compiling derive_setters v0.1.6 [INFO] [stderr] Checking int-enum v0.5.0 [INFO] [stderr] Checking modular-bitfield v0.11.2 [INFO] [stderr] Compiling zstd-safe v7.2.4 [INFO] [stderr] Compiling derive_builder_macro v0.20.1 [INFO] [stderr] Checking zstd v0.13.3 [INFO] [stderr] Checking derive_builder v0.20.1 [INFO] [stderr] Compiling boring-sys2 v4.15.13 [INFO] [stderr] Checking tokio-util v0.7.11 [INFO] [stderr] Checking async-compression v0.4.23 [INFO] [stderr] Checking tokio-socks v0.5.2 [INFO] [stderr] Checking tower v0.5.2 [INFO] [stderr] Checking http2 v0.4.21 [INFO] [stderr] Checking log v0.4.27 [INFO] [stderr] Checking string_cache v0.8.7 [INFO] [stderr] Checking chrono v0.4.38 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking serde_yaml v0.9.34+deprecated [INFO] [stderr] Checking serde-value v0.7.0 [INFO] [stderr] Checking hyper2 v1.5.5 [INFO] [stderr] Checking xml5ever v0.18.1 [INFO] [stderr] Checking log4rs v1.3.0 [INFO] [stderr] Checking dateparser v0.2.1 [INFO] [stderr] Checking markup5ever_rcdom v0.3.0 [INFO] [stderr] Checking boring2 v4.15.13 [INFO] [stderr] Checking tokio-boring2 v4.15.13 [INFO] [stderr] Checking wreq v5.1.0 [INFO] [stderr] Checking wreq-util v2.2.1 [INFO] [stdout] warning: unused import: `proc_macros::print_error` [INFO] [stdout] --> src/download.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | use proc_macros::print_error; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/downloader/downloader.rs:178:13 [INFO] [stdout] | [INFO] [stdout] 178 | client: client, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `client` [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/downloader/pd_file/part_status.rs:29:13 [INFO] [stdout] | [INFO] [stdout] 29 | v: v, [INFO] [stdout] | ^^^^ help: replace it with: `v` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `proc_macros::print_error` [INFO] [stdout] --> src/download.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | use proc_macros::print_error; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/downloader/downloader.rs:178:13 [INFO] [stdout] | [INFO] [stdout] 178 | client: client, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `client` [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/downloader/pd_file/part_status.rs:29:13 [INFO] [stdout] | [INFO] [stdout] 29 | v: v, [INFO] [stdout] | ^^^^ help: replace it with: `v` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/i18n.rs:168:23 [INFO] [stdout] | [INFO] [stdout] 168 | return I18n { catalog: catalog }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `catalog` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::path::PathBuf` [INFO] [stdout] --> src/opthelper.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | use std::path::PathBuf; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/i18n.rs:168:23 [INFO] [stdout] | [INFO] [stdout] 168 | return I18n { catalog: catalog }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `catalog` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::path::PathBuf` [INFO] [stdout] --> src/opthelper.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | use std::path::PathBuf; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::ext::cstr::ToCStr` [INFO] [stdout] --> src/ugoira.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use crate::ext::cstr::ToCStr; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::ext::json::ToJson` [INFO] [stdout] --> src/ugoira.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | use crate::ext::json::ToJson; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::ext::try_err::TryErr` [INFO] [stdout] --> src/ugoira.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | use crate::ext::try_err::TryErr; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::ffi::CStr` [INFO] [stdout] --> src/ugoira.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | use std::ffi::CStr; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::ops::Drop` [INFO] [stdout] --> src/ugoira.rs:26:5 [INFO] [stdout] | [INFO] [stdout] 26 | use std::ops::Drop; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::os::raw::c_void` [INFO] [stdout] --> src/ugoira.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | use std::os::raw::c_void; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::ext::cstr::ToCStr` [INFO] [stdout] --> src/ugoira.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use crate::ext::cstr::ToCStr; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::ext::json::ToJson` [INFO] [stdout] --> src/ugoira.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | use crate::ext::json::ToJson; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::ext::try_err::TryErr` [INFO] [stdout] --> src/ugoira.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | use crate::ext::try_err::TryErr; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::ffi::CStr` [INFO] [stdout] --> src/ugoira.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | use std::ffi::CStr; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `File` [INFO] [stdout] --> src/ugoira.rs:24:27 [INFO] [stdout] | [INFO] [stdout] 24 | use std::fs::{create_dir, File}; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::ops::Drop` [INFO] [stdout] --> src/ugoira.rs:26:5 [INFO] [stdout] | [INFO] [stdout] 26 | use std::ops::Drop; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::os::raw::c_void` [INFO] [stdout] --> src/ugoira.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | use std::os::raw::c_void; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/download.rs:1191:9 [INFO] [stdout] | [INFO] [stdout] 1191 | let mut fdata = FanboxData::new(PixivID::FanboxCreator(id.clone()), &*data) [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/download.rs:1191:9 [INFO] [stdout] | [INFO] [stdout] 1191 | let mut fdata = FanboxData::new(PixivID::FanboxCreator(id.clone()), &*data) [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/download.rs:948:17 [INFO] [stdout] | [INFO] [stdout] 948 | let mut datas = data.clone(); [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/download.rs:1086:17 [INFO] [stdout] | [INFO] [stdout] 1086 | let mut datas = data.clone(); [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/download.rs:948:17 [INFO] [stdout] | [INFO] [stdout] 948 | let mut datas = data.clone(); [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/download.rs:1086:17 [INFO] [stdout] | [INFO] [stdout] 1086 | let mut datas = data.clone(); [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `np` [INFO] [stdout] --> src/download.rs:197:5 [INFO] [stdout] | [INFO] [stdout] 197 | np: u16, [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_np` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `datas` [INFO] [stdout] --> src/download.rs:199:5 [INFO] [stdout] | [INFO] [stdout] 199 | datas: Arc, [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_datas` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `file_name` [INFO] [stdout] --> src/download.rs:833:9 [INFO] [stdout] | [INFO] [stdout] 833 | let file_name = ndh [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_file_name` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `np` [INFO] [stdout] --> src/download.rs:197:5 [INFO] [stdout] | [INFO] [stdout] 197 | np: u16, [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_np` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `datas` [INFO] [stdout] --> src/download.rs:199:5 [INFO] [stdout] | [INFO] [stdout] 199 | datas: Arc, [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_datas` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `file_name` [INFO] [stdout] --> src/download.rs:833:9 [INFO] [stdout] | [INFO] [stdout] 833 | let file_name = ndh [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_file_name` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_changed` is never used [INFO] [stdout] --> src/cookies.rs:436:12 [INFO] [stdout] | [INFO] [stdout] 332 | impl CookieJar { [INFO] [stdout] | -------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 436 | pub fn is_changed(&self) -> 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: method `save` is never used [INFO] [stdout] --> src/cookies.rs:509:12 [INFO] [stdout] | [INFO] [stdout] 502 | impl CookieJarManager { [INFO] [stdout] | --------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 509 | pub fn save(&self) { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `save_all_cookies` is never used [INFO] [stdout] --> src/cookies.rs:577:8 [INFO] [stdout] | [INFO] [stdout] 577 | pub fn save_all_cookies() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_downloading` is never used [INFO] [stdout] --> src/downloader/downloader.rs:755:9 [INFO] [stdout] | [INFO] [stdout] 626 | / impl [INFO] [stdout] 627 | | Downloader [INFO] [stdout] | |_________________- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 755 | is_downloading, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this warning originates in the macro `define_downloader_fn` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `close` and `get_part_data` are never used [INFO] [stdout] --> src/downloader/pd_file/file.rs:126:12 [INFO] [stdout] | [INFO] [stdout] 85 | impl PdFile { [INFO] [stdout] | ----------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 126 | pub fn close(&self) -> Result<(), PdFileError> { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 234 | pub fn get_part_data(&self, index: usize) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `ToCStr` is never used [INFO] [stdout] --> src/ext/cstr.rs:23:11 [INFO] [stdout] | [INFO] [stdout] 23 | pub trait ToCStr { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `client` is never read [INFO] [stdout] --> src/fanbox/article/url_embed.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 68 | pub struct FanboxArticleUrlEmbedHTML { [INFO] [stdout] | ------------------------- field in this struct [INFO] [stdout] 69 | pub data: JsonValue, [INFO] [stdout] 70 | client: Arc, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `FormData` is never constructed [INFO] [stdout] --> src/formdata.rs:80:12 [INFO] [stdout] | [INFO] [stdout] 80 | pub struct FormData { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `FormDataError` is never used [INFO] [stdout] --> src/formdata.rs:92:10 [INFO] [stdout] | [INFO] [stdout] 92 | pub enum FormDataError { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `data`, `file`, `part`, and `to_form` are never used [INFO] [stdout] --> src/formdata.rs:98:12 [INFO] [stdout] | [INFO] [stdout] 97 | impl FormData { [INFO] [stdout] | ------------- associated items in this implementation [INFO] [stdout] 98 | pub fn new() -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 102 | pub fn data<'a, K: AsRef + ?Sized, V: AsRef<[u8]> + ?Sized>( [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 115 | pub fn file<'a, K: AsRef + ?Sized, P: AsRef + ?Sized>( [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 128 | pub fn part<'a, K: AsRef + ?Sized>( [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 137 | pub async fn to_form(&self) -> Result { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `ffprobe` and `ffmpeg` are never used [INFO] [stdout] --> src/opthelper.rs:744:12 [INFO] [stdout] | [INFO] [stdout] 54 | impl OptHelper { [INFO] [stdout] | -------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 744 | pub fn ffprobe(&self) -> Option { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 759 | pub fn ffmpeg(&self) -> Option { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `convert_description_to_tg_html` is never used [INFO] [stdout] --> src/parser/description.rs:354:8 [INFO] [stdout] | [INFO] [stdout] 354 | pub fn convert_description_to_tg_html + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `PixivRestrictType` is never used [INFO] [stdout] --> src/pixiv_app.rs:24:10 [INFO] [stdout] | [INFO] [stdout] 24 | pub enum PixivRestrictType { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `PixivRestrictLessType` is never used [INFO] [stdout] --> src/pixiv_app.rs:32:10 [INFO] [stdout] | [INFO] [stdout] 32 | pub enum PixivRestrictLessType { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get_follow`, `get_user_bookmarks`, and `get_user_illusts` are never used [INFO] [stdout] --> src/pixiv_app.rs:271:18 [INFO] [stdout] | [INFO] [stdout] 102 | impl PixivAppClientInternal { [INFO] [stdout] | --------------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 271 | pub async fn get_follow( [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 345 | pub async fn get_user_bookmarks( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 374 | pub async fn get_user_illusts(&self, uid: u64) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get_follow`, `get_user_bookmarks`, and `get_user_illusts` are never used [INFO] [stdout] --> src/pixiv_app.rs:429:18 [INFO] [stdout] | [INFO] [stdout] 398 | impl PixivAppClient { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 429 | pub async fn get_follow( [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 437 | pub async fn get_user_bookmarks( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 447 | pub async fn get_user_illusts( [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get_follow`, `get_user_bookmarks`, and `get_user_works` are never used [INFO] [stdout] --> src/pixiv_web.rs:293:18 [INFO] [stdout] | [INFO] [stdout] 24 | impl PixivWebClient { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 293 | pub async fn get_follow(&self, page: u64, r18: bool) -> Option { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 328 | pub async fn get_user_bookmarks( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 368 | pub async fn get_user_works(&self, uid: u64) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `illusts` and `user` are never read [INFO] [stdout] --> src/pixivapp/illusts.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 8 | pub struct PixivAppIllusts { [INFO] [stdout] | --------------- fields in this struct [INFO] [stdout] 9 | pub illusts: Vec, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 12 | pub user: Option, [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `EveryPushTextType` is never used [INFO] [stdout] --> src/push/every_push.rs:8:10 [INFO] [stdout] | [INFO] [stdout] 8 | pub enum EveryPushTextType { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `EveryPushClient` is never constructed [INFO] [stdout] --> src/push/every_push.rs:30:12 [INFO] [stdout] | [INFO] [stdout] 30 | pub struct EveryPushClient { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new` and `push_message` are never used [INFO] [stdout] --> src/push/every_push.rs:36:12 [INFO] [stdout] | [INFO] [stdout] 35 | impl EveryPushClient { [INFO] [stdout] | -------------------- associated items in this implementation [INFO] [stdout] 36 | pub fn new + ?Sized>(server: &S) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 51 | pub async fn push_message< [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `PushdeerClient` is never constructed [INFO] [stdout] --> src/push/pushdeer.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct PushdeerClient { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `handle_result`, `push_text_message`, `push_image`, and `push_markdown_message` are never used [INFO] [stdout] --> src/push/pushdeer.rs:12:12 [INFO] [stdout] | [INFO] [stdout] 11 | impl PushdeerClient { [INFO] [stdout] | ------------------- associated items in this implementation [INFO] [stdout] 12 | pub fn new + ?Sized>(server: &S) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 19 | async fn handle_result(re: wreq::Response) -> Result<(), String> { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 40 | pub async fn push_text_message + ?Sized, T: AsRef + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 60 | pub async fn push_image + ?Sized, I: AsRef + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 82 | pub async fn push_markdown_message< [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `BotapiClient` is never constructed [INFO] [stdout] --> src/push/telegram/botapi_client.rs:34:12 [INFO] [stdout] | [INFO] [stdout] 34 | pub struct BotapiClient { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple associated items are never used [INFO] [stdout] --> src/push/telegram/botapi_client.rs:52:12 [INFO] [stdout] | [INFO] [stdout] 51 | impl BotapiClient { [INFO] [stdout] | ----------------- associated items in this implementation [INFO] [stdout] 52 | pub fn new(cfg: &BotapiClientConfig) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 66 | pub fn is_custom(&self) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 70 | pub async fn send_animation + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 201 | pub async fn send_document( [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 304 | pub async fn send_photo( [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 402 | pub async fn send_media_group( [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 469 | pub async fn send_message + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 546 | pub async fn send_video + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `MAX_PHOTO_SIZE` is never used [INFO] [stdout] --> src/push/telegram/image.rs:8:11 [INFO] [stdout] | [INFO] [stdout] 8 | pub const MAX_PHOTO_SIZE: u64 = 10485760; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `SupportedImage` is never constructed [INFO] [stdout] --> src/push/telegram/image.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct SupportedImage { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/push/telegram/image.rs:16:12 [INFO] [stdout] | [INFO] [stdout] 15 | impl SupportedImage { [INFO] [stdout] | ------------------- associated function in this implementation [INFO] [stdout] 16 | pub fn new(supported: bool, size_too_big: bool) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_image_size` is never used [INFO] [stdout] --> src/push/telegram/image.rs:24:14 [INFO] [stdout] | [INFO] [stdout] 24 | pub async fn get_image_size + ?Sized, P: AsRef + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `generate_image` is never used [INFO] [stdout] --> src/push/telegram/image.rs:83:14 [INFO] [stdout] | [INFO] [stdout] 83 | pub async fn generate_image + ?Sized, D: AsRef + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_thumbnail_filename` is never used [INFO] [stdout] --> src/push/telegram/image.rs:147:8 [INFO] [stdout] | [INFO] [stdout] 147 | pub fn get_thumbnail_filename( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `is_supported_image` is never used [INFO] [stdout] --> src/push/telegram/image.rs:167:14 [INFO] [stdout] | [INFO] [stdout] 167 | pub async fn is_supported_image + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `encode_data` is never used [INFO] [stdout] --> src/push/telegram/text.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | pub fn encode_data + ?Sized>(data: &S) -> String { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `MessageEntityType` is never used [INFO] [stdout] --> src/push/telegram/text.rs:17:6 [INFO] [stdout] | [INFO] [stdout] 17 | enum MessageEntityType { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_equal` is never used [INFO] [stdout] --> src/push/telegram/text.rs:48:12 [INFO] [stdout] | [INFO] [stdout] 47 | impl MessageEntityType { [INFO] [stdout] | ---------------------- method in this implementation [INFO] [stdout] 48 | pub fn is_equal(&self, s: &str) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `MessageEntity` is never constructed [INFO] [stdout] --> src/push/telegram/text.rs:67:8 [INFO] [stdout] | [INFO] [stdout] 67 | struct MessageEntity { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TextSpliterBuilder` is never constructed [INFO] [stdout] --> src/push/telegram/text.rs:76:12 [INFO] [stdout] | [INFO] [stdout] 76 | pub struct TextSpliterBuilder { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `disable_scan_link`, `max_length`, and `build` are never used [INFO] [stdout] --> src/push/telegram/text.rs:85:12 [INFO] [stdout] | [INFO] [stdout] 83 | impl TextSpliterBuilder { [INFO] [stdout] | ----------------------- methods in this implementation [INFO] [stdout] 84 | /// Disable scanning links in the message text [INFO] [stdout] 85 | pub fn disable_scan_link(mut self) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 91 | pub fn max_length(mut self, max_length: usize) -> Self { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 96 | pub fn build(self) -> TextSpliter { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Stack` is never used [INFO] [stdout] --> src/push/telegram/text.rs:110:6 [INFO] [stdout] | [INFO] [stdout] 110 | enum Stack { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_equal` is never used [INFO] [stdout] --> src/push/telegram/text.rs:116:12 [INFO] [stdout] | [INFO] [stdout] 115 | impl Stack { [INFO] [stdout] | ---------- method in this implementation [INFO] [stdout] 116 | pub fn is_equal(&self, s: &str) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `push_end` is never used [INFO] [stdout] --> src/push/telegram/text.rs:124:4 [INFO] [stdout] | [INFO] [stdout] 124 | fn push_end(ends: &mut BTreeMap>, end: usize, s: String) { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TextSpliter` is never constructed [INFO] [stdout] --> src/push/telegram/text.rs:132:12 [INFO] [stdout] | [INFO] [stdout] 132 | pub struct TextSpliter { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple associated items are never used [INFO] [stdout] --> src/push/telegram/text.rs:140:12 [INFO] [stdout] | [INFO] [stdout] 139 | impl TextSpliter { [INFO] [stdout] | ---------------- associated items in this implementation [INFO] [stdout] 140 | pub fn builder() -> TextSpliterBuilder { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 144 | pub fn get_str(&mut self, len: usize) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 294 | fn is_conflict_with_link_entities(&self, offset: usize, length: usize) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 314 | pub fn is_empty(&self) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 318 | fn is_in_entities(&self, pos: usize) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 327 | fn iter(&mut self, node: &Node) { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 494 | pub fn to_html(&mut self, max_len: Option) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 531 | pub fn parse + ?Sized>(&mut self, text: &S) -> Result<(), PixivDownloaderError> { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 547 | fn scan_link(&mut self) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 583 | fn sort(&mut self) { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 591 | fn text_get(&self, start: usize, end: usize) -> String { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 602 | fn text_len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `BotApiResult` is never used [INFO] [stdout] --> src/push/telegram/tg_type.rs:93:10 [INFO] [stdout] | [INFO] [stdout] 93 | pub enum BotApiResult [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `unwrap` and `to_result` are never used [INFO] [stdout] --> src/push/telegram/tg_type.rs:112:12 [INFO] [stdout] | [INFO] [stdout] 108 | / impl BotApiResult [INFO] [stdout] 109 | | where [INFO] [stdout] 110 | | T: Clone + Serialize, [INFO] [stdout] | |_________________________- methods in this implementation [INFO] [stdout] 111 | { [INFO] [stdout] 112 | pub fn unwrap(self) -> T { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 123 | pub fn to_result(self) -> Result { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Message` is never constructed [INFO] [stdout] --> src/push/telegram/tg_type.rs:138:12 [INFO] [stdout] | [INFO] [stdout] 138 | pub struct Message { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `InputFile` is never used [INFO] [stdout] --> src/push/telegram/tg_type.rs:183:10 [INFO] [stdout] | [INFO] [stdout] 183 | pub enum InputFile { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `get_size` is never used [INFO] [stdout] --> src/push/telegram/tg_type.rs:191:18 [INFO] [stdout] | [INFO] [stdout] 190 | impl InputFile { [INFO] [stdout] | -------------- method in this implementation [INFO] [stdout] 191 | pub async fn get_size(&self) -> Result, std::io::Error> { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `InputMedia` is never used [INFO] [stdout] --> src/push/telegram/tg_type.rs:361:10 [INFO] [stdout] | [INFO] [stdout] 361 | pub enum InputMedia { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `MaxCount` is never constructed [INFO] [stdout] --> src/task_manager.rs:61:12 [INFO] [stdout] | [INFO] [stdout] 61 | pub struct MaxCount { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/task_manager.rs:66:12 [INFO] [stdout] | [INFO] [stdout] 65 | impl MaxCount { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 66 | pub fn new(max_count: usize) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TaskManagerWithId` is never constructed [INFO] [stdout] --> src/task_manager.rs:222:12 [INFO] [stdout] | [INFO] [stdout] 222 | pub struct TaskManagerWithId { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple associated items are never used [INFO] [stdout] --> src/task_manager.rs:240:12 [INFO] [stdout] | [INFO] [stdout] 234 | / impl TaskManagerWithId [INFO] [stdout] 235 | | where [INFO] [stdout] 236 | | K: Eq + std::hash::Hash, [INFO] [stdout] 237 | | O: Send + 'static, [INFO] [stdout] | |______________________- associated items in this implementation [INFO] [stdout] ... [INFO] [stdout] 240 | pub fn new( [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 254 | pub async fn add_pending_task(&self, id: K, future: F) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 274 | pub async fn add_task(&self, id: K, future: F, before_pedding: bool) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 317 | pub async fn check_task(&self) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 343 | pub fn is_pending(&self, id: &K) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 347 | pub fn is_pending_or_running(&self, id: &K) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 351 | pub fn is_running(&self, id: &K) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 356 | pub async fn join(&self) { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 391 | pub fn take_finished_tasks(&self) -> HashMap> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `parse_pixiv_id` is never used [INFO] [stdout] --> src/utils.rs:74:8 [INFO] [stdout] | [INFO] [stdout] 74 | pub fn parse_pixiv_id(id: &JsonValue) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `post_multipart` is never used [INFO] [stdout] --> src/webclient.rs:453:18 [INFO] [stdout] | [INFO] [stdout] 116 | impl WebClient { [INFO] [stdout] | -------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 453 | pub async fn post_multipart( [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option>` which implements the `Copy` trait [INFO] [stdout] --> src/cookies.rs:68:23 [INFO] [stdout] | [INFO] [stdout] 68 | _expired: expired.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `expired` [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: called `unwrap_err` on `u` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:82:17 [INFO] [stdout] | [INFO] [stdout] 78 | if u.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = u` [INFO] [stdout] ... [INFO] [stdout] 82 | u.unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `re` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:124:29 [INFO] [stdout] | [INFO] [stdout] 120 | if re.is_err() { [INFO] [stdout] | -------------- help: try: `if let Err() = re` [INFO] [stdout] ... [INFO] [stdout] 124 | re.unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `re` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:141:25 [INFO] [stdout] | [INFO] [stdout] 137 | if re.is_err() { [INFO] [stdout] | -------------- help: try: `if let Err() = re` [INFO] [stdout] ... [INFO] [stdout] 141 | re.unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/cookies.rs:103:26 [INFO] [stdout] | [INFO] [stdout] 103 | let mut domain = match u.host_str() { [INFO] [stdout] | __________________________^ [INFO] [stdout] 104 | | Some(s) => Some(String::from(s)), [INFO] [stdout] 105 | | None => None, [INFO] [stdout] 106 | | }; [INFO] [stdout] | |_________^ help: try: `u.host_str().map(String::from)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self._expired` after checking its variant with `is_some` [INFO] [stdout] --> src/cookies.rs:212:22 [INFO] [stdout] | [INFO] [stdout] 210 | if self._expired.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = &self._expired` [INFO] [stdout] 211 | let now = Utc::now(); [INFO] [stdout] 212 | if now > self._expired.as_ref().unwrap().clone() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DateTime` which implements the `Copy` trait [INFO] [stdout] --> src/cookies.rs:212:22 [INFO] [stdout] | [INFO] [stdout] 212 | if now > self._expired.as_ref().unwrap().clone() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self._expired.as_ref().unwrap()` [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: called `unwrap_err` on `u` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:231:17 [INFO] [stdout] | [INFO] [stdout] 227 | if u.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = u` [INFO] [stdout] ... [INFO] [stdout] 231 | u.unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/cookies.rs:316:21 [INFO] [stdout] | [INFO] [stdout] 316 | fn cal_md5(cookies: &Vec) -> String { [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] 316 - fn cal_md5(cookies: &Vec) -> String { [INFO] [stdout] 316 + fn cal_md5(cookies: &[CookieJarLine]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/cookies.rs:373:9 [INFO] [stdout] | [INFO] [stdout] 373 | / for i in self.iter() { [INFO] [stdout] 374 | | if i._name == name { [INFO] [stdout] 375 | | return Some(i); [INFO] [stdout] ... | [INFO] [stdout] 378 | | None [INFO] [stdout] | |____________^ help: replace with an iterator: `self.iter().find(|&i| i._name == name).map(|v| v as _)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `re` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:446:73 [INFO] [stdout] | [INFO] [stdout] 445 | if re.is_err() { [INFO] [stdout] | -------------- help: try: `if let Err() = re` [INFO] [stdout] 446 | log::error!("{} {}", gettext("Failed to remove file:"), re.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `re` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:452:69 [INFO] [stdout] | [INFO] [stdout] 451 | if re.is_err() { [INFO] [stdout] | -------------- help: try: `if let Err() = re` [INFO] [stdout] 452 | log::error!("{} {}", gettext("Failed to create file:"), re.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `r` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:459:72 [INFO] [stdout] | [INFO] [stdout] 458 | if r.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = r` [INFO] [stdout] 459 | log::error!("{} {}", gettext("Failed to write file:"), r.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/cookies.rs:481:9 [INFO] [stdout] | [INFO] [stdout] 481 | / loop { [INFO] [stdout] 482 | | match self.iter.next() { [INFO] [stdout] 483 | | Some(item) => match item { [INFO] [stdout] 484 | | CookieJarLine::Cookie(c) => { [INFO] [stdout] ... | [INFO] [stdout] 493 | | } [INFO] [stdout] | |_________^ help: try: `while let Some(item) = self.iter.next() { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` 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/cookies.rs:483:31 [INFO] [stdout] | [INFO] [stdout] 483 | Some(item) => match item { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 484 | | CookieJarLine::Cookie(c) => { [INFO] [stdout] 485 | | return Some(c); [INFO] [stdout] ... | [INFO] [stdout] 488 | | }, [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] 483 ~ Some(item) => if let CookieJarLine::Cookie(c) = item { [INFO] [stdout] 484 + return Some(c); [INFO] [stdout] 485 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/cookies.rs:499:11 [INFO] [stdout] | [INFO] [stdout] 499 | jars: RwLock>, usize)>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` 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/cookies.rs:554:9 [INFO] [stdout] | [INFO] [stdout] 554 | / match jars.get_mut(&path) { [INFO] [stdout] 555 | | Some((jar, count)) => { [INFO] [stdout] 556 | | *count -= 1; [INFO] [stdout] 557 | | if *count == 0 { [INFO] [stdout] ... | [INFO] [stdout] 568 | | None => {} [INFO] [stdout] 569 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 554 ~ if let Some((jar, count)) = jars.get_mut(&path) { [INFO] [stdout] 555 + *count -= 1; [INFO] [stdout] 556 + if *count == 0 { [INFO] [stdout] 557 + if !jar.get_mut().save(&path) { [INFO] [stdout] 558 + log::warn!( [INFO] [stdout] 559 + "{} {}", [INFO] [stdout] 560 + gettext("Warning: Failed to save cookies file:"), [INFO] [stdout] 561 + path.display() [INFO] [stdout] 562 + ); [INFO] [stdout] 563 + } [INFO] [stdout] 564 + jars.remove(&path); [INFO] [stdout] 565 + } [INFO] [stdout] 566 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/data/mod.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod data; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/data/data.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | / if i.is_none() { [INFO] [stdout] 48 | | return None; [INFO] [stdout] 49 | | } [INFO] [stdout] | |_________^ help: replace it with: `i.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `from_*` usually take no `self` [INFO] [stdout] --> src/data/data.rs:61:28 [INFO] [stdout] | [INFO] [stdout] 61 | pub fn from_app_illust(&mut self, illust: &PixivAppIllust) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `ok` [INFO] [stdout] --> src/data/data.rs:78:24 [INFO] [stdout] | [INFO] [stdout] 78 | Some(t) => match PixivAiType::from_int(t as u8) { [INFO] [stdout] | ________________________^ [INFO] [stdout] 79 | | Ok(t) => Some(t), [INFO] [stdout] 80 | | Err(_) => None, [INFO] [stdout] 81 | | }, [INFO] [stdout] | |_____________^ help: replace with: `PixivAiType::from_int(t as u8).ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err [INFO] [stdout] = note: `#[warn(clippy::manual_ok_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `from_*` usually take no `self` [INFO] [stdout] --> src/data/data.rs:90:31 [INFO] [stdout] | [INFO] [stdout] 90 | pub fn from_web_page_data(&mut self, value: &JsonValue, allow_overwrite: bool) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `from_*` usually take no `self` [INFO] [stdout] --> src/data/data.rs:100:36 [INFO] [stdout] | [INFO] [stdout] 100 | pub fn from_web_page_ajax_data(&mut self, value: &JsonValue, allow_overwrite: bool) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `title` after checking its variant with `is_some` [INFO] [stdout] --> src/data/data.rs:104:48 [INFO] [stdout] | [INFO] [stdout] 103 | if title.is_some() { [INFO] [stdout] | ------------------ help: try: `if let Some() = title` [INFO] [stdout] 104 | self.title = Some(String::from(title.unwrap())); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `author` after checking its variant with `is_some` [INFO] [stdout] --> src/data/data.rs:110:26 [INFO] [stdout] | [INFO] [stdout] 109 | if author.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = author` [INFO] [stdout] 110 | let au = author.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `author` after checking its variant with `is_some` [INFO] [stdout] --> src/data/data.rs:114:57 [INFO] [stdout] | [INFO] [stdout] 109 | if author.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = author` [INFO] [stdout] ... [INFO] [stdout] 114 | self.author = Some(String::from(author.unwrap())); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `description` after checking its variant with `is_some` [INFO] [stdout] --> src/data/data.rs:125:35 [INFO] [stdout] | [INFO] [stdout] 124 | if description.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = description` [INFO] [stdout] 125 | let re = unescape(description.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/data/data.rs:141:21 [INFO] [stdout] | [INFO] [stdout] 141 | / match tag["translation"]["en"].as_str() { [INFO] [stdout] 142 | | Some(s) => Some(s.to_owned()), [INFO] [stdout] 143 | | None => None, [INFO] [stdout] 144 | | }, [INFO] [stdout] | |_____________________^ help: try: `tag["translation"]["en"].as_str().map(|s| s.to_owned())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [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/data/data.rs:151:13 [INFO] [stdout] | [INFO] [stdout] 151 | / match ai_type { [INFO] [stdout] 152 | | Some(ai_type) => match PixivAiType::from_int(ai_type) { [INFO] [stdout] 153 | | Ok(ai_type) => { [INFO] [stdout] 154 | | self.ai_type.replace(ai_type); [INFO] [stdout] ... | [INFO] [stdout] 158 | | None => {} [INFO] [stdout] 159 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 151 ~ if let Some(ai_type) = ai_type { match PixivAiType::from_int(ai_type) { [INFO] [stdout] 152 + Ok(ai_type) => { [INFO] [stdout] 153 + self.ai_type.replace(ai_type); [INFO] [stdout] 154 + } [INFO] [stdout] 155 + Err(_) => {} [INFO] [stdout] 156 + } } [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/data/data.rs:152:34 [INFO] [stdout] | [INFO] [stdout] 152 | Some(ai_type) => match PixivAiType::from_int(ai_type) { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 153 | | Ok(ai_type) => { [INFO] [stdout] 154 | | self.ai_type.replace(ai_type); [INFO] [stdout] ... | [INFO] [stdout] 157 | | }, [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 152 ~ Some(ai_type) => if let Ok(ai_type) = PixivAiType::from_int(ai_type) { [INFO] [stdout] 153 + self.ai_type.replace(ai_type); [INFO] [stdout] 154 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/data/fanbox.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | / match id.to_pixiv_id() { [INFO] [stdout] 25 | | Some(id) => Some(Self { [INFO] [stdout] 26 | | id, [INFO] [stdout] 27 | | raw: data.to_json2(), [INFO] [stdout] ... | [INFO] [stdout] 31 | | None => None, [INFO] [stdout] 32 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 24 ~ id.to_pixiv_id().map(|id| Self { [INFO] [stdout] 25 + id, [INFO] [stdout] 26 + raw: data.to_json2(), [INFO] [stdout] 27 + #[cfg(feature = "exif")] [INFO] [stdout] 28 + exif_data: None, [INFO] [stdout] 29 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/data/json.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | / if i.is_none() { [INFO] [stdout] 30 | | return None; [INFO] [stdout] 31 | | } [INFO] [stdout] | |_________^ help: replace it with: `i.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `r` after checking its variant with `is_err` [INFO] [stdout] --> src/data/json.rs:48:73 [INFO] [stdout] | [INFO] [stdout] 47 | if r.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = r` [INFO] [stdout] 48 | log::error!("{} {}", gettext("Failed to remove file:"), r.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `f` after checking its variant with `is_err` [INFO] [stdout] --> src/data/json.rs:59:69 [INFO] [stdout] | [INFO] [stdout] 58 | if f.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = f` [INFO] [stdout] 59 | log::error!("{} {}", gettext("Failed to create file:"), f.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `r` after checking its variant with `is_err` [INFO] [stdout] --> src/data/json.rs:65:68 [INFO] [stdout] | [INFO] [stdout] 64 | if r.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = r` [INFO] [stdout] 65 | log::error!("{} {}", gettext("Failed to write file:"), r.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `p.title` after checking its variant with `is_some` [INFO] [stdout] --> src/data/json.rs:91:28 [INFO] [stdout] | [INFO] [stdout] 90 | if p.title.is_some() { [INFO] [stdout] | -------------------- help: try: `if let Some() = &p.title` [INFO] [stdout] 91 | f.add("title", p.title.as_ref().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `p.author` after checking its variant with `is_some` [INFO] [stdout] --> src/data/json.rs:94:29 [INFO] [stdout] | [INFO] [stdout] 93 | if p.author.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = &p.author` [INFO] [stdout] 94 | f.add("author", p.author.as_ref().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `p.description` after checking its variant with `is_some` [INFO] [stdout] --> src/data/json.rs:97:24 [INFO] [stdout] | [INFO] [stdout] 96 | if p.description.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = &p.description` [INFO] [stdout] 97 | let desc = p.description.as_ref().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `pd` after checking its variant with `is_some` [INFO] [stdout] --> src/data/json.rs:101:45 [INFO] [stdout] | [INFO] [stdout] 100 | if pd.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = pd` [INFO] [stdout] 101 | f.add("parsed_description", pd.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `md` after checking its variant with `is_ok` [INFO] [stdout] --> src/data/json.rs:105:47 [INFO] [stdout] | [INFO] [stdout] 104 | if md.is_ok() { [INFO] [stdout] | ------------- help: try: `if let Ok() = md` [INFO] [stdout] 105 | f.add("markdown_description", md.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [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/data/json.rs:108:9 [INFO] [stdout] | [INFO] [stdout] 108 | / match p.tags.as_ref() { [INFO] [stdout] 109 | | Some(tags) => { [INFO] [stdout] 110 | | let mut t = JsonValue::new_array(); [INFO] [stdout] 111 | | for tag in tags { [INFO] [stdout] ... | [INFO] [stdout] 123 | | None => {} [INFO] [stdout] 124 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 108 ~ if let Some(tags) = p.tags.as_ref() { [INFO] [stdout] 109 + let mut t = JsonValue::new_array(); [INFO] [stdout] 110 + for tag in tags { [INFO] [stdout] 111 + t.push(json::array![ [INFO] [stdout] 112 + tag.0.as_str(), [INFO] [stdout] 113 + match &tag.1 { [INFO] [stdout] 114 + Some(s) => JsonValue::String(s.to_owned()), [INFO] [stdout] 115 + None => JsonValue::Null, [INFO] [stdout] 116 + } [INFO] [stdout] 117 + ]) [INFO] [stdout] 118 + .unwrap(); [INFO] [stdout] 119 + } [INFO] [stdout] 120 + f.add("tags", t); [INFO] [stdout] 121 + } [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/data/video.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | / match &data.title { [INFO] [stdout] 35 | | Some(t) => { [INFO] [stdout] 36 | | m.insert(String::from("title"), t.clone()); [INFO] [stdout] ... | [INFO] [stdout] 39 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 34 ~ if let Some(t) = &data.title { [INFO] [stdout] 35 + m.insert(String::from("title"), t.clone()); [INFO] [stdout] 36 + } [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/data/video.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | / match &data.author { [INFO] [stdout] 41 | | Some(a) => { [INFO] [stdout] 42 | | m.insert(String::from("artist"), a.clone()); [INFO] [stdout] ... | [INFO] [stdout] 45 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 40 ~ if let Some(a) = &data.author { [INFO] [stdout] 41 + m.insert(String::from("artist"), a.clone()); [INFO] [stdout] 42 + } [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/data/video.rs:46:5 [INFO] [stdout] | [INFO] [stdout] 46 | / match &data.description { [INFO] [stdout] 47 | | Some(desc) => { [INFO] [stdout] 48 | | let des = match parse_description(desc) { [INFO] [stdout] 49 | | Some(desc) => desc, [INFO] [stdout] ... | [INFO] [stdout] 54 | | None => {} [INFO] [stdout] 55 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 46 ~ if let Some(desc) = &data.description { [INFO] [stdout] 47 + let des = match parse_description(desc) { [INFO] [stdout] 48 + Some(desc) => desc, [INFO] [stdout] 49 + None => desc.to_owned(), [INFO] [stdout] 50 + }; [INFO] [stdout] 51 + m.insert(String::from("comment"), des); [INFO] [stdout] 52 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/download.rs:71:81 [INFO] [stdout] | [INFO] [stdout] 71 | .add_task(download_artwork(ac.clone(), Arc::clone(&pw), id.clone())) [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*id` [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: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/download.rs:272:16 [INFO] [stdout] | [INFO] [stdout] 272 | if let Err(_) = download_artwork_web(pw.clone(), id).await { [INFO] [stdout] | -------^^^^^^--------------------------------------------- help: try: `if download_artwork_web(pw.clone(), id).await.is_err()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/download.rs:413:5 [INFO] [stdout] | [INFO] [stdout] 413 | return Ok(()); [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] 413 - return Ok(()); [INFO] [stdout] 413 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:292:15 [INFO] [stdout] | [INFO] [stdout] 292 | let src = (&ugoira_data["originalSrc"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `ugoira_data["originalSrc"]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:330:33 [INFO] [stdout] | [INFO] [stdout] 330 | json::stringify((&ugoira_data["frames"]).clone()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `ugoira_data["frames"]` [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 an equality check. Consider using `if` [INFO] [stdout] --> src/download.rs:468:30 [INFO] [stdout] | [INFO] [stdout] 468 | Some(illust_type) => match illust_type { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 469 | | "ugoira" => { [INFO] [stdout] 470 | | return download_artwork_ugoira(pw, id, base, datas).await; [INFO] [stdout] ... | [INFO] [stdout] 473 | | }, [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 468 ~ Some(illust_type) => if illust_type == "ugoira" { [INFO] [stdout] 469 + return download_artwork_ugoira(pw, id, base, datas).await; [INFO] [stdout] 470 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `np` is used as a loop counter [INFO] [stdout] --> src/download.rs:525:9 [INFO] [stdout] | [INFO] [stdout] 525 | for page in data.meta_pages() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (np, page) in data.meta_pages().into_iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `illust_type` after checking its variant with `is_some` [INFO] [stdout] --> src/download.rs:648:27 [INFO] [stdout] | [INFO] [stdout] 647 | if illust_type.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = illust_type` [INFO] [stdout] 648 | let illust_type = illust_type.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `pages_data` after checking its variant with `is_some` [INFO] [stdout] --> src/download.rs:668:26 [INFO] [stdout] | [INFO] [stdout] 666 | if pages_data.is_some() && helper.download_multiple_files() { [INFO] [stdout] | -------------------- the check is happening here [INFO] [stdout] 667 | let mut np = 0u16; [INFO] [stdout] 668 | let pages_data = pages_data.as_ref().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/download.rs:599:5 [INFO] [stdout] | [INFO] [stdout] 599 | let pages; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `pages` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 599 ~ [INFO] [stdout] 600 | let mut ajax_ver = true; [INFO] [stdout] ... [INFO] [stdout] 611 | let re = re.try_err(gettext("Failed to get artwork's data."))?; [INFO] [stdout] 612 ~ let pages = if ajax_ver { [INFO] [stdout] 613 ~ (&re["pageCount"]).as_u64() [INFO] [stdout] 614 | } else { [INFO] [stdout] 615 ~ (&re["illust"][format!("{}", id).as_str()]["pageCount"]).as_u64() [INFO] [stdout] 616 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:613:17 [INFO] [stdout] | [INFO] [stdout] 613 | pages = (&re["pageCount"]).as_u64(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `re["pageCount"]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:615:17 [INFO] [stdout] | [INFO] [stdout] 615 | pages = (&re["illust"][format!("{}", id).as_str()]["pageCount"]).as_u64(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `re["illust"][format!("{}", id).as_str()]["pageCount"]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:643:9 [INFO] [stdout] | [INFO] [stdout] 643 | (&re["illustType"]).as_i64() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `re["illustType"]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:645:9 [INFO] [stdout] | [INFO] [stdout] 645 | (&re["illust"][format!("{}", id).as_str()]["illustType"]).as_i64() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `re["illust"][format!("{}", id).as_str()]["illustType"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `np` is used as a loop counter [INFO] [stdout] --> src/download.rs:710:9 [INFO] [stdout] | [INFO] [stdout] 710 | for page in pages_data.members() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (np, page) in pages_data.members().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:743:13 [INFO] [stdout] | [INFO] [stdout] 743 | (&re["urls"]["original"]).as_str() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `re["urls"]["original"]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:745:13 [INFO] [stdout] | [INFO] [stdout] 745 | (&re["illust"][format!("{}", id)]["urls"]["original"]).as_str() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `re["illust"][format!("{}", id)]["urls"]["original"]` [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/download.rs:818:42 [INFO] [stdout] | [INFO] [stdout] 818 | PixivID::FanboxCreator(f) => format!("{}", f), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `f.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/download.rs:990:25 [INFO] [stdout] | [INFO] [stdout] 990 | / match embed_url { [INFO] [stdout] 991 | | FanboxArticleUrlEmbed::FanboxCreator(creator) => { [INFO] [stdout] 992 | | let profile = creator [INFO] [stdout] 993 | | .profile() [INFO] [stdout] ... | [INFO] [stdout] 1017 | | _ => {} [INFO] [stdout] 1018 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 990 ~ if let FanboxArticleUrlEmbed::FanboxCreator(creator) = embed_url { [INFO] [stdout] 991 + let profile = creator [INFO] [stdout] 992 + .profile() [INFO] [stdout] 993 + .try_err(gettext("Failed to get creator's profile."))?; [INFO] [stdout] 994 + let id = profile [INFO] [stdout] 995 + .creator_id() [INFO] [stdout] 996 + .try_err("Failed to get creator's id.")?; [INFO] [stdout] 997 + match ptasks [INFO] [stdout] 998 + .add_task_else_run_local(download_fanbox_creator_info( [INFO] [stdout] 999 + Arc::clone(&fc), [INFO] [stdout] 1000 + id.to_owned(), [INFO] [stdout] 1001 + Some(profile), [INFO] [stdout] 1002 + None, [INFO] [stdout] 1003 + )) [INFO] [stdout] 1004 + .await [INFO] [stdout] 1005 + { [INFO] [stdout] 1006 + Some(r) => { [INFO] [stdout] 1007 + concat_pixiv_downloader_error!(re, r); [INFO] [stdout] 1008 + } [INFO] [stdout] 1009 + None => { [INFO] [stdout] 1010 + if !download_multiple_files { [INFO] [stdout] 1011 + ptasks.join().await; [INFO] [stdout] 1012 + } [INFO] [stdout] 1013 + } [INFO] [stdout] 1014 + } [INFO] [stdout] 1015 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `np` is used as a loop counter [INFO] [stdout] --> src/download.rs:1090:13 [INFO] [stdout] | [INFO] [stdout] 1090 | for img in images.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (np, img) in images.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [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/download.rs:1219:5 [INFO] [stdout] | [INFO] [stdout] 1219 | / match data.download_cover_image_url()? { [INFO] [stdout] 1220 | | Some(_) => { [INFO] [stdout] 1221 | | total_page += 1; [INFO] [stdout] ... | [INFO] [stdout] 1224 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1219 ~ if let Some(_) = data.download_cover_image_url()? { [INFO] [stdout] 1220 + total_page += 1; [INFO] [stdout] 1221 + } [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/download.rs:1227:9 [INFO] [stdout] | [INFO] [stdout] 1227 | / match data.download_cover_image_url()? { [INFO] [stdout] 1228 | | Some(dh) => { [INFO] [stdout] 1229 | | tasks [INFO] [stdout] 1230 | | .add_task(download_fanbox_image( [INFO] [stdout] ... | [INFO] [stdout] 1248 | | None => {} [INFO] [stdout] 1249 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1227 ~ if let Some(dh) = data.download_cover_image_url()? { [INFO] [stdout] 1228 + tasks [INFO] [stdout] 1229 + .add_task(download_fanbox_image( [INFO] [stdout] 1230 + dh, [INFO] [stdout] 1231 + np, [INFO] [stdout] 1232 + if helper.enable_multi_progress_bar() { [INFO] [stdout] 1233 + Some(get_progress_bar()) [INFO] [stdout] 1234 + } else { [INFO] [stdout] 1235 + None [INFO] [stdout] 1236 + }, [INFO] [stdout] 1237 + Arc::clone(&fdata), [INFO] [stdout] 1238 + Arc::clone(&base), [INFO] [stdout] 1239 + total_page, [INFO] [stdout] 1240 + )) [INFO] [stdout] 1241 + .await; [INFO] [stdout] 1242 + if !download_multiple_files { [INFO] [stdout] 1243 + tasks.join().await; [INFO] [stdout] 1244 + } [INFO] [stdout] 1245 + np += 1; [INFO] [stdout] 1246 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/downloader/mod.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | pub mod downloader; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/downloader/downloader.rs:124:17 [INFO] [stdout] | [INFO] [stdout] 124 | let h = match headers.to_headers() { [INFO] [stdout] | _________________^ [INFO] [stdout] 125 | | Some(h) => h, [INFO] [stdout] 126 | | None => HashMap::new(), [INFO] [stdout] 127 | | }; [INFO] [stdout] | |_________^ help: replace it with: `headers.to_headers().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` 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/downloader/downloader.rs:210:9 [INFO] [stdout] | [INFO] [stdout] 210 | / match self.file.get_mut().deref_mut() { [INFO] [stdout] 211 | | Some(f) => f.clear_file()?, [INFO] [stdout] 212 | | None => {} [INFO] [stdout] 213 | | }; [INFO] [stdout] | |_________^ help: try: `if let Some(f) = self.file.get_mut().deref_mut() { f.clear_file()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/downloader.rs:246:9 [INFO] [stdout] | [INFO] [stdout] 246 | / match mults { [INFO] [stdout] 247 | | Some(bars) => { [INFO] [stdout] 248 | | bar = bars.add(bar); [INFO] [stdout] ... | [INFO] [stdout] 251 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 246 ~ if let Some(bars) = mults { [INFO] [stdout] 247 + bar = bars.add(bar); [INFO] [stdout] 248 + } [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/downloader/downloader.rs:276:9 [INFO] [stdout] | [INFO] [stdout] 276 | / match self.progress.get_ref().deref() { [INFO] [stdout] 277 | | Some(p) => p.finish_with_message(msg), [INFO] [stdout] 278 | | None => {} [INFO] [stdout] 279 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(p) = self.progress.get_ref().deref() { p.finish_with_message(msg) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/downloader.rs:338:9 [INFO] [stdout] | [INFO] [stdout] 338 | / match self.progress.get_ref().deref() { [INFO] [stdout] 339 | | Some(p) => { [INFO] [stdout] 340 | | if !self.progress_has_length.qload() { [INFO] [stdout] 341 | | p.inc_length(delta); [INFO] [stdout] ... | [INFO] [stdout] 345 | | None => {} [INFO] [stdout] 346 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 338 ~ if let Some(p) = self.progress.get_ref().deref() { [INFO] [stdout] 339 + if !self.progress_has_length.qload() { [INFO] [stdout] 340 + p.inc_length(delta); [INFO] [stdout] 341 + } [INFO] [stdout] 342 + p.inc(delta); [INFO] [stdout] 343 + } [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/downloader/downloader.rs:422:9 [INFO] [stdout] | [INFO] [stdout] 422 | / match self.file.get_mut().deref_mut() { [INFO] [stdout] 423 | | Some(f) => f.set_len(size)?, [INFO] [stdout] 424 | | None => {} [INFO] [stdout] 425 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(f) = self.file.get_mut().deref_mut() { f.set_len(size)? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/downloader.rs:447:9 [INFO] [stdout] | [INFO] [stdout] 447 | / match self.progress.get_ref().deref() { [INFO] [stdout] 448 | | Some(p) => p.set_length(length), [INFO] [stdout] 449 | | None => {} [INFO] [stdout] 450 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(p) = self.progress.get_ref().deref() { p.set_length(length) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/downloader.rs:456:9 [INFO] [stdout] | [INFO] [stdout] 456 | / match self.progress.get_ref().deref() { [INFO] [stdout] 457 | | Some(p) => { [INFO] [stdout] 458 | | if !self.progress_has_length.qload() { [INFO] [stdout] 459 | | p.set_length(pos); [INFO] [stdout] ... | [INFO] [stdout] 463 | | None => {} [INFO] [stdout] 464 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 456 ~ if let Some(p) = self.progress.get_ref().deref() { [INFO] [stdout] 457 + if !self.progress_has_length.qload() { [INFO] [stdout] 458 + p.set_length(pos); [INFO] [stdout] 459 + } [INFO] [stdout] 460 + p.set_position(pos); [INFO] [stdout] 461 + } [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/downloader/downloader.rs:470:9 [INFO] [stdout] | [INFO] [stdout] 470 | / match self.progress.get_ref().deref() { [INFO] [stdout] 471 | | Some(p) => p.set_message(msg), [INFO] [stdout] 472 | | None => {} [INFO] [stdout] 473 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(p) = self.progress.get_ref().deref() { p.set_message(msg) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/downloader.rs:497:9 [INFO] [stdout] | [INFO] [stdout] 497 | / match self.file.get_mut().deref_mut() { [INFO] [stdout] 498 | | Some(f) => f.write_all(data)?, [INFO] [stdout] 499 | | None => {} [INFO] [stdout] 500 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(f) = self.file.get_mut().deref_mut() { f.write_all(data)? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/downloader.rs:514:9 [INFO] [stdout] | [INFO] [stdout] 514 | / match self.file.get_mut().deref_mut() { [INFO] [stdout] 515 | | Some(f) => { [INFO] [stdout] 516 | | let offset = [INFO] [stdout] 517 | | (self.get_part_size() as u64) * (index as u64) + (pd.downloaded_size() as u64); [INFO] [stdout] ... | [INFO] [stdout] 521 | | None => {} [INFO] [stdout] 522 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 514 ~ if let Some(f) = self.file.get_mut().deref_mut() { [INFO] [stdout] 515 + let offset = [INFO] [stdout] 516 + (self.get_part_size() as u64) * (index as u64) + (pd.downloaded_size() as u64); [INFO] [stdout] 517 + f.seek(SeekFrom::Start(offset))?; [INFO] [stdout] 518 + f.write_all(data)?; [INFO] [stdout] 519 + } [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/downloader/downloader.rs:702:9 [INFO] [stdout] | [INFO] [stdout] 702 | / match helper.download_retry() { [INFO] [stdout] 703 | | Some(u) => self.set_max_retry_count(u), [INFO] [stdout] 704 | | None => {} [INFO] [stdout] 705 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(u) = helper.download_retry() { self.set_max_retry_count(u) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/downloader.rs:707:9 [INFO] [stdout] | [INFO] [stdout] 707 | / match helper.download_part_retry() { [INFO] [stdout] 708 | | Some(u) => self.set_max_part_retry_count(u), [INFO] [stdout] 709 | | None => {} [INFO] [stdout] 710 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(u) = helper.download_part_retry() { self.set_max_part_retry_count(u) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/downloader/helper.rs:78:21 [INFO] [stdout] | [INFO] [stdout] 78 | None => match crate::utils::get_file_name_from_url(self.url.clone()) { [INFO] [stdout] | _____________________^ [INFO] [stdout] 79 | | Some(file_name) => Some(base.join(file_name)), [INFO] [stdout] 80 | | None => None, [INFO] [stdout] 81 | | }, [INFO] [stdout] | |_____________^ help: try: `crate::utils::get_file_name_from_url(self.url.clone()).map(|file_name| base.join(file_name))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/downloader/local_file.rs:66:9 [INFO] [stdout] | [INFO] [stdout] 66 | &self.file.as_ref().unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.file.as_ref().unwrap()` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/downloader/local_file.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | / match self.path.to_str() { [INFO] [stdout] 74 | | Some(s) => Some(String::from(s)), [INFO] [stdout] 75 | | None => None, [INFO] [stdout] 76 | | } [INFO] [stdout] | |_________^ help: try: `self.path.to_str().map(String::from)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_changed` is never used [INFO] [stdout] --> src/cookies.rs:436:12 [INFO] [stdout] | [INFO] [stdout] 332 | impl CookieJar { [INFO] [stdout] | -------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 436 | pub fn is_changed(&self) -> 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: method `save` is never used [INFO] [stdout] --> src/cookies.rs:509:12 [INFO] [stdout] | [INFO] [stdout] 502 | impl CookieJarManager { [INFO] [stdout] | --------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 509 | pub fn save(&self) { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `save_all_cookies` is never used [INFO] [stdout] --> src/cookies.rs:577:8 [INFO] [stdout] | [INFO] [stdout] 577 | pub fn save_all_cookies() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_downloading` is never used [INFO] [stdout] --> src/downloader/downloader.rs:755:9 [INFO] [stdout] | [INFO] [stdout] 626 | / impl [INFO] [stdout] 627 | | Downloader [INFO] [stdout] | |_________________- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 755 | is_downloading, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this warning originates in the macro `define_downloader_fn` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `close` and `get_part_data` are never used [INFO] [stdout] --> src/downloader/pd_file/file.rs:126:12 [INFO] [stdout] | [INFO] [stdout] 85 | impl PdFile { [INFO] [stdout] | ----------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 126 | pub fn close(&self) -> Result<(), PdFileError> { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 234 | pub fn get_part_data(&self, index: usize) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `ToCStr` is never used [INFO] [stdout] --> src/ext/cstr.rs:23:11 [INFO] [stdout] | [INFO] [stdout] 23 | pub trait ToCStr { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `client` is never read [INFO] [stdout] --> src/fanbox/article/url_embed.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 68 | pub struct FanboxArticleUrlEmbedHTML { [INFO] [stdout] | ------------------------- field in this struct [INFO] [stdout] 69 | pub data: JsonValue, [INFO] [stdout] 70 | client: Arc, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `ffprobe` and `ffmpeg` are never used [INFO] [stdout] --> src/opthelper.rs:744:12 [INFO] [stdout] | [INFO] [stdout] 54 | impl OptHelper { [INFO] [stdout] | -------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 744 | pub fn ffprobe(&self) -> Option { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 759 | pub fn ffmpeg(&self) -> Option { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `PixivRestrictType` is never used [INFO] [stdout] --> src/pixiv_app.rs:24:10 [INFO] [stdout] | [INFO] [stdout] 24 | pub enum PixivRestrictType { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `PixivRestrictLessType` is never used [INFO] [stdout] --> src/pixiv_app.rs:32:10 [INFO] [stdout] | [INFO] [stdout] 32 | pub enum PixivRestrictLessType { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get_follow`, `get_user_bookmarks`, and `get_user_illusts` are never used [INFO] [stdout] --> src/pixiv_app.rs:271:18 [INFO] [stdout] | [INFO] [stdout] 102 | impl PixivAppClientInternal { [INFO] [stdout] | --------------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 271 | pub async fn get_follow( [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 345 | pub async fn get_user_bookmarks( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 374 | pub async fn get_user_illusts(&self, uid: u64) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get_follow`, `get_user_bookmarks`, and `get_user_illusts` are never used [INFO] [stdout] --> src/pixiv_app.rs:429:18 [INFO] [stdout] | [INFO] [stdout] 398 | impl PixivAppClient { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 429 | pub async fn get_follow( [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 437 | pub async fn get_user_bookmarks( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 447 | pub async fn get_user_illusts( [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get_follow`, `get_user_bookmarks`, and `get_user_works` are never used [INFO] [stdout] --> src/pixiv_web.rs:293:18 [INFO] [stdout] | [INFO] [stdout] 24 | impl PixivWebClient { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 293 | pub async fn get_follow(&self, page: u64, r18: bool) -> Option { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 328 | pub async fn get_user_bookmarks( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 368 | pub async fn get_user_works(&self, uid: u64) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `illusts` and `user` are never read [INFO] [stdout] --> src/pixivapp/illusts.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 8 | pub struct PixivAppIllusts { [INFO] [stdout] | --------------- fields in this struct [INFO] [stdout] 9 | pub illusts: Vec, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 12 | pub user: Option, [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `is_custom`, `send_animation`, `send_document`, `send_media_group`, and `send_video` are never used [INFO] [stdout] --> src/push/telegram/botapi_client.rs:66:12 [INFO] [stdout] | [INFO] [stdout] 51 | impl BotapiClient { [INFO] [stdout] | ----------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 66 | pub fn is_custom(&self) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 70 | pub async fn send_animation + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 201 | pub async fn send_document( [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 402 | pub async fn send_media_group( [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 546 | pub async fn send_video + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `MAX_PHOTO_SIZE` is never used [INFO] [stdout] --> src/push/telegram/image.rs:8:11 [INFO] [stdout] | [INFO] [stdout] 8 | pub const MAX_PHOTO_SIZE: u64 = 10485760; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `SupportedImage` is never constructed [INFO] [stdout] --> src/push/telegram/image.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct SupportedImage { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/push/telegram/image.rs:16:12 [INFO] [stdout] | [INFO] [stdout] 15 | impl SupportedImage { [INFO] [stdout] | ------------------- associated function in this implementation [INFO] [stdout] 16 | pub fn new(supported: bool, size_too_big: bool) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_image_size` is never used [INFO] [stdout] --> src/push/telegram/image.rs:24:14 [INFO] [stdout] | [INFO] [stdout] 24 | pub async fn get_image_size + ?Sized, P: AsRef + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `generate_image` is never used [INFO] [stdout] --> src/push/telegram/image.rs:83:14 [INFO] [stdout] | [INFO] [stdout] 83 | pub async fn generate_image + ?Sized, D: AsRef + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_thumbnail_filename` is never used [INFO] [stdout] --> src/push/telegram/image.rs:147:8 [INFO] [stdout] | [INFO] [stdout] 147 | pub fn get_thumbnail_filename( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `is_supported_image` is never used [INFO] [stdout] --> src/push/telegram/image.rs:167:14 [INFO] [stdout] | [INFO] [stdout] 167 | pub async fn is_supported_image + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_empty` is never used [INFO] [stdout] --> src/push/telegram/text.rs:314:12 [INFO] [stdout] | [INFO] [stdout] 139 | impl TextSpliter { [INFO] [stdout] | ---------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 314 | pub fn is_empty(&self) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `to_result` is never used [INFO] [stdout] --> src/push/telegram/tg_type.rs:123:12 [INFO] [stdout] | [INFO] [stdout] 108 | / impl BotApiResult [INFO] [stdout] 109 | | where [INFO] [stdout] 110 | | T: Clone + Serialize, [INFO] [stdout] | |_________________________- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 123 | pub fn to_result(self) -> Result { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `get_size` is never used [INFO] [stdout] --> src/push/telegram/tg_type.rs:191:18 [INFO] [stdout] | [INFO] [stdout] 190 | impl InputFile { [INFO] [stdout] | -------------- method in this implementation [INFO] [stdout] 191 | pub async fn get_size(&self) -> Result, std::io::Error> { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `InputMedia` is never used [INFO] [stdout] --> src/push/telegram/tg_type.rs:361:10 [INFO] [stdout] | [INFO] [stdout] 361 | pub enum InputMedia { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `MaxCount` is never constructed [INFO] [stdout] --> src/task_manager.rs:61:12 [INFO] [stdout] | [INFO] [stdout] 61 | pub struct MaxCount { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/task_manager.rs:66:12 [INFO] [stdout] | [INFO] [stdout] 65 | impl MaxCount { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 66 | pub fn new(max_count: usize) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TaskManagerWithId` is never constructed [INFO] [stdout] --> src/task_manager.rs:222:12 [INFO] [stdout] | [INFO] [stdout] 222 | pub struct TaskManagerWithId { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple associated items are never used [INFO] [stdout] --> src/task_manager.rs:240:12 [INFO] [stdout] | [INFO] [stdout] 234 | / impl TaskManagerWithId [INFO] [stdout] 235 | | where [INFO] [stdout] 236 | | K: Eq + std::hash::Hash, [INFO] [stdout] 237 | | O: Send + 'static, [INFO] [stdout] | |______________________- associated items in this implementation [INFO] [stdout] ... [INFO] [stdout] 240 | pub fn new( [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 254 | pub async fn add_pending_task(&self, id: K, future: F) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 274 | pub async fn add_task(&self, id: K, future: F, before_pedding: bool) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 317 | pub async fn check_task(&self) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 343 | pub fn is_pending(&self, id: &K) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 347 | pub fn is_pending_or_running(&self, id: &K) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 351 | pub fn is_running(&self, id: &K) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 356 | pub async fn join(&self) { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 391 | pub fn take_finished_tasks(&self) -> HashMap> { [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/downloader/pd_file/file.rs:152:17 [INFO] [stdout] | [INFO] [stdout] 152 | / match f.as_mut() { [INFO] [stdout] 153 | | Some(f) => { [INFO] [stdout] 154 | | f.seek(TYPE_OFFSET)?; [INFO] [stdout] 155 | | f.write_le_u8(self.ftype.get_ref().int_value())?; [INFO] [stdout] ... | [INFO] [stdout] 158 | | None => {} [INFO] [stdout] 159 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 152 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 153 + f.seek(TYPE_OFFSET)?; [INFO] [stdout] 154 + f.write_le_u8(self.ftype.get_ref().int_value())?; [INFO] [stdout] 155 + self.need_saved.qstore(false); [INFO] [stdout] 156 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `parse_pixiv_id` is never used [INFO] [stdout] --> src/utils.rs:74:8 [INFO] [stdout] | [INFO] [stdout] 74 | pub fn parse_pixiv_id(id: &JsonValue) -> Option { [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/downloader/pd_file/file.rs:176:17 [INFO] [stdout] | [INFO] [stdout] 176 | / match f.as_mut() { [INFO] [stdout] 177 | | Some(f) => { [INFO] [stdout] 178 | | f.seek(TYPE_OFFSET)?; [INFO] [stdout] 179 | | f.write_le_u8(self.ftype.get_ref().int_value())?; [INFO] [stdout] ... | [INFO] [stdout] 182 | | None => {} [INFO] [stdout] 183 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 176 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 177 + f.seek(TYPE_OFFSET)?; [INFO] [stdout] 178 + f.write_le_u8(self.ftype.get_ref().int_value())?; [INFO] [stdout] 179 + self.need_saved.qstore(false); [INFO] [stdout] 180 + } [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/downloader/pd_file/file.rs:192:9 [INFO] [stdout] | [INFO] [stdout] 192 | / match f.as_mut() { [INFO] [stdout] 193 | | Some(_) => { [INFO] [stdout] 194 | | f.take(); [INFO] [stdout] ... | [INFO] [stdout] 197 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 192 ~ if let Some(_) = f.as_mut() { [INFO] [stdout] 193 + f.take(); [INFO] [stdout] 194 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `index` is used as a loop counter [INFO] [stdout] --> src/downloader/pd_file/file.rs:222:9 [INFO] [stdout] | [INFO] [stdout] 222 | for d in datas.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (index, d) in datas.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [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/downloader/pd_file/file.rs:260:13 [INFO] [stdout] | [INFO] [stdout] 260 | / match f.as_mut() { [INFO] [stdout] 261 | | Some(f) => { [INFO] [stdout] 262 | | f.seek(DOWNLOADED_FILE_SIZE_OFFSET)?; [INFO] [stdout] 263 | | f.write_le_u64(downloaded_size)?; [INFO] [stdout] ... | [INFO] [stdout] 266 | | None => {} [INFO] [stdout] 267 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 260 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 261 + f.seek(DOWNLOADED_FILE_SIZE_OFFSET)?; [INFO] [stdout] 262 + f.write_le_u64(downloaded_size)?; [INFO] [stdout] 263 + self.need_saved.qstore(false); [INFO] [stdout] 264 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/downloader/pd_file/file.rs:277:35 [INFO] [stdout] | [INFO] [stdout] 277 | let mut part_counts = (file_size + (part_size as u64) - 1) / (part_size as u64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `file_size.div_ceil(part_size as u64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/downloader/pd_file/file.rs:314:9 [INFO] [stdout] | [INFO] [stdout] 314 | return true; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 314 - return true; [INFO] [stdout] 314 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option>` which implements the `Copy` trait [INFO] [stdout] --> src/cookies.rs:68:23 [INFO] [stdout] | [INFO] [stdout] 68 | _expired: expired.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `expired` [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: manually reimplementing `div_ceil` [INFO] [stdout] --> src/downloader/pd_file/file.rs:432:31 [INFO] [stdout] | [INFO] [stdout] 432 | let part_counts = (file_size + (part_size as u64) - 1) / (part_size as u64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `file_size.div_ceil(part_size as u64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `u` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:82:17 [INFO] [stdout] | [INFO] [stdout] 78 | if u.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = u` [INFO] [stdout] ... [INFO] [stdout] 82 | u.unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `re` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:124:29 [INFO] [stdout] | [INFO] [stdout] 120 | if re.is_err() { [INFO] [stdout] | -------------- help: try: `if let Err() = re` [INFO] [stdout] ... [INFO] [stdout] 124 | re.unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `re` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:141:25 [INFO] [stdout] | [INFO] [stdout] 137 | if re.is_err() { [INFO] [stdout] | -------------- help: try: `if let Err() = re` [INFO] [stdout] ... [INFO] [stdout] 141 | re.unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/cookies.rs:103:26 [INFO] [stdout] | [INFO] [stdout] 103 | let mut domain = match u.host_str() { [INFO] [stdout] | __________________________^ [INFO] [stdout] 104 | | Some(s) => Some(String::from(s)), [INFO] [stdout] 105 | | None => None, [INFO] [stdout] 106 | | }; [INFO] [stdout] | |_________^ help: try: `u.host_str().map(String::from)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` 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/downloader/pd_file/file.rs:561:13 [INFO] [stdout] | [INFO] [stdout] 561 | / match f.as_mut() { [INFO] [stdout] 562 | | Some(f) => { [INFO] [stdout] 563 | | f.seek(FILE_SIZE_OFFSET)?; [INFO] [stdout] 564 | | f.write_le_u64(file_size)?; [INFO] [stdout] ... | [INFO] [stdout] 567 | | None => {} [INFO] [stdout] 568 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 561 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 562 + f.seek(FILE_SIZE_OFFSET)?; [INFO] [stdout] 563 + f.write_le_u64(file_size)?; [INFO] [stdout] 564 + self.need_saved.qstore(false); [INFO] [stdout] 565 + } [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/downloader/pd_file/file.rs:574:13 [INFO] [stdout] | [INFO] [stdout] 574 | / match f.as_mut() { [INFO] [stdout] 575 | | Some(f) => { [INFO] [stdout] 576 | | f.seek(STATUS_OFFSET)?; [INFO] [stdout] 577 | | f.write_le_u8(self.status.get_ref().int_value())?; [INFO] [stdout] ... | [INFO] [stdout] 580 | | None => {} [INFO] [stdout] 581 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 574 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 575 + f.seek(STATUS_OFFSET)?; [INFO] [stdout] 576 + f.write_le_u8(self.status.get_ref().int_value())?; [INFO] [stdout] 577 + self.need_saved.qstore(false); [INFO] [stdout] 578 + } [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/downloader/pd_file/file.rs:592:13 [INFO] [stdout] | [INFO] [stdout] 592 | / match f.as_mut() { [INFO] [stdout] 593 | | Some(f) => { [INFO] [stdout] 594 | | f.seek(PART_SIZE_OFFSET)?; [INFO] [stdout] 595 | | f.write_le_u32(part_size)?; [INFO] [stdout] ... | [INFO] [stdout] 598 | | None => {} [INFO] [stdout] 599 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 592 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 593 + f.seek(PART_SIZE_OFFSET)?; [INFO] [stdout] 594 + f.write_le_u32(part_size)?; [INFO] [stdout] 595 + self.need_saved.qstore(false); [INFO] [stdout] 596 + } [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/downloader/pd_file/file.rs:615:13 [INFO] [stdout] | [INFO] [stdout] 615 | / match f.as_mut() { [INFO] [stdout] 616 | | Some(f) => { [INFO] [stdout] 617 | | f.seek(SeekFrom::Start( [INFO] [stdout] 618 | | self.part_data_offset.qload() + 2 * (index as u64), [INFO] [stdout] ... | [INFO] [stdout] 623 | | None => {} [INFO] [stdout] 624 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 615 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 616 + f.seek(SeekFrom::Start( [INFO] [stdout] 617 + self.part_data_offset.qload() + 2 * (index as u64), [INFO] [stdout] 618 + ))?; [INFO] [stdout] 619 + part.write_to(f)?; [INFO] [stdout] 620 + self.need_saved.qstore(false); [INFO] [stdout] 621 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self._expired` after checking its variant with `is_some` [INFO] [stdout] --> src/cookies.rs:212:22 [INFO] [stdout] | [INFO] [stdout] 210 | if self._expired.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = &self._expired` [INFO] [stdout] 211 | let now = Utc::now(); [INFO] [stdout] 212 | if now > self._expired.as_ref().unwrap().clone() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `DateTime` which implements the `Copy` trait [INFO] [stdout] --> src/cookies.rs:212:22 [INFO] [stdout] | [INFO] [stdout] 212 | if now > self._expired.as_ref().unwrap().clone() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self._expired.as_ref().unwrap()` [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: called `unwrap_err` on `u` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:231:17 [INFO] [stdout] | [INFO] [stdout] 227 | if u.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = u` [INFO] [stdout] ... [INFO] [stdout] 231 | u.unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/downloader/pd_file/file.rs:656:31 [INFO] [stdout] | [INFO] [stdout] 656 | let part_counts = (file_size + (part_size as u64) - 1) / (part_size as u64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `file_size.div_ceil(part_size as u64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/cookies.rs:316:21 [INFO] [stdout] | [INFO] [stdout] 316 | fn cal_md5(cookies: &Vec) -> String { [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] 316 - fn cal_md5(cookies: &Vec) -> String { [INFO] [stdout] 316 + fn cal_md5(cookies: &[CookieJarLine]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/cookies.rs:373:9 [INFO] [stdout] | [INFO] [stdout] 373 | / for i in self.iter() { [INFO] [stdout] 374 | | if i._name == name { [INFO] [stdout] 375 | | return Some(i); [INFO] [stdout] ... | [INFO] [stdout] 378 | | None [INFO] [stdout] | |____________^ help: replace with an iterator: `self.iter().find(|&i| i._name == name).map(|v| v as _)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `re` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:446:73 [INFO] [stdout] | [INFO] [stdout] 445 | if re.is_err() { [INFO] [stdout] | -------------- help: try: `if let Err() = re` [INFO] [stdout] 446 | log::error!("{} {}", gettext("Failed to remove file:"), re.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `re` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:452:69 [INFO] [stdout] | [INFO] [stdout] 451 | if re.is_err() { [INFO] [stdout] | -------------- help: try: `if let Err() = re` [INFO] [stdout] 452 | log::error!("{} {}", gettext("Failed to create file:"), re.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `r` after checking its variant with `is_err` [INFO] [stdout] --> src/cookies.rs:459:72 [INFO] [stdout] | [INFO] [stdout] 458 | if r.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = r` [INFO] [stdout] 459 | log::error!("{} {}", gettext("Failed to write file:"), r.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/cookies.rs:481:9 [INFO] [stdout] | [INFO] [stdout] 481 | / loop { [INFO] [stdout] 482 | | match self.iter.next() { [INFO] [stdout] 483 | | Some(item) => match item { [INFO] [stdout] 484 | | CookieJarLine::Cookie(c) => { [INFO] [stdout] ... | [INFO] [stdout] 493 | | } [INFO] [stdout] | |_________^ help: try: `while let Some(item) = self.iter.next() { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` 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/cookies.rs:483:31 [INFO] [stdout] | [INFO] [stdout] 483 | Some(item) => match item { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 484 | | CookieJarLine::Cookie(c) => { [INFO] [stdout] 485 | | return Some(c); [INFO] [stdout] ... | [INFO] [stdout] 488 | | }, [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] 483 ~ Some(item) => if let CookieJarLine::Cookie(c) = item { [INFO] [stdout] 484 + return Some(c); [INFO] [stdout] 485 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/cookies.rs:499:11 [INFO] [stdout] | [INFO] [stdout] 499 | jars: RwLock>, usize)>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/downloader/pd_file/version.rs:46:21 [INFO] [stdout] | [INFO] [stdout] 46 | pub fn to_bytes(&self) -> Vec { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/downloader/pd_file/version.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | / let mut data = Vec::new(); [INFO] [stdout] 48 | | data.push(self.major); [INFO] [stdout] 49 | | data.push(self.minor); [INFO] [stdout] | |______________________________^ help: consider using the `vec![]` macro: `let data = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` 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/cookies.rs:554:9 [INFO] [stdout] | [INFO] [stdout] 554 | / match jars.get_mut(&path) { [INFO] [stdout] 555 | | Some((jar, count)) => { [INFO] [stdout] 556 | | *count -= 1; [INFO] [stdout] 557 | | if *count == 0 { [INFO] [stdout] ... | [INFO] [stdout] 568 | | None => {} [INFO] [stdout] 569 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 554 ~ if let Some((jar, count)) = jars.get_mut(&path) { [INFO] [stdout] 555 + *count -= 1; [INFO] [stdout] 556 + if *count == 0 { [INFO] [stdout] 557 + if !jar.get_mut().save(&path) { [INFO] [stdout] 558 + log::warn!( [INFO] [stdout] 559 + "{} {}", [INFO] [stdout] 560 + gettext("Warning: Failed to save cookies file:"), [INFO] [stdout] 561 + path.display() [INFO] [stdout] 562 + ); [INFO] [stdout] 563 + } [INFO] [stdout] 564 + jars.remove(&path); [INFO] [stdout] 565 + } [INFO] [stdout] 566 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/downloader/pd_file/version.rs:90:1 [INFO] [stdout] | [INFO] [stdout] 90 | / impl PartialOrd for PdFileVersion { [INFO] [stdout] 91 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 92 | | let r = self.major.cmp(&other.major); [INFO] [stdout] 93 | | if r.is_eq() { [INFO] [stdout] ... | [INFO] [stdout] 99 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 91 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 92 - let r = self.major.cmp(&other.major); [INFO] [stdout] 93 - if r.is_eq() { [INFO] [stdout] 94 - Some(self.minor.cmp(&other.minor)) [INFO] [stdout] 95 - } else { [INFO] [stdout] 96 - Some(r) [INFO] [stdout] 97 - } [INFO] [stdout] 98 - } [INFO] [stdout] 91 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/downloader/tasks.rs:104:21 [INFO] [stdout] | [INFO] [stdout] 104 | / if start != b.first_byte { [INFO] [stdout] 105 | | true [INFO] [stdout] 106 | | } else { [INFO] [stdout] 107 | | false [INFO] [stdout] 108 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 103 ~ ContentRange::UnboundBytes(b) [INFO] [stdout] 104 ~ if start != b.first_byte => { [INFO] [stdout] 105 | true [INFO] [stdout] 106 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/data/mod.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod data; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/downloader/tasks.rs:95:73 [INFO] [stdout] | [INFO] [stdout] 95 | if file_size != 0 && b.complete_length != file_size { [INFO] [stdout] | _________________________________________________________________________^ [INFO] [stdout] 96 | | true [INFO] [stdout] 97 | | } else if start != b.first_byte { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/downloader/tasks.rs:97:53 [INFO] [stdout] | [INFO] [stdout] 97 | } else if start != b.first_byte { [INFO] [stdout] | _____________________________________________________^ [INFO] [stdout] 98 | | true [INFO] [stdout] 99 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/downloader/tasks.rs:97:28 [INFO] [stdout] | [INFO] [stdout] 97 | } else if start != b.first_byte { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 98 | | true [INFO] [stdout] 99 | | } else { [INFO] [stdout] 100 | | false [INFO] [stdout] 101 | | } [INFO] [stdout] | |_____________________^ help: you can reduce it to: `{ start != b.first_byte }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/downloader/tasks.rs:104:21 [INFO] [stdout] | [INFO] [stdout] 104 | / if start != b.first_byte { [INFO] [stdout] 105 | | true [INFO] [stdout] 106 | | } else { [INFO] [stdout] 107 | | false [INFO] [stdout] 108 | | } [INFO] [stdout] | |_____________________^ help: you can reduce it to: `start != b.first_byte` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/data/data.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | / if i.is_none() { [INFO] [stdout] 48 | | return None; [INFO] [stdout] 49 | | } [INFO] [stdout] | |_________^ help: replace it with: `i.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `from_*` usually take no `self` [INFO] [stdout] --> src/data/data.rs:61:28 [INFO] [stdout] | [INFO] [stdout] 61 | pub fn from_app_illust(&mut self, illust: &PixivAppIllust) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` 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/downloader/tasks.rs:131:9 [INFO] [stdout] | [INFO] [stdout] 131 | / match result.content_length() { [INFO] [stdout] 132 | | Some(len) => { [INFO] [stdout] 133 | | d.pd.set_file_size(len)?; [INFO] [stdout] 134 | | if d.enabled_progress_bar() { [INFO] [stdout] ... | [INFO] [stdout] 139 | | None => {} [INFO] [stdout] 140 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 131 ~ if let Some(len) = result.content_length() { [INFO] [stdout] 132 + d.pd.set_file_size(len)?; [INFO] [stdout] 133 + if d.enabled_progress_bar() { [INFO] [stdout] 134 + d.set_progress_bar_length(len); [INFO] [stdout] 135 + } [INFO] [stdout] 136 + d.set_len(len)?; [INFO] [stdout] 137 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `ok` [INFO] [stdout] --> src/data/data.rs:78:24 [INFO] [stdout] | [INFO] [stdout] 78 | Some(t) => match PixivAiType::from_int(t as u8) { [INFO] [stdout] | ________________________^ [INFO] [stdout] 79 | | Ok(t) => Some(t), [INFO] [stdout] 80 | | Err(_) => None, [INFO] [stdout] 81 | | }, [INFO] [stdout] | |_____________^ help: replace with: `PixivAiType::from_int(t as u8).ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err [INFO] [stdout] = note: `#[warn(clippy::manual_ok_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `from_*` usually take no `self` [INFO] [stdout] --> src/data/data.rs:90:31 [INFO] [stdout] | [INFO] [stdout] 90 | pub fn from_web_page_data(&mut self, value: &JsonValue, allow_overwrite: bool) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `from_*` usually take no `self` [INFO] [stdout] --> src/data/data.rs:100:36 [INFO] [stdout] | [INFO] [stdout] 100 | pub fn from_web_page_ajax_data(&mut self, value: &JsonValue, allow_overwrite: bool) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `title` after checking its variant with `is_some` [INFO] [stdout] --> src/data/data.rs:104:48 [INFO] [stdout] | [INFO] [stdout] 103 | if title.is_some() { [INFO] [stdout] | ------------------ help: try: `if let Some() = title` [INFO] [stdout] 104 | self.title = Some(String::from(title.unwrap())); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `author` after checking its variant with `is_some` [INFO] [stdout] --> src/data/data.rs:110:26 [INFO] [stdout] | [INFO] [stdout] 109 | if author.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = author` [INFO] [stdout] 110 | let au = author.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `author` after checking its variant with `is_some` [INFO] [stdout] --> src/data/data.rs:114:57 [INFO] [stdout] | [INFO] [stdout] 109 | if author.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = author` [INFO] [stdout] ... [INFO] [stdout] 114 | self.author = Some(String::from(author.unwrap())); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `description` after checking its variant with `is_some` [INFO] [stdout] --> src/data/data.rs:125:35 [INFO] [stdout] | [INFO] [stdout] 124 | if description.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = description` [INFO] [stdout] 125 | let re = unescape(description.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/data/data.rs:141:21 [INFO] [stdout] | [INFO] [stdout] 141 | / match tag["translation"]["en"].as_str() { [INFO] [stdout] 142 | | Some(s) => Some(s.to_owned()), [INFO] [stdout] 143 | | None => None, [INFO] [stdout] 144 | | }, [INFO] [stdout] | |_____________________^ help: try: `tag["translation"]["en"].as_str().map(|s| s.to_owned())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [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/data/data.rs:151:13 [INFO] [stdout] | [INFO] [stdout] 151 | / match ai_type { [INFO] [stdout] 152 | | Some(ai_type) => match PixivAiType::from_int(ai_type) { [INFO] [stdout] 153 | | Ok(ai_type) => { [INFO] [stdout] 154 | | self.ai_type.replace(ai_type); [INFO] [stdout] ... | [INFO] [stdout] 158 | | None => {} [INFO] [stdout] 159 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 151 ~ if let Some(ai_type) = ai_type { match PixivAiType::from_int(ai_type) { [INFO] [stdout] 152 + Ok(ai_type) => { [INFO] [stdout] 153 + self.ai_type.replace(ai_type); [INFO] [stdout] 154 + } [INFO] [stdout] 155 + Err(_) => {} [INFO] [stdout] 156 + } } [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/data/data.rs:152:34 [INFO] [stdout] | [INFO] [stdout] 152 | Some(ai_type) => match PixivAiType::from_int(ai_type) { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 153 | | Ok(ai_type) => { [INFO] [stdout] 154 | | self.ai_type.replace(ai_type); [INFO] [stdout] ... | [INFO] [stdout] 157 | | }, [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 152 ~ Some(ai_type) => if let Ok(ai_type) = PixivAiType::from_int(ai_type) { [INFO] [stdout] 153 + self.ai_type.replace(ai_type); [INFO] [stdout] 154 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/data/fanbox.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | / match id.to_pixiv_id() { [INFO] [stdout] 25 | | Some(id) => Some(Self { [INFO] [stdout] 26 | | id, [INFO] [stdout] 27 | | raw: data.to_json2(), [INFO] [stdout] ... | [INFO] [stdout] 31 | | None => None, [INFO] [stdout] 32 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 24 ~ id.to_pixiv_id().map(|id| Self { [INFO] [stdout] 25 + id, [INFO] [stdout] 26 + raw: data.to_json2(), [INFO] [stdout] 27 + #[cfg(feature = "exif")] [INFO] [stdout] 28 + exif_data: None, [INFO] [stdout] 29 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/data/json.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | / if i.is_none() { [INFO] [stdout] 30 | | return None; [INFO] [stdout] 31 | | } [INFO] [stdout] | |_________^ help: replace it with: `i.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `r` after checking its variant with `is_err` [INFO] [stdout] --> src/data/json.rs:48:73 [INFO] [stdout] | [INFO] [stdout] 47 | if r.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = r` [INFO] [stdout] 48 | log::error!("{} {}", gettext("Failed to remove file:"), r.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `f` after checking its variant with `is_err` [INFO] [stdout] --> src/data/json.rs:59:69 [INFO] [stdout] | [INFO] [stdout] 58 | if f.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = f` [INFO] [stdout] 59 | log::error!("{} {}", gettext("Failed to create file:"), f.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `r` after checking its variant with `is_err` [INFO] [stdout] --> src/data/json.rs:65:68 [INFO] [stdout] | [INFO] [stdout] 64 | if r.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = r` [INFO] [stdout] 65 | log::error!("{} {}", gettext("Failed to write file:"), r.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `p.title` after checking its variant with `is_some` [INFO] [stdout] --> src/data/json.rs:91:28 [INFO] [stdout] | [INFO] [stdout] 90 | if p.title.is_some() { [INFO] [stdout] | -------------------- help: try: `if let Some() = &p.title` [INFO] [stdout] 91 | f.add("title", p.title.as_ref().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `p.author` after checking its variant with `is_some` [INFO] [stdout] --> src/data/json.rs:94:29 [INFO] [stdout] | [INFO] [stdout] 93 | if p.author.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = &p.author` [INFO] [stdout] 94 | f.add("author", p.author.as_ref().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `p.description` after checking its variant with `is_some` [INFO] [stdout] --> src/data/json.rs:97:24 [INFO] [stdout] | [INFO] [stdout] 96 | if p.description.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = &p.description` [INFO] [stdout] 97 | let desc = p.description.as_ref().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `pd` after checking its variant with `is_some` [INFO] [stdout] --> src/data/json.rs:101:45 [INFO] [stdout] | [INFO] [stdout] 100 | if pd.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = pd` [INFO] [stdout] 101 | f.add("parsed_description", pd.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `md` after checking its variant with `is_ok` [INFO] [stdout] --> src/data/json.rs:105:47 [INFO] [stdout] | [INFO] [stdout] 104 | if md.is_ok() { [INFO] [stdout] | ------------- help: try: `if let Ok() = md` [INFO] [stdout] 105 | f.add("markdown_description", md.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [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/data/json.rs:108:9 [INFO] [stdout] | [INFO] [stdout] 108 | / match p.tags.as_ref() { [INFO] [stdout] 109 | | Some(tags) => { [INFO] [stdout] 110 | | let mut t = JsonValue::new_array(); [INFO] [stdout] 111 | | for tag in tags { [INFO] [stdout] ... | [INFO] [stdout] 123 | | None => {} [INFO] [stdout] 124 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 108 ~ if let Some(tags) = p.tags.as_ref() { [INFO] [stdout] 109 + let mut t = JsonValue::new_array(); [INFO] [stdout] 110 + for tag in tags { [INFO] [stdout] 111 + t.push(json::array![ [INFO] [stdout] 112 + tag.0.as_str(), [INFO] [stdout] 113 + match &tag.1 { [INFO] [stdout] 114 + Some(s) => JsonValue::String(s.to_owned()), [INFO] [stdout] 115 + None => JsonValue::Null, [INFO] [stdout] 116 + } [INFO] [stdout] 117 + ]) [INFO] [stdout] 118 + .unwrap(); [INFO] [stdout] 119 + } [INFO] [stdout] 120 + f.add("tags", t); [INFO] [stdout] 121 + } [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/data/video.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | / match &data.title { [INFO] [stdout] 35 | | Some(t) => { [INFO] [stdout] 36 | | m.insert(String::from("title"), t.clone()); [INFO] [stdout] ... | [INFO] [stdout] 39 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 34 ~ if let Some(t) = &data.title { [INFO] [stdout] 35 + m.insert(String::from("title"), t.clone()); [INFO] [stdout] 36 + } [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/data/video.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | / match &data.author { [INFO] [stdout] 41 | | Some(a) => { [INFO] [stdout] 42 | | m.insert(String::from("artist"), a.clone()); [INFO] [stdout] ... | [INFO] [stdout] 45 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 40 ~ if let Some(a) = &data.author { [INFO] [stdout] 41 + m.insert(String::from("artist"), a.clone()); [INFO] [stdout] 42 + } [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/data/video.rs:46:5 [INFO] [stdout] | [INFO] [stdout] 46 | / match &data.description { [INFO] [stdout] 47 | | Some(desc) => { [INFO] [stdout] 48 | | let des = match parse_description(desc) { [INFO] [stdout] 49 | | Some(desc) => desc, [INFO] [stdout] ... | [INFO] [stdout] 54 | | None => {} [INFO] [stdout] 55 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 46 ~ if let Some(desc) = &data.description { [INFO] [stdout] 47 + let des = match parse_description(desc) { [INFO] [stdout] 48 + Some(desc) => desc, [INFO] [stdout] 49 + None => desc.to_owned(), [INFO] [stdout] 50 + }; [INFO] [stdout] 51 + m.insert(String::from("comment"), des); [INFO] [stdout] 52 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `dur` after checking its variant with `is_some` [INFO] [stdout] --> src/downloader/tasks.rs:466:23 [INFO] [stdout] | [INFO] [stdout] 465 | if !d.is_multi_threads() && dur.is_some() { [INFO] [stdout] | ------------- the check is happening here [INFO] [stdout] 466 | let dur = dur.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/download.rs:71:81 [INFO] [stdout] | [INFO] [stdout] 71 | .add_task(download_artwork(ac.clone(), Arc::clone(&pw), id.clone())) [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*id` [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: length comparison to zero [INFO] [stdout] --> src/downloader/tasks.rs:474:20 [INFO] [stdout] | [INFO] [stdout] 474 | if d.tasks.get_ref().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `d.tasks.get_ref().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/tasks.rs:475:21 [INFO] [stdout] | [INFO] [stdout] 475 | / match dur { [INFO] [stdout] 476 | | Some(dur) => { [INFO] [stdout] 477 | | if !dur.is_zero() { [INFO] [stdout] 478 | | tokio::time::sleep(dur).await; [INFO] [stdout] ... | [INFO] [stdout] 484 | | None => {} [INFO] [stdout] 485 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 475 ~ if let Some(dur) = dur { [INFO] [stdout] 476 + if !dur.is_zero() { [INFO] [stdout] 477 + tokio::time::sleep(dur).await; [INFO] [stdout] 478 + } [INFO] [stdout] 479 + let task = [INFO] [stdout] 480 + tokio::spawn(create_download_tasks_multi_first(Arc::clone(&d))); [INFO] [stdout] 481 + d.add_task(task); [INFO] [stdout] 482 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.num` after checking its variant with `is_some` [INFO] [stdout] --> src/dur.rs:38:41 [INFO] [stdout] | [INFO] [stdout] 37 | if self.num.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = self.num` [INFO] [stdout] 38 | Duration::from_secs(self.num.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.num` after checking its variant with `is_some` [INFO] [stdout] --> src/dur.rs:45:43 [INFO] [stdout] | [INFO] [stdout] 44 | if self.num.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = self.num` [INFO] [stdout] 45 | Duration::from_millis(self.num.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.num` after checking its variant with `is_some` [INFO] [stdout] --> src/dur.rs:52:42 [INFO] [stdout] | [INFO] [stdout] 51 | if self.num.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = self.num` [INFO] [stdout] 52 | Duration::from_nanos(self.num.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `num` after checking its variant with `is_ok` [INFO] [stdout] --> src/dur.rs:67:38 [INFO] [stdout] | [INFO] [stdout] 66 | if num.is_ok() { [INFO] [stdout] | -------------- help: try: `if let Ok() = num` [INFO] [stdout] 67 | return Ok(Self::from_num(num.unwrap())); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.num` after checking its variant with `is_some` [INFO] [stdout] --> src/dur.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 79 | if self.num.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = &self.num` [INFO] [stdout] 80 | self.num.as_ref().unwrap() == other [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.f` after checking its variant with `is_some` [INFO] [stdout] --> src/dur.rs:90:13 [INFO] [stdout] | [INFO] [stdout] 89 | if self.f.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = &self.f` [INFO] [stdout] 90 | self.f.as_ref().unwrap() == other [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `HTTP` contains a capitalized acronym [INFO] [stdout] --> src/error.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | HTTP(http::Error), [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Http` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/download.rs:272:16 [INFO] [stdout] | [INFO] [stdout] 272 | if let Err(_) = download_artwork_web(pw.clone(), id).await { [INFO] [stdout] | -------^^^^^^--------------------------------------------- help: try: `if download_artwork_web(pw.clone(), id).await.is_err()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/download.rs:413:5 [INFO] [stdout] | [INFO] [stdout] 413 | return Ok(()); [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] 413 - return Ok(()); [INFO] [stdout] 413 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:292:15 [INFO] [stdout] | [INFO] [stdout] 292 | let src = (&ugoira_data["originalSrc"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `ugoira_data["originalSrc"]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:330:33 [INFO] [stdout] | [INFO] [stdout] 330 | json::stringify((&ugoira_data["frames"]).clone()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `ugoira_data["frames"]` [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/ext/cstr.rs:71:6 [INFO] [stdout] | [INFO] [stdout] 71 | impl<'a, T: ToCStr> ToCStr for &'a T { [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] 71 - impl<'a, T: ToCStr> ToCStr for &'a T { [INFO] [stdout] 71 + impl ToCStr for &T { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/download.rs:468:30 [INFO] [stdout] | [INFO] [stdout] 468 | Some(illust_type) => match illust_type { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 469 | | "ugoira" => { [INFO] [stdout] 470 | | return download_artwork_ugoira(pw, id, base, datas).await; [INFO] [stdout] ... | [INFO] [stdout] 473 | | }, [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 468 ~ Some(illust_type) => if illust_type == "ugoira" { [INFO] [stdout] 469 + return download_artwork_ugoira(pw, id, base, datas).await; [INFO] [stdout] 470 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `np` is used as a loop counter [INFO] [stdout] --> src/download.rs:525:9 [INFO] [stdout] | [INFO] [stdout] 525 | for page in data.meta_pages() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (np, page) in data.meta_pages().into_iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/ext/json.rs:98:30 [INFO] [stdout] | [INFO] [stdout] 98 | Some(JsonValue::from(self.clone())) [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*self` [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 `bool` which implements the `Copy` trait [INFO] [stdout] --> src/ext/json.rs:105:25 [INFO] [stdout] | [INFO] [stdout] 105 | JsonValue::from(self.clone()) [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*self` [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: called `unwrap` on `illust_type` after checking its variant with `is_some` [INFO] [stdout] --> src/download.rs:648:27 [INFO] [stdout] | [INFO] [stdout] 647 | if illust_type.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = illust_type` [INFO] [stdout] 648 | let illust_type = illust_type.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `pages_data` after checking its variant with `is_some` [INFO] [stdout] --> src/download.rs:668:26 [INFO] [stdout] | [INFO] [stdout] 666 | if pages_data.is_some() && helper.download_multiple_files() { [INFO] [stdout] | -------------------- the check is happening here [INFO] [stdout] 667 | let mut np = 0u16; [INFO] [stdout] 668 | let pages_data = pages_data.as_ref().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/download.rs:599:5 [INFO] [stdout] | [INFO] [stdout] 599 | let pages; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `pages` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 599 ~ [INFO] [stdout] 600 | let mut ajax_ver = true; [INFO] [stdout] ... [INFO] [stdout] 611 | let re = re.try_err(gettext("Failed to get artwork's data."))?; [INFO] [stdout] 612 ~ let pages = if ajax_ver { [INFO] [stdout] 613 ~ (&re["pageCount"]).as_u64() [INFO] [stdout] 614 | } else { [INFO] [stdout] 615 ~ (&re["illust"][format!("{}", id).as_str()]["pageCount"]).as_u64() [INFO] [stdout] 616 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:613:17 [INFO] [stdout] | [INFO] [stdout] 613 | pages = (&re["pageCount"]).as_u64(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `re["pageCount"]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:615:17 [INFO] [stdout] | [INFO] [stdout] 615 | pages = (&re["illust"][format!("{}", id).as_str()]["pageCount"]).as_u64(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `re["illust"][format!("{}", id).as_str()]["pageCount"]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:643:9 [INFO] [stdout] | [INFO] [stdout] 643 | (&re["illustType"]).as_i64() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `re["illustType"]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:645:9 [INFO] [stdout] | [INFO] [stdout] 645 | (&re["illust"][format!("{}", id).as_str()]["illustType"]).as_i64() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `re["illust"][format!("{}", id).as_str()]["illustType"]` [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/ext/subprocess.rs:17:17 [INFO] [stdout] | [INFO] [stdout] 17 | return std::task::Poll::Pending; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 17 - return std::task::Poll::Pending; [INFO] [stdout] 17 + std::task::Poll::Pending [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/ext/use_or_not.rs:40:1 [INFO] [stdout] | [INFO] [stdout] 40 | / impl Default for UseOrNot { [INFO] [stdout] 41 | | fn default() -> Self { [INFO] [stdout] 42 | | Self::Auto [INFO] [stdout] 43 | | } [INFO] [stdout] 44 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 8 + #[derive(Default)] [INFO] [stdout] 9 | pub enum UseOrNot { [INFO] [stdout] 10 | /// Auto Detect [INFO] [stdout] 11 ~ #[default] [INFO] [stdout] 12 ~ Auto, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `np` is used as a loop counter [INFO] [stdout] --> src/download.rs:710:9 [INFO] [stdout] | [INFO] [stdout] 710 | for page in pages_data.members() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (np, page) in pages_data.members().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:743:13 [INFO] [stdout] | [INFO] [stdout] 743 | (&re["urls"]["original"]).as_str() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `re["urls"]["original"]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/download.rs:745:13 [INFO] [stdout] | [INFO] [stdout] 745 | (&re["illust"][format!("{}", id)]["urls"]["original"]).as_str() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `re["illust"][format!("{}", id)]["urls"]["original"]` [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 `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/fanbox/article/block.rs:60:24 [INFO] [stdout] | [INFO] [stdout] 60 | Some(t) => match t { [INFO] [stdout] | ________________________^ [INFO] [stdout] 61 | | "bold" => Self::Bold(FanboxArticleParagraphBoldStyle::new(data)), [INFO] [stdout] 62 | | _ => Self::Unknown(data.clone()), [INFO] [stdout] 63 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/fanbox/article/block.rs:60:18 [INFO] [stdout] | [INFO] [stdout] 60 | Some(t) => match t { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 61 | "bold" => Self::Bold(FanboxArticleParagraphBoldStyle::new(data)), [INFO] [stdout] | ^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/download.rs:818:42 [INFO] [stdout] | [INFO] [stdout] 818 | PixivID::FanboxCreator(f) => format!("{}", f), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `f.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/article/block.rs:142:9 [INFO] [stdout] | [INFO] [stdout] 142 | / match self.styles() { [INFO] [stdout] 143 | | Some(styles) => { [INFO] [stdout] 144 | | for style in styles { [INFO] [stdout] 145 | | style.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 148 | | None => {} [INFO] [stdout] 149 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 142 ~ if let Some(styles) = self.styles() { [INFO] [stdout] 143 + for style in styles { [INFO] [stdout] 144 + style.check_unknown()?; [INFO] [stdout] 145 + } [INFO] [stdout] 146 + } [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/download.rs:990:25 [INFO] [stdout] | [INFO] [stdout] 990 | / match embed_url { [INFO] [stdout] 991 | | FanboxArticleUrlEmbed::FanboxCreator(creator) => { [INFO] [stdout] 992 | | let profile = creator [INFO] [stdout] 993 | | .profile() [INFO] [stdout] ... | [INFO] [stdout] 1017 | | _ => {} [INFO] [stdout] 1018 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 990 ~ if let FanboxArticleUrlEmbed::FanboxCreator(creator) = embed_url { [INFO] [stdout] 991 + let profile = creator [INFO] [stdout] 992 + .profile() [INFO] [stdout] 993 + .try_err(gettext("Failed to get creator's profile."))?; [INFO] [stdout] 994 + let id = profile [INFO] [stdout] 995 + .creator_id() [INFO] [stdout] 996 + .try_err("Failed to get creator's id.")?; [INFO] [stdout] 997 + match ptasks [INFO] [stdout] 998 + .add_task_else_run_local(download_fanbox_creator_info( [INFO] [stdout] 999 + Arc::clone(&fc), [INFO] [stdout] 1000 + id.to_owned(), [INFO] [stdout] 1001 + Some(profile), [INFO] [stdout] 1002 + None, [INFO] [stdout] 1003 + )) [INFO] [stdout] 1004 + .await [INFO] [stdout] 1005 + { [INFO] [stdout] 1006 + Some(r) => { [INFO] [stdout] 1007 + concat_pixiv_downloader_error!(re, r); [INFO] [stdout] 1008 + } [INFO] [stdout] 1009 + None => { [INFO] [stdout] 1010 + if !download_multiple_files { [INFO] [stdout] 1011 + ptasks.join().await; [INFO] [stdout] 1012 + } [INFO] [stdout] 1013 + } [INFO] [stdout] 1014 + } [INFO] [stdout] 1015 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `np` is used as a loop counter [INFO] [stdout] --> src/download.rs:1090:13 [INFO] [stdout] | [INFO] [stdout] 1090 | for img in images.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (np, img) in images.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [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/fanbox/article/body.rs:84:9 [INFO] [stdout] | [INFO] [stdout] 84 | / match self.blocks() { [INFO] [stdout] 85 | | Some(blocks) => { [INFO] [stdout] 86 | | for i in blocks { [INFO] [stdout] 87 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 90 | | None => {} [INFO] [stdout] 91 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 84 ~ if let Some(blocks) = self.blocks() { [INFO] [stdout] 85 + for i in blocks { [INFO] [stdout] 86 + i.check_unknown()?; [INFO] [stdout] 87 + } [INFO] [stdout] 88 + } [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/fanbox/article/body.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 92 | / match self.file_map() { [INFO] [stdout] 93 | | Some(map) => { [INFO] [stdout] 94 | | map.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 97 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 92 ~ if let Some(map) = self.file_map() { [INFO] [stdout] 93 + map.check_unknown()?; [INFO] [stdout] 94 + } [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/fanbox/article/body.rs:98:9 [INFO] [stdout] | [INFO] [stdout] 98 | / match self.image_map() { [INFO] [stdout] 99 | | Some(map) => { [INFO] [stdout] 100 | | map.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 103 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 98 ~ if let Some(map) = self.image_map() { [INFO] [stdout] 99 + map.check_unknown()?; [INFO] [stdout] 100 + } [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/fanbox/article/body.rs:104:9 [INFO] [stdout] | [INFO] [stdout] 104 | / match self.url_embed_map() { [INFO] [stdout] 105 | | Some(map) => { [INFO] [stdout] 106 | | map.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 109 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 104 ~ if let Some(map) = self.url_embed_map() { [INFO] [stdout] 105 + map.check_unknown()?; [INFO] [stdout] 106 + } [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/fanbox/article/file.rs:38:13 [INFO] [stdout] | [INFO] [stdout] 38 | / match self.get_file(key) { [INFO] [stdout] 39 | | Some(i) => { [INFO] [stdout] 40 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 43 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 38 ~ if let Some(i) = self.get_file(key) { [INFO] [stdout] 39 + i.check_unknown()?; [INFO] [stdout] 40 + } [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/download.rs:1219:5 [INFO] [stdout] | [INFO] [stdout] 1219 | / match data.download_cover_image_url()? { [INFO] [stdout] 1220 | | Some(_) => { [INFO] [stdout] 1221 | | total_page += 1; [INFO] [stdout] ... | [INFO] [stdout] 1224 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1219 ~ if let Some(_) = data.download_cover_image_url()? { [INFO] [stdout] 1220 + total_page += 1; [INFO] [stdout] 1221 + } [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/download.rs:1227:9 [INFO] [stdout] | [INFO] [stdout] 1227 | / match data.download_cover_image_url()? { [INFO] [stdout] 1228 | | Some(dh) => { [INFO] [stdout] 1229 | | tasks [INFO] [stdout] 1230 | | .add_task(download_fanbox_image( [INFO] [stdout] ... | [INFO] [stdout] 1248 | | None => {} [INFO] [stdout] 1249 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1227 ~ if let Some(dh) = data.download_cover_image_url()? { [INFO] [stdout] 1228 + tasks [INFO] [stdout] 1229 + .add_task(download_fanbox_image( [INFO] [stdout] 1230 + dh, [INFO] [stdout] 1231 + np, [INFO] [stdout] 1232 + if helper.enable_multi_progress_bar() { [INFO] [stdout] 1233 + Some(get_progress_bar()) [INFO] [stdout] 1234 + } else { [INFO] [stdout] 1235 + None [INFO] [stdout] 1236 + }, [INFO] [stdout] 1237 + Arc::clone(&fdata), [INFO] [stdout] 1238 + Arc::clone(&base), [INFO] [stdout] 1239 + total_page, [INFO] [stdout] 1240 + )) [INFO] [stdout] 1241 + .await; [INFO] [stdout] 1242 + if !download_multiple_files { [INFO] [stdout] 1243 + tasks.join().await; [INFO] [stdout] 1244 + } [INFO] [stdout] 1245 + np += 1; [INFO] [stdout] 1246 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/downloader/mod.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | pub mod downloader; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/downloader/downloader.rs:124:17 [INFO] [stdout] | [INFO] [stdout] 124 | let h = match headers.to_headers() { [INFO] [stdout] | _________________^ [INFO] [stdout] 125 | | Some(h) => h, [INFO] [stdout] 126 | | None => HashMap::new(), [INFO] [stdout] 127 | | }; [INFO] [stdout] | |_________^ help: replace it with: `headers.to_headers().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` 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/fanbox/article/image.rs:120:13 [INFO] [stdout] | [INFO] [stdout] 120 | / match self.get_image(key) { [INFO] [stdout] 121 | | Some(i) => { [INFO] [stdout] 122 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 125 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 120 ~ if let Some(i) = self.get_image(key) { [INFO] [stdout] 121 + i.check_unknown()?; [INFO] [stdout] 122 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/fanbox/article/url_embed.rs:35:37 [INFO] [stdout] | [INFO] [stdout] 35 | Some(FanboxCreator::new(&profile, Arc::clone(&self.client))) [INFO] [stdout] | ^^^^^^^^ help: change this to: `profile` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/article/url_embed.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | / match self.profile() { [INFO] [stdout] 50 | | Some(profile) => { [INFO] [stdout] 51 | | profile.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 49 ~ if let Some(profile) = self.profile() { [INFO] [stdout] 50 + profile.check_unknown()?; [INFO] [stdout] 51 + } [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/downloader/downloader.rs:210:9 [INFO] [stdout] | [INFO] [stdout] 210 | / match self.file.get_mut().deref_mut() { [INFO] [stdout] 211 | | Some(f) => f.clear_file()?, [INFO] [stdout] 212 | | None => {} [INFO] [stdout] 213 | | }; [INFO] [stdout] | |_________^ help: try: `if let Some(f) = self.file.get_mut().deref_mut() { f.clear_file()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/downloader.rs:246:9 [INFO] [stdout] | [INFO] [stdout] 246 | / match mults { [INFO] [stdout] 247 | | Some(bars) => { [INFO] [stdout] 248 | | bar = bars.add(bar); [INFO] [stdout] ... | [INFO] [stdout] 251 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 246 ~ if let Some(bars) = mults { [INFO] [stdout] 247 + bar = bars.add(bar); [INFO] [stdout] 248 + } [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/downloader/downloader.rs:276:9 [INFO] [stdout] | [INFO] [stdout] 276 | / match self.progress.get_ref().deref() { [INFO] [stdout] 277 | | Some(p) => p.finish_with_message(msg), [INFO] [stdout] 278 | | None => {} [INFO] [stdout] 279 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(p) = self.progress.get_ref().deref() { p.finish_with_message(msg) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `HTML` contains a capitalized acronym [INFO] [stdout] --> src/fanbox/article/url_embed.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | HTML(FanboxArticleUrlEmbedHTML), [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Html` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [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/downloader/downloader.rs:338:9 [INFO] [stdout] | [INFO] [stdout] 338 | / match self.progress.get_ref().deref() { [INFO] [stdout] 339 | | Some(p) => { [INFO] [stdout] 340 | | if !self.progress_has_length.qload() { [INFO] [stdout] 341 | | p.inc_length(delta); [INFO] [stdout] ... | [INFO] [stdout] 345 | | None => {} [INFO] [stdout] 346 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 338 ~ if let Some(p) = self.progress.get_ref().deref() { [INFO] [stdout] 339 + if !self.progress_has_length.qload() { [INFO] [stdout] 340 + p.inc_length(delta); [INFO] [stdout] 341 + } [INFO] [stdout] 342 + p.inc(delta); [INFO] [stdout] 343 + } [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/fanbox/article/url_embed.rs:170:13 [INFO] [stdout] | [INFO] [stdout] 170 | / match self.get_url_embed(key) { [INFO] [stdout] 171 | | Some(embed) => { [INFO] [stdout] 172 | | embed.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 175 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 170 ~ if let Some(embed) = self.get_url_embed(key) { [INFO] [stdout] 171 + embed.check_unknown()?; [INFO] [stdout] 172 + } [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/downloader/downloader.rs:422:9 [INFO] [stdout] | [INFO] [stdout] 422 | / match self.file.get_mut().deref_mut() { [INFO] [stdout] 423 | | Some(f) => f.set_len(size)?, [INFO] [stdout] 424 | | None => {} [INFO] [stdout] 425 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(f) = self.file.get_mut().deref_mut() { f.set_len(size)? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/downloader.rs:447:9 [INFO] [stdout] | [INFO] [stdout] 447 | / match self.progress.get_ref().deref() { [INFO] [stdout] 448 | | Some(p) => p.set_length(length), [INFO] [stdout] 449 | | None => {} [INFO] [stdout] 450 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(p) = self.progress.get_ref().deref() { p.set_length(length) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/downloader.rs:456:9 [INFO] [stdout] | [INFO] [stdout] 456 | / match self.progress.get_ref().deref() { [INFO] [stdout] 457 | | Some(p) => { [INFO] [stdout] 458 | | if !self.progress_has_length.qload() { [INFO] [stdout] 459 | | p.set_length(pos); [INFO] [stdout] ... | [INFO] [stdout] 463 | | None => {} [INFO] [stdout] 464 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 456 ~ if let Some(p) = self.progress.get_ref().deref() { [INFO] [stdout] 457 + if !self.progress_has_length.qload() { [INFO] [stdout] 458 + p.set_length(pos); [INFO] [stdout] 459 + } [INFO] [stdout] 460 + p.set_position(pos); [INFO] [stdout] 461 + } [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/downloader/downloader.rs:470:9 [INFO] [stdout] | [INFO] [stdout] 470 | / match self.progress.get_ref().deref() { [INFO] [stdout] 471 | | Some(p) => p.set_message(msg), [INFO] [stdout] 472 | | None => {} [INFO] [stdout] 473 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(p) = self.progress.get_ref().deref() { p.set_message(msg) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/downloader.rs:497:9 [INFO] [stdout] | [INFO] [stdout] 497 | / match self.file.get_mut().deref_mut() { [INFO] [stdout] 498 | | Some(f) => f.write_all(data)?, [INFO] [stdout] 499 | | None => {} [INFO] [stdout] 500 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(f) = self.file.get_mut().deref_mut() { f.write_all(data)? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/downloader.rs:514:9 [INFO] [stdout] | [INFO] [stdout] 514 | / match self.file.get_mut().deref_mut() { [INFO] [stdout] 515 | | Some(f) => { [INFO] [stdout] 516 | | let offset = [INFO] [stdout] 517 | | (self.get_part_size() as u64) * (index as u64) + (pd.downloaded_size() as u64); [INFO] [stdout] ... | [INFO] [stdout] 521 | | None => {} [INFO] [stdout] 522 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 514 ~ if let Some(f) = self.file.get_mut().deref_mut() { [INFO] [stdout] 515 + let offset = [INFO] [stdout] 516 + (self.get_part_size() as u64) * (index as u64) + (pd.downloaded_size() as u64); [INFO] [stdout] 517 + f.seek(SeekFrom::Start(offset))?; [INFO] [stdout] 518 + f.write_all(data)?; [INFO] [stdout] 519 + } [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/fanbox/comment.rs:106:9 [INFO] [stdout] | [INFO] [stdout] 106 | / match self.replies() { [INFO] [stdout] 107 | | Some(replies) => { [INFO] [stdout] 108 | | for i in replies { [INFO] [stdout] 109 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 112 | | None => {} [INFO] [stdout] 113 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 106 ~ if let Some(replies) = self.replies() { [INFO] [stdout] 107 + for i in replies { [INFO] [stdout] 108 + i.check_unknown()?; [INFO] [stdout] 109 + } [INFO] [stdout] 110 + } [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/downloader/downloader.rs:702:9 [INFO] [stdout] | [INFO] [stdout] 702 | / match helper.download_retry() { [INFO] [stdout] 703 | | Some(u) => self.set_max_retry_count(u), [INFO] [stdout] 704 | | None => {} [INFO] [stdout] 705 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(u) = helper.download_retry() { self.set_max_retry_count(u) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/downloader.rs:707:9 [INFO] [stdout] | [INFO] [stdout] 707 | / match helper.download_part_retry() { [INFO] [stdout] 708 | | Some(u) => self.set_max_part_retry_count(u), [INFO] [stdout] 709 | | None => {} [INFO] [stdout] 710 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(u) = helper.download_part_retry() { self.set_max_part_retry_count(u) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/fanbox/comment_list.rs:63:24 [INFO] [stdout] | [INFO] [stdout] 63 | let next_url = match value["nextUrl"].as_str() { [INFO] [stdout] | ________________________^ [INFO] [stdout] 64 | | Some(next_url) => Some(next_url.to_owned()), [INFO] [stdout] 65 | | None => None, [INFO] [stdout] 66 | | }; [INFO] [stdout] | |_________^ help: try: `value["nextUrl"].as_str().map(|next_url| next_url.to_owned())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/downloader/downloader.rs:814:13 [INFO] [stdout] | [INFO] [stdout] 814 | assert_eq!(v.is_created(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 814 - assert_eq!(v.is_created(), true); [INFO] [stdout] 814 + assert!(v.is_created()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/downloader/downloader.rs:818:13 [INFO] [stdout] | [INFO] [stdout] 818 | assert_eq!(v.is_downloaded(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 818 - assert_eq!(v.is_downloaded(), true); [INFO] [stdout] 818 + assert!(v.is_downloaded()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/downloader/downloader.rs:850:13 [INFO] [stdout] | [INFO] [stdout] 850 | assert_eq!(v.is_created(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 850 - assert_eq!(v.is_created(), true); [INFO] [stdout] 850 + assert!(v.is_created()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/downloader/downloader.rs:854:13 [INFO] [stdout] | [INFO] [stdout] 854 | assert_eq!(v.is_panic(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 854 - assert_eq!(v.is_panic(), true); [INFO] [stdout] 854 + assert!(v.is_panic()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/fanbox/creator.rs:91:24 [INFO] [stdout] | [INFO] [stdout] 91 | Some(s) => match s { [INFO] [stdout] | ________________________^ [INFO] [stdout] 92 | | "image" => Self::Image(FanboxProfileImage::new(data, client)), [INFO] [stdout] 93 | | _ => Self::Unknown(data.clone()), [INFO] [stdout] 94 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/fanbox/creator.rs:91:18 [INFO] [stdout] | [INFO] [stdout] 91 | Some(s) => match s { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 92 | "image" => Self::Image(FanboxProfileImage::new(data, client)), [INFO] [stdout] | ^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/downloader/downloader.rs:882:17 [INFO] [stdout] | [INFO] [stdout] 882 | assert_eq!(v.is_created(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 882 - assert_eq!(v.is_created(), true); [INFO] [stdout] 882 + assert!(v.is_created()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/downloader/downloader.rs:903:17 [INFO] [stdout] | [INFO] [stdout] 903 | assert_eq!(v.is_created(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 903 - assert_eq!(v.is_created(), true); [INFO] [stdout] 903 + assert!(v.is_created()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/downloader/downloader.rs:907:17 [INFO] [stdout] | [INFO] [stdout] 907 | assert_eq!(v.is_downloaded(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 907 - assert_eq!(v.is_downloaded(), true); [INFO] [stdout] 907 + assert!(v.is_downloaded()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/downloader/downloader.rs:946:13 [INFO] [stdout] | [INFO] [stdout] 946 | assert_eq!(v.is_created(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 946 - assert_eq!(v.is_created(), true); [INFO] [stdout] 946 + assert!(v.is_created()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/downloader/downloader.rs:951:13 [INFO] [stdout] | [INFO] [stdout] 951 | assert_eq!(v.is_downloaded(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 951 - assert_eq!(v.is_downloaded(), true); [INFO] [stdout] 951 + assert!(v.is_downloaded()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/downloader/downloader.rs:984:13 [INFO] [stdout] | [INFO] [stdout] 984 | assert_eq!(v.is_created(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 984 - assert_eq!(v.is_created(), true); [INFO] [stdout] 984 + assert!(v.is_created()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/downloader/downloader.rs:988:13 [INFO] [stdout] | [INFO] [stdout] 988 | assert_eq!(v.is_panic(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 988 - assert_eq!(v.is_panic(), true); [INFO] [stdout] 988 + assert!(v.is_panic()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/downloader/helper.rs:78:21 [INFO] [stdout] | [INFO] [stdout] 78 | None => match crate::utils::get_file_name_from_url(self.url.clone()) { [INFO] [stdout] | _____________________^ [INFO] [stdout] 79 | | Some(file_name) => Some(base.join(file_name)), [INFO] [stdout] 80 | | None => None, [INFO] [stdout] 81 | | }, [INFO] [stdout] | |_____________^ help: try: `crate::utils::get_file_name_from_url(self.url.clone()).map(|file_name| base.join(file_name))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/downloader/local_file.rs:66:9 [INFO] [stdout] | [INFO] [stdout] 66 | &self.file.as_ref().unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.file.as_ref().unwrap()` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/downloader/local_file.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | / match self.path.to_str() { [INFO] [stdout] 74 | | Some(s) => Some(String::from(s)), [INFO] [stdout] 75 | | None => None, [INFO] [stdout] 76 | | } [INFO] [stdout] | |_________^ help: try: `self.path.to_str().map(String::from)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [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/downloader/pd_file/file.rs:152:17 [INFO] [stdout] | [INFO] [stdout] 152 | / match f.as_mut() { [INFO] [stdout] 153 | | Some(f) => { [INFO] [stdout] 154 | | f.seek(TYPE_OFFSET)?; [INFO] [stdout] 155 | | f.write_le_u8(self.ftype.get_ref().int_value())?; [INFO] [stdout] ... | [INFO] [stdout] 158 | | None => {} [INFO] [stdout] 159 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 152 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 153 + f.seek(TYPE_OFFSET)?; [INFO] [stdout] 154 + f.write_le_u8(self.ftype.get_ref().int_value())?; [INFO] [stdout] 155 + self.need_saved.qstore(false); [INFO] [stdout] 156 + } [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/downloader/pd_file/file.rs:176:17 [INFO] [stdout] | [INFO] [stdout] 176 | / match f.as_mut() { [INFO] [stdout] 177 | | Some(f) => { [INFO] [stdout] 178 | | f.seek(TYPE_OFFSET)?; [INFO] [stdout] 179 | | f.write_le_u8(self.ftype.get_ref().int_value())?; [INFO] [stdout] ... | [INFO] [stdout] 182 | | None => {} [INFO] [stdout] 183 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 176 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 177 + f.seek(TYPE_OFFSET)?; [INFO] [stdout] 178 + f.write_le_u8(self.ftype.get_ref().int_value())?; [INFO] [stdout] 179 + self.need_saved.qstore(false); [INFO] [stdout] 180 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/fanbox/item_list.rs:64:24 [INFO] [stdout] | [INFO] [stdout] 64 | let next_url = match value["nextUrl"].as_str() { [INFO] [stdout] | ________________________^ [INFO] [stdout] 65 | | Some(next_url) => Some(next_url.to_owned()), [INFO] [stdout] 66 | | None => None, [INFO] [stdout] 67 | | }; [INFO] [stdout] | |_________^ help: try: `value["nextUrl"].as_str().map(|next_url| next_url.to_owned())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [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/downloader/pd_file/file.rs:192:9 [INFO] [stdout] | [INFO] [stdout] 192 | / match f.as_mut() { [INFO] [stdout] 193 | | Some(_) => { [INFO] [stdout] 194 | | f.take(); [INFO] [stdout] ... | [INFO] [stdout] 197 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 192 ~ if let Some(_) = f.as_mut() { [INFO] [stdout] 193 + f.take(); [INFO] [stdout] 194 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `index` is used as a loop counter [INFO] [stdout] --> src/downloader/pd_file/file.rs:222:9 [INFO] [stdout] | [INFO] [stdout] 222 | for d in datas.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (index, d) in datas.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [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/downloader/pd_file/file.rs:260:13 [INFO] [stdout] | [INFO] [stdout] 260 | / match f.as_mut() { [INFO] [stdout] 261 | | Some(f) => { [INFO] [stdout] 262 | | f.seek(DOWNLOADED_FILE_SIZE_OFFSET)?; [INFO] [stdout] 263 | | f.write_le_u64(downloaded_size)?; [INFO] [stdout] ... | [INFO] [stdout] 266 | | None => {} [INFO] [stdout] 267 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 260 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 261 + f.seek(DOWNLOADED_FILE_SIZE_OFFSET)?; [INFO] [stdout] 262 + f.write_le_u64(downloaded_size)?; [INFO] [stdout] 263 + self.need_saved.qstore(false); [INFO] [stdout] 264 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/downloader/pd_file/file.rs:277:35 [INFO] [stdout] | [INFO] [stdout] 277 | let mut part_counts = (file_size + (part_size as u64) - 1) / (part_size as u64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `file_size.div_ceil(part_size as u64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/downloader/pd_file/file.rs:314:9 [INFO] [stdout] | [INFO] [stdout] 314 | return true; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 314 - return true; [INFO] [stdout] 314 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `index` is used as a loop counter [INFO] [stdout] --> src/downloader/pd_file/file.rs:297:9 [INFO] [stdout] | [INFO] [stdout] 297 | for part in self.part_datas.get_ref().iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (index, part) in self.part_datas.get_ref().iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/downloader/pd_file/file.rs:432:31 [INFO] [stdout] | [INFO] [stdout] 432 | let part_counts = (file_size + (part_size as u64) - 1) / (part_size as u64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `file_size.div_ceil(part_size as u64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [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/downloader/pd_file/file.rs:561:13 [INFO] [stdout] | [INFO] [stdout] 561 | / match f.as_mut() { [INFO] [stdout] 562 | | Some(f) => { [INFO] [stdout] 563 | | f.seek(FILE_SIZE_OFFSET)?; [INFO] [stdout] 564 | | f.write_le_u64(file_size)?; [INFO] [stdout] ... | [INFO] [stdout] 567 | | None => {} [INFO] [stdout] 568 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 561 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 562 + f.seek(FILE_SIZE_OFFSET)?; [INFO] [stdout] 563 + f.write_le_u64(file_size)?; [INFO] [stdout] 564 + self.need_saved.qstore(false); [INFO] [stdout] 565 + } [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/downloader/pd_file/file.rs:574:13 [INFO] [stdout] | [INFO] [stdout] 574 | / match f.as_mut() { [INFO] [stdout] 575 | | Some(f) => { [INFO] [stdout] 576 | | f.seek(STATUS_OFFSET)?; [INFO] [stdout] 577 | | f.write_le_u8(self.status.get_ref().int_value())?; [INFO] [stdout] ... | [INFO] [stdout] 580 | | None => {} [INFO] [stdout] 581 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 574 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 575 + f.seek(STATUS_OFFSET)?; [INFO] [stdout] 576 + f.write_le_u8(self.status.get_ref().int_value())?; [INFO] [stdout] 577 + self.need_saved.qstore(false); [INFO] [stdout] 578 + } [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/downloader/pd_file/file.rs:592:13 [INFO] [stdout] | [INFO] [stdout] 592 | / match f.as_mut() { [INFO] [stdout] 593 | | Some(f) => { [INFO] [stdout] 594 | | f.seek(PART_SIZE_OFFSET)?; [INFO] [stdout] 595 | | f.write_le_u32(part_size)?; [INFO] [stdout] ... | [INFO] [stdout] 598 | | None => {} [INFO] [stdout] 599 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 592 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 593 + f.seek(PART_SIZE_OFFSET)?; [INFO] [stdout] 594 + f.write_le_u32(part_size)?; [INFO] [stdout] 595 + self.need_saved.qstore(false); [INFO] [stdout] 596 + } [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/downloader/pd_file/file.rs:615:13 [INFO] [stdout] | [INFO] [stdout] 615 | / match f.as_mut() { [INFO] [stdout] 616 | | Some(f) => { [INFO] [stdout] 617 | | f.seek(SeekFrom::Start( [INFO] [stdout] 618 | | self.part_data_offset.qload() + 2 * (index as u64), [INFO] [stdout] ... | [INFO] [stdout] 623 | | None => {} [INFO] [stdout] 624 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 615 ~ if let Some(f) = f.as_mut() { [INFO] [stdout] 616 + f.seek(SeekFrom::Start( [INFO] [stdout] 617 + self.part_data_offset.qload() + 2 * (index as u64), [INFO] [stdout] 618 + ))?; [INFO] [stdout] 619 + part.write_to(f)?; [INFO] [stdout] 620 + self.need_saved.qstore(false); [INFO] [stdout] 621 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/downloader/pd_file/file.rs:656:31 [INFO] [stdout] | [INFO] [stdout] 656 | let part_counts = (file_size + (part_size as u64) - 1) / (part_size as u64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `file_size.div_ceil(part_size as u64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [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/fanbox/post.rs:217:9 [INFO] [stdout] | [INFO] [stdout] 217 | / match self.comment_list() { [INFO] [stdout] 218 | | Some(list) => { [INFO] [stdout] 219 | | for i in list.items { [INFO] [stdout] 220 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 223 | | None => {} [INFO] [stdout] 224 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 217 ~ if let Some(list) = self.comment_list() { [INFO] [stdout] 218 + for i in list.items { [INFO] [stdout] 219 + i.check_unknown()?; [INFO] [stdout] 220 + } [INFO] [stdout] 221 + } [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/fanbox/post.rs:225:9 [INFO] [stdout] | [INFO] [stdout] 225 | / match self.next_post() { [INFO] [stdout] 226 | | Some(post) => post.check_unknown()?, [INFO] [stdout] 227 | | None => {} [INFO] [stdout] 228 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(post) = self.next_post() { post.check_unknown()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/post.rs:229:9 [INFO] [stdout] | [INFO] [stdout] 229 | / match self.prev_post() { [INFO] [stdout] 230 | | Some(post) => post.check_unknown()?, [INFO] [stdout] 231 | | None => {} [INFO] [stdout] 232 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(post) = self.prev_post() { post.check_unknown()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/post.rs:333:9 [INFO] [stdout] | [INFO] [stdout] 333 | / match self.name() { [INFO] [stdout] 334 | | Some(name) => match self.extension() { [INFO] [stdout] 335 | | Some(ext) => { [INFO] [stdout] 336 | | dh.set_file_name((name.to_owned() + "." + ext).as_str()); [INFO] [stdout] ... | [INFO] [stdout] 342 | | None => {} [INFO] [stdout] 343 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 333 ~ if let Some(name) = self.name() { match self.extension() { [INFO] [stdout] 334 + Some(ext) => { [INFO] [stdout] 335 + dh.set_file_name((name.to_owned() + "." + ext).as_str()); [INFO] [stdout] 336 + } [INFO] [stdout] 337 + None => { [INFO] [stdout] 338 + dh.set_file_name(name); [INFO] [stdout] 339 + } [INFO] [stdout] 340 + } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/downloader/pd_file/part_status.rs:240:5 [INFO] [stdout] | [INFO] [stdout] 240 | assert_eq!(status.is_waited(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 240 - assert_eq!(status.is_waited(), true); [INFO] [stdout] 240 + assert!(status.is_waited()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/downloader/pd_file/part_status.rs:242:5 [INFO] [stdout] | [INFO] [stdout] 242 | assert_eq!(status.is_downloaded(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 242 - assert_eq!(status.is_downloaded(), true); [INFO] [stdout] 242 + assert!(status.is_downloaded()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/downloader/pd_file/version.rs:46:21 [INFO] [stdout] | [INFO] [stdout] 46 | pub fn to_bytes(&self) -> Vec { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [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/fanbox/post.rs:413:9 [INFO] [stdout] | [INFO] [stdout] 413 | / match self.files() { [INFO] [stdout] 414 | | Some(list) => { [INFO] [stdout] 415 | | for i in list { [INFO] [stdout] 416 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 419 | | None => {} [INFO] [stdout] 420 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 413 ~ if let Some(list) = self.files() { [INFO] [stdout] 414 + for i in list { [INFO] [stdout] 415 + i.check_unknown()?; [INFO] [stdout] 416 + } [INFO] [stdout] 417 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/downloader/pd_file/version.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | / let mut data = Vec::new(); [INFO] [stdout] 48 | | data.push(self.major); [INFO] [stdout] 49 | | data.push(self.minor); [INFO] [stdout] | |______________________________^ help: consider using the `vec![]` macro: `let data = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/downloader/pd_file/version.rs:90:1 [INFO] [stdout] | [INFO] [stdout] 90 | / impl PartialOrd for PdFileVersion { [INFO] [stdout] 91 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 92 | | let r = self.major.cmp(&other.major); [INFO] [stdout] 93 | | if r.is_eq() { [INFO] [stdout] ... | [INFO] [stdout] 99 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 91 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 92 - let r = self.major.cmp(&other.major); [INFO] [stdout] 93 - if r.is_eq() { [INFO] [stdout] 94 - Some(self.minor.cmp(&other.minor)) [INFO] [stdout] 95 - } else { [INFO] [stdout] 96 - Some(r) [INFO] [stdout] 97 - } [INFO] [stdout] 98 - } [INFO] [stdout] 91 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/downloader/pd_file/version.rs:143:13 [INFO] [stdout] | [INFO] [stdout] 143 | assert!(!(PdFileVersion::new(2, 3) > [1])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(PdFileVersion::new(2, 3) <= [1])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/downloader/tasks.rs:104:21 [INFO] [stdout] | [INFO] [stdout] 104 | / if start != b.first_byte { [INFO] [stdout] 105 | | true [INFO] [stdout] 106 | | } else { [INFO] [stdout] 107 | | false [INFO] [stdout] 108 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 103 ~ ContentRange::UnboundBytes(b) [INFO] [stdout] 104 ~ if start != b.first_byte => { [INFO] [stdout] 105 | true [INFO] [stdout] 106 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/downloader/tasks.rs:95:73 [INFO] [stdout] | [INFO] [stdout] 95 | if file_size != 0 && b.complete_length != file_size { [INFO] [stdout] | _________________________________________________________________________^ [INFO] [stdout] 96 | | true [INFO] [stdout] 97 | | } else if start != b.first_byte { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/downloader/tasks.rs:97:53 [INFO] [stdout] | [INFO] [stdout] 97 | } else if start != b.first_byte { [INFO] [stdout] | _____________________________________________________^ [INFO] [stdout] 98 | | true [INFO] [stdout] 99 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/downloader/tasks.rs:97:28 [INFO] [stdout] | [INFO] [stdout] 97 | } else if start != b.first_byte { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 98 | | true [INFO] [stdout] 99 | | } else { [INFO] [stdout] 100 | | false [INFO] [stdout] 101 | | } [INFO] [stdout] | |_____________________^ help: you can reduce it to: `{ start != b.first_byte }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/downloader/tasks.rs:104:21 [INFO] [stdout] | [INFO] [stdout] 104 | / if start != b.first_byte { [INFO] [stdout] 105 | | true [INFO] [stdout] 106 | | } else { [INFO] [stdout] 107 | | false [INFO] [stdout] 108 | | } [INFO] [stdout] | |_____________________^ help: you can reduce it to: `start != b.first_byte` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [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/downloader/tasks.rs:131:9 [INFO] [stdout] | [INFO] [stdout] 131 | / match result.content_length() { [INFO] [stdout] 132 | | Some(len) => { [INFO] [stdout] 133 | | d.pd.set_file_size(len)?; [INFO] [stdout] 134 | | if d.enabled_progress_bar() { [INFO] [stdout] ... | [INFO] [stdout] 139 | | None => {} [INFO] [stdout] 140 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 131 ~ if let Some(len) = result.content_length() { [INFO] [stdout] 132 + d.pd.set_file_size(len)?; [INFO] [stdout] 133 + if d.enabled_progress_bar() { [INFO] [stdout] 134 + d.set_progress_bar_length(len); [INFO] [stdout] 135 + } [INFO] [stdout] 136 + d.set_len(len)?; [INFO] [stdout] 137 + } [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/fanbox/post.rs:624:9 [INFO] [stdout] | [INFO] [stdout] 624 | / match self.body() { [INFO] [stdout] 625 | | Some(body) => { [INFO] [stdout] 626 | | body.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 629 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 624 ~ if let Some(body) = self.body() { [INFO] [stdout] 625 + body.check_unknown()?; [INFO] [stdout] 626 + } [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/fanbox/post.rs:630:9 [INFO] [stdout] | [INFO] [stdout] 630 | / match self.comment_list() { [INFO] [stdout] 631 | | Some(list) => { [INFO] [stdout] 632 | | list.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 635 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 630 ~ if let Some(list) = self.comment_list() { [INFO] [stdout] 631 + list.check_unknown()?; [INFO] [stdout] 632 + } [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/fanbox/post.rs:636:9 [INFO] [stdout] | [INFO] [stdout] 636 | / match self.next_post() { [INFO] [stdout] 637 | | Some(next) => { [INFO] [stdout] 638 | | next.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 641 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 636 ~ if let Some(next) = self.next_post() { [INFO] [stdout] 637 + next.check_unknown()?; [INFO] [stdout] 638 + } [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/fanbox/post.rs:642:9 [INFO] [stdout] | [INFO] [stdout] 642 | / match self.prev_post() { [INFO] [stdout] 643 | | Some(prev) => { [INFO] [stdout] 644 | | prev.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 647 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 642 ~ if let Some(prev) = self.prev_post() { [INFO] [stdout] 643 + prev.check_unknown()?; [INFO] [stdout] 644 + } [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/fanbox/post.rs:726:9 [INFO] [stdout] | [INFO] [stdout] 726 | / match self.images() { [INFO] [stdout] 727 | | Some(imgs) => { [INFO] [stdout] 728 | | for img in imgs { [INFO] [stdout] 729 | | img.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 732 | | None => {} [INFO] [stdout] 733 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 726 ~ if let Some(imgs) = self.images() { [INFO] [stdout] 727 + for img in imgs { [INFO] [stdout] 728 + img.check_unknown()?; [INFO] [stdout] 729 + } [INFO] [stdout] 730 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `dur` after checking its variant with `is_some` [INFO] [stdout] --> src/downloader/tasks.rs:466:23 [INFO] [stdout] | [INFO] [stdout] 465 | if !d.is_multi_threads() && dur.is_some() { [INFO] [stdout] | ------------- the check is happening here [INFO] [stdout] 466 | let dur = dur.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/downloader/tasks.rs:474:20 [INFO] [stdout] | [INFO] [stdout] 474 | if d.tasks.get_ref().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `d.tasks.get_ref().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/downloader/tasks.rs:475:21 [INFO] [stdout] | [INFO] [stdout] 475 | / match dur { [INFO] [stdout] 476 | | Some(dur) => { [INFO] [stdout] 477 | | if !dur.is_zero() { [INFO] [stdout] 478 | | tokio::time::sleep(dur).await; [INFO] [stdout] ... | [INFO] [stdout] 484 | | None => {} [INFO] [stdout] 485 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 475 ~ if let Some(dur) = dur { [INFO] [stdout] 476 + if !dur.is_zero() { [INFO] [stdout] 477 + tokio::time::sleep(dur).await; [INFO] [stdout] 478 + } [INFO] [stdout] 479 + let task = [INFO] [stdout] 480 + tokio::spawn(create_download_tasks_multi_first(Arc::clone(&d))); [INFO] [stdout] 481 + d.add_task(task); [INFO] [stdout] 482 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.num` after checking its variant with `is_some` [INFO] [stdout] --> src/dur.rs:38:41 [INFO] [stdout] | [INFO] [stdout] 37 | if self.num.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = self.num` [INFO] [stdout] 38 | Duration::from_secs(self.num.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.num` after checking its variant with `is_some` [INFO] [stdout] --> src/dur.rs:45:43 [INFO] [stdout] | [INFO] [stdout] 44 | if self.num.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = self.num` [INFO] [stdout] 45 | Duration::from_millis(self.num.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.num` after checking its variant with `is_some` [INFO] [stdout] --> src/dur.rs:52:42 [INFO] [stdout] | [INFO] [stdout] 51 | if self.num.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = self.num` [INFO] [stdout] 52 | Duration::from_nanos(self.num.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `num` after checking its variant with `is_ok` [INFO] [stdout] --> src/dur.rs:67:38 [INFO] [stdout] | [INFO] [stdout] 66 | if num.is_ok() { [INFO] [stdout] | -------------- help: try: `if let Ok() = num` [INFO] [stdout] 67 | return Ok(Self::from_num(num.unwrap())); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.num` after checking its variant with `is_some` [INFO] [stdout] --> src/dur.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 79 | if self.num.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = &self.num` [INFO] [stdout] 80 | self.num.as_ref().unwrap() == other [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.f` after checking its variant with `is_some` [INFO] [stdout] --> src/dur.rs:90:13 [INFO] [stdout] | [INFO] [stdout] 89 | if self.f.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = &self.f` [INFO] [stdout] 90 | self.f.as_ref().unwrap() == other [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `HTTP` contains a capitalized acronym [INFO] [stdout] --> src/error.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | HTTP(http::Error), [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Http` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` 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/fanbox/post.rs:947:9 [INFO] [stdout] | [INFO] [stdout] 947 | / match self.body() { [INFO] [stdout] 948 | | Some(body) => { [INFO] [stdout] 949 | | body.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 952 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 947 ~ if let Some(body) = self.body() { [INFO] [stdout] 948 + body.check_unknown()?; [INFO] [stdout] 949 + } [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/fanbox/post.rs:953:9 [INFO] [stdout] | [INFO] [stdout] 953 | / match self.comment_list() { [INFO] [stdout] 954 | | Some(list) => { [INFO] [stdout] 955 | | for i in list.items { [INFO] [stdout] 956 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 959 | | None => {} [INFO] [stdout] 960 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 953 ~ if let Some(list) = self.comment_list() { [INFO] [stdout] 954 + for i in list.items { [INFO] [stdout] 955 + i.check_unknown()?; [INFO] [stdout] 956 + } [INFO] [stdout] 957 + } [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/fanbox/post.rs:961:9 [INFO] [stdout] | [INFO] [stdout] 961 | / match self.next_post() { [INFO] [stdout] 962 | | Some(post) => post.check_unknown()?, [INFO] [stdout] 963 | | None => {} [INFO] [stdout] 964 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(post) = self.next_post() { post.check_unknown()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/post.rs:965:9 [INFO] [stdout] | [INFO] [stdout] 965 | / match self.prev_post() { [INFO] [stdout] 966 | | Some(post) => post.check_unknown()?, [INFO] [stdout] 967 | | None => {} [INFO] [stdout] 968 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(post) = self.prev_post() { post.check_unknown()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ext/cstr.rs:71:6 [INFO] [stdout] | [INFO] [stdout] 71 | impl<'a, T: ToCStr> ToCStr for &'a T { [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] 71 - impl<'a, T: ToCStr> ToCStr for &'a T { [INFO] [stdout] 71 + impl ToCStr for &T { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/ext/json.rs:98:30 [INFO] [stdout] | [INFO] [stdout] 98 | Some(JsonValue::from(self.clone())) [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*self` [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 `bool` which implements the `Copy` trait [INFO] [stdout] --> src/ext/json.rs:105:25 [INFO] [stdout] | [INFO] [stdout] 105 | JsonValue::from(self.clone()) [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*self` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/post.rs:1213:9 [INFO] [stdout] | [INFO] [stdout] 1213 | / match self.comment_list() { [INFO] [stdout] 1214 | | Some(list) => { [INFO] [stdout] 1215 | | for i in list.items { [INFO] [stdout] 1216 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 1219 | | None => {} [INFO] [stdout] 1220 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1213 ~ if let Some(list) = self.comment_list() { [INFO] [stdout] 1214 + for i in list.items { [INFO] [stdout] 1215 + i.check_unknown()?; [INFO] [stdout] 1216 + } [INFO] [stdout] 1217 + } [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/fanbox/post.rs:1221:9 [INFO] [stdout] | [INFO] [stdout] 1221 | / match self.next_post() { [INFO] [stdout] 1222 | | Some(post) => post.check_unknown()?, [INFO] [stdout] 1223 | | None => {} [INFO] [stdout] 1224 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(post) = self.next_post() { post.check_unknown()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/post.rs:1225:9 [INFO] [stdout] | [INFO] [stdout] 1225 | / match self.prev_post() { [INFO] [stdout] 1226 | | Some(post) => post.check_unknown()?, [INFO] [stdout] 1227 | | None => {} [INFO] [stdout] 1228 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(post) = self.prev_post() { post.check_unknown()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/fanbox/post.rs:1274:25 [INFO] [stdout] | [INFO] [stdout] 1274 | Some(id) => match self.client.get_post_info(id).await { [INFO] [stdout] | _________________________^ [INFO] [stdout] 1275 | | Some(s) => Some(FanboxPost::new(&s["body"], Arc::clone(&self.client))), [INFO] [stdout] 1276 | | None => None, [INFO] [stdout] 1277 | | }, [INFO] [stdout] | |_____________^ help: try: `self.client.get_post_info(id).await.map(|s| FanboxPost::new(&s["body"], Arc::clone(&self.client)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ext/subprocess.rs:17:17 [INFO] [stdout] | [INFO] [stdout] 17 | return std::task::Poll::Pending; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 17 - return std::task::Poll::Pending; [INFO] [stdout] 17 + std::task::Poll::Pending [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/ext/use_or_not.rs:40:1 [INFO] [stdout] | [INFO] [stdout] 40 | / impl Default for UseOrNot { [INFO] [stdout] 41 | | fn default() -> Self { [INFO] [stdout] 42 | | Self::Auto [INFO] [stdout] 43 | | } [INFO] [stdout] 44 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 8 + #[derive(Default)] [INFO] [stdout] 9 | pub enum UseOrNot { [INFO] [stdout] 10 | /// Auto Detect [INFO] [stdout] 11 ~ #[default] [INFO] [stdout] 12 ~ Auto, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/fanbox/article/block.rs:60:24 [INFO] [stdout] | [INFO] [stdout] 60 | Some(t) => match t { [INFO] [stdout] | ________________________^ [INFO] [stdout] 61 | | "bold" => Self::Bold(FanboxArticleParagraphBoldStyle::new(data)), [INFO] [stdout] 62 | | _ => Self::Unknown(data.clone()), [INFO] [stdout] 63 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/fanbox/article/block.rs:60:18 [INFO] [stdout] | [INFO] [stdout] 60 | Some(t) => match t { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 61 | "bold" => Self::Bold(FanboxArticleParagraphBoldStyle::new(data)), [INFO] [stdout] | ^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/fanbox_api.rs:27:1 [INFO] [stdout] | [INFO] [stdout] 27 | / impl Default for FanboxDownloadDetectMiddleware { [INFO] [stdout] 28 | | fn default() -> Self { [INFO] [stdout] 29 | | Self { _unused: [] } [INFO] [stdout] 30 | | } [INFO] [stdout] 31 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 23 + #[derive(Default)] [INFO] [stdout] 24 | pub struct FanboxDownloadDetectMiddleware { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/fanbox_api.rs:105:17 [INFO] [stdout] | [INFO] [stdout] 105 | / if !self.client.read_cookies(c.as_str()) { [INFO] [stdout] 106 | | return false; [INFO] [stdout] 107 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 104 ~ Some(c) [INFO] [stdout] 105 ~ if !self.client.read_cookies(c.as_str()) => { [INFO] [stdout] 106 | return false; [INFO] [stdout] 107 ~ } [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/fanbox_api.rs:103:9 [INFO] [stdout] | [INFO] [stdout] 103 | / match cookies { [INFO] [stdout] 104 | | Some(c) => { [INFO] [stdout] 105 | | if !self.client.read_cookies(c.as_str()) { [INFO] [stdout] 106 | | return false; [INFO] [stdout] ... | [INFO] [stdout] 109 | | None => {} [INFO] [stdout] 110 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 103 ~ if let Some(c) = cookies { [INFO] [stdout] 104 + if !self.client.read_cookies(c.as_str()) { [INFO] [stdout] 105 + return false; [INFO] [stdout] 106 + } [INFO] [stdout] 107 + } [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/fanbox/article/block.rs:142:9 [INFO] [stdout] | [INFO] [stdout] 142 | / match self.styles() { [INFO] [stdout] 143 | | Some(styles) => { [INFO] [stdout] 144 | | for style in styles { [INFO] [stdout] 145 | | style.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 148 | | None => {} [INFO] [stdout] 149 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 142 ~ if let Some(styles) = self.styles() { [INFO] [stdout] 143 + for style in styles { [INFO] [stdout] 144 + style.check_unknown()?; [INFO] [stdout] 145 + } [INFO] [stdout] 146 + } [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/fanbox/article/body.rs:84:9 [INFO] [stdout] | [INFO] [stdout] 84 | / match self.blocks() { [INFO] [stdout] 85 | | Some(blocks) => { [INFO] [stdout] 86 | | for i in blocks { [INFO] [stdout] 87 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 90 | | None => {} [INFO] [stdout] 91 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 84 ~ if let Some(blocks) = self.blocks() { [INFO] [stdout] 85 + for i in blocks { [INFO] [stdout] 86 + i.check_unknown()?; [INFO] [stdout] 87 + } [INFO] [stdout] 88 + } [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/fanbox/article/body.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 92 | / match self.file_map() { [INFO] [stdout] 93 | | Some(map) => { [INFO] [stdout] 94 | | map.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 97 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 92 ~ if let Some(map) = self.file_map() { [INFO] [stdout] 93 + map.check_unknown()?; [INFO] [stdout] 94 + } [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/fanbox/article/body.rs:98:9 [INFO] [stdout] | [INFO] [stdout] 98 | / match self.image_map() { [INFO] [stdout] 99 | | Some(map) => { [INFO] [stdout] 100 | | map.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 103 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 98 ~ if let Some(map) = self.image_map() { [INFO] [stdout] 99 + map.check_unknown()?; [INFO] [stdout] 100 + } [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/fanbox/article/body.rs:104:9 [INFO] [stdout] | [INFO] [stdout] 104 | / match self.url_embed_map() { [INFO] [stdout] 105 | | Some(map) => { [INFO] [stdout] 106 | | map.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 109 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 104 ~ if let Some(map) = self.url_embed_map() { [INFO] [stdout] 105 + map.check_unknown()?; [INFO] [stdout] 106 + } [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/fanbox/article/file.rs:38:13 [INFO] [stdout] | [INFO] [stdout] 38 | / match self.get_file(key) { [INFO] [stdout] 39 | | Some(i) => { [INFO] [stdout] 40 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 43 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 38 ~ if let Some(i) = self.get_file(key) { [INFO] [stdout] 39 + i.check_unknown()?; [INFO] [stdout] 40 + } [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/fanbox/article/image.rs:120:13 [INFO] [stdout] | [INFO] [stdout] 120 | / match self.get_image(key) { [INFO] [stdout] 121 | | Some(i) => { [INFO] [stdout] 122 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 125 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 120 ~ if let Some(i) = self.get_image(key) { [INFO] [stdout] 121 + i.check_unknown()?; [INFO] [stdout] 122 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/fanbox_api.rs:281:9 [INFO] [stdout] | [INFO] [stdout] 281 | / match value["urlContext"]["user"]["isLoggedIn"].as_bool() { [INFO] [stdout] 282 | | Some(b) => b, [INFO] [stdout] 283 | | None => false, [INFO] [stdout] 284 | | } [INFO] [stdout] | |_________^ help: replace it with: `value["urlContext"]["user"]["isLoggedIn"].as_bool().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/fanbox/article/url_embed.rs:35:37 [INFO] [stdout] | [INFO] [stdout] 35 | Some(FanboxCreator::new(&profile, Arc::clone(&self.client))) [INFO] [stdout] | ^^^^^^^^ help: change this to: `profile` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/article/url_embed.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | / match self.profile() { [INFO] [stdout] 50 | | Some(profile) => { [INFO] [stdout] 51 | | profile.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 49 ~ if let Some(profile) = self.profile() { [INFO] [stdout] 50 + profile.check_unknown()?; [INFO] [stdout] 51 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/fanbox_api.rs:327:9 [INFO] [stdout] | [INFO] [stdout] 327 | / match self.client.get_creator(creator_id).await { [INFO] [stdout] 328 | | Some(s) => Some(FanboxCreator::new(&s["body"], Arc::clone(&self.client))), [INFO] [stdout] 329 | | None => None, [INFO] [stdout] 330 | | } [INFO] [stdout] | |_________^ help: try: `self.client.get_creator(creator_id).await.map(|s| FanboxCreator::new(&s["body"], Arc::clone(&self.client)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/fanbox_api.rs:337:9 [INFO] [stdout] | [INFO] [stdout] 337 | / match self.client.get_post_info(post_id).await { [INFO] [stdout] 338 | | Some(s) => Some(FanboxPost::new(&s["body"], Arc::clone(&self.client))), [INFO] [stdout] 339 | | None => None, [INFO] [stdout] 340 | | } [INFO] [stdout] | |_________^ help: try: `self.client.get_post_info(post_id).await.map(|s| FanboxPost::new(&s["body"], Arc::clone(&self.client)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `HTML` contains a capitalized acronym [INFO] [stdout] --> src/fanbox/article/url_embed.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | HTML(FanboxArticleUrlEmbedHTML), [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Html` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [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/fanbox/article/url_embed.rs:170:13 [INFO] [stdout] | [INFO] [stdout] 170 | / match self.get_url_embed(key) { [INFO] [stdout] 171 | | Some(embed) => { [INFO] [stdout] 172 | | embed.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 175 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 170 ~ if let Some(embed) = self.get_url_embed(key) { [INFO] [stdout] 171 + embed.check_unknown()?; [INFO] [stdout] 172 + } [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/formdata.rs:58:13 [INFO] [stdout] | [INFO] [stdout] 58 | / match &self.mime { [INFO] [stdout] 59 | | Some(m) => { [INFO] [stdout] 60 | | p.field("mime", &m.as_str()); [INFO] [stdout] ... | [INFO] [stdout] 63 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 58 ~ if let Some(m) = &self.mime { [INFO] [stdout] 59 + p.field("mime", &m.as_str()); [INFO] [stdout] 60 + } [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/formdata.rs:64:13 [INFO] [stdout] | [INFO] [stdout] 64 | / match &self.filename { [INFO] [stdout] 65 | | Some(f) => { [INFO] [stdout] 66 | | p.field("filename", &f.as_str()); [INFO] [stdout] ... | [INFO] [stdout] 69 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 64 ~ if let Some(f) = &self.filename { [INFO] [stdout] 65 + p.field("filename", &f.as_str()); [INFO] [stdout] 66 + } [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/formdata.rs:144:13 [INFO] [stdout] | [INFO] [stdout] 144 | / match &v.mime { [INFO] [stdout] 145 | | Some(m) => { [INFO] [stdout] 146 | | part = part.mime_str(m)?; [INFO] [stdout] ... | [INFO] [stdout] 149 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 144 ~ if let Some(m) = &v.mime { [INFO] [stdout] 145 + part = part.mime_str(m)?; [INFO] [stdout] 146 + } [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/formdata.rs:150:13 [INFO] [stdout] | [INFO] [stdout] 150 | / match &v.filename { [INFO] [stdout] 151 | | Some(f) => { [INFO] [stdout] 152 | | part = part.file_name(f.clone()); [INFO] [stdout] ... | [INFO] [stdout] 155 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 150 ~ if let Some(f) = &v.filename { [INFO] [stdout] 151 + part = part.file_name(f.clone()); [INFO] [stdout] 152 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/formdata.rs:163:1 [INFO] [stdout] | [INFO] [stdout] 163 | / impl Default for FormData { [INFO] [stdout] 164 | | fn default() -> Self { [INFO] [stdout] 165 | | Self { fields: Vec::new() } [INFO] [stdout] 166 | | } [INFO] [stdout] 167 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 80 + #[derive(Default)] [INFO] [stdout] 81 | pub struct FormData { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/i18n.rs:100:5 [INFO] [stdout] | [INFO] [stdout] 100 | return String::from("en-US"); [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 100 - return String::from("en-US"); [INFO] [stdout] 100 + String::from("en-US") [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/i18n.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | / match std::env::var("PIXIV_DOWNLOADER_LANG") { [INFO] [stdout] 7 | | Ok(lang) => { [INFO] [stdout] 8 | | return lang; [INFO] [stdout] ... | [INFO] [stdout] 11 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 ~ if let Ok(lang) = std::env::var("PIXIV_DOWNLOADER_LANG") { [INFO] [stdout] 7 + return lang; [INFO] [stdout] 8 + } [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/i18n.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | / match lan { [INFO] [stdout] 14 | | Ok(l) => { [INFO] [stdout] 15 | | if l.len() > 0 { [INFO] [stdout] 16 | | return l; [INFO] [stdout] ... | [INFO] [stdout] 19 | | Err(_) => {} [INFO] [stdout] 20 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 13 ~ if let Ok(l) = lan { [INFO] [stdout] 14 + if l.len() > 0 { [INFO] [stdout] 15 + return l; [INFO] [stdout] 16 + } [INFO] [stdout] 17 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/i18n.rs:15:16 [INFO] [stdout] | [INFO] [stdout] 15 | if l.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/i18n.rs:139:5 [INFO] [stdout] | [INFO] [stdout] 139 | return None; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 139 - return None; [INFO] [stdout] 139 + None [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/i18n.rs:114:9 [INFO] [stdout] | [INFO] [stdout] 114 | / match f { [INFO] [stdout] 115 | | Ok(f) => { [INFO] [stdout] 116 | | return Some(f); [INFO] [stdout] ... | [INFO] [stdout] 119 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 114 ~ if let Ok(f) = f { [INFO] [stdout] 115 + return Some(f); [INFO] [stdout] 116 + } [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/fanbox/comment.rs:106:9 [INFO] [stdout] | [INFO] [stdout] 106 | / match self.replies() { [INFO] [stdout] 107 | | Some(replies) => { [INFO] [stdout] 108 | | for i in replies { [INFO] [stdout] 109 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 112 | | None => {} [INFO] [stdout] 113 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 106 ~ if let Some(replies) = self.replies() { [INFO] [stdout] 107 + for i in replies { [INFO] [stdout] 108 + i.check_unknown()?; [INFO] [stdout] 109 + } [INFO] [stdout] 110 + } [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/i18n.rs:131:13 [INFO] [stdout] | [INFO] [stdout] 131 | / match f { [INFO] [stdout] 132 | | Ok(f) => { [INFO] [stdout] 133 | | return Some(f); [INFO] [stdout] ... | [INFO] [stdout] 136 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 131 ~ if let Ok(f) = f { [INFO] [stdout] 132 + return Some(f); [INFO] [stdout] 133 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/i18n.rs:168:9 [INFO] [stdout] | [INFO] [stdout] 168 | return I18n { catalog: catalog }; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 168 - return I18n { catalog: catalog }; [INFO] [stdout] 168 + I18n { catalog: catalog } [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/i18n.rs:156:9 [INFO] [stdout] | [INFO] [stdout] 156 | / match re { [INFO] [stdout] 157 | | Some(f) => { [INFO] [stdout] 158 | | let re = Catalog::parse(f); [INFO] [stdout] 159 | | match re { [INFO] [stdout] ... | [INFO] [stdout] 166 | | None => {} [INFO] [stdout] 167 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 156 ~ if let Some(f) = re { [INFO] [stdout] 157 + let re = Catalog::parse(f); [INFO] [stdout] 158 + match re { [INFO] [stdout] 159 + Ok(c) => { [INFO] [stdout] 160 + catalog = Some(c); [INFO] [stdout] 161 + } [INFO] [stdout] 162 + Err(_) => {} [INFO] [stdout] 163 + } [INFO] [stdout] 164 + } [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/i18n.rs:159:17 [INFO] [stdout] | [INFO] [stdout] 159 | / match re { [INFO] [stdout] 160 | | Ok(c) => { [INFO] [stdout] 161 | | catalog = Some(c); [INFO] [stdout] ... | [INFO] [stdout] 164 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 159 ~ if let Ok(c) = re { [INFO] [stdout] 160 + catalog = Some(c); [INFO] [stdout] 161 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/i18n.rs:182:13 [INFO] [stdout] | [INFO] [stdout] 182 | return c.gettext(s); [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 182 - return c.gettext(s); [INFO] [stdout] 182 + c.gettext(s) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/i18n.rs:185:13 [INFO] [stdout] | [INFO] [stdout] 185 | return s; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 185 - return s; [INFO] [stdout] 185 + s [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/fanbox/comment_list.rs:63:24 [INFO] [stdout] | [INFO] [stdout] 63 | let next_url = match value["nextUrl"].as_str() { [INFO] [stdout] | ________________________^ [INFO] [stdout] 64 | | Some(next_url) => Some(next_url.to_owned()), [INFO] [stdout] 65 | | None => None, [INFO] [stdout] 66 | | }; [INFO] [stdout] | |_________^ help: try: `value["nextUrl"].as_str().map(|next_url| next_url.to_owned())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/list.rs:107:1 [INFO] [stdout] | [INFO] [stdout] 107 | impl Into> for NonTailList { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] = note: `#[warn(clippy::from_over_into)]` on by default [INFO] [stdout] help: replace the `Into` implementation with `From>` [INFO] [stdout] | [INFO] [stdout] 107 ~ impl From> for Vec { [INFO] [stdout] 108 ~ fn from(val: NonTailList) -> Self { [INFO] [stdout] 109 ~ val.data [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/list.rs:113:1 [INFO] [stdout] | [INFO] [stdout] 113 | impl Into> for &NonTailList { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From<&list::NonTailList>` [INFO] [stdout] | [INFO] [stdout] 113 ~ impl From<&NonTailList> for Vec { [INFO] [stdout] 114 ~ fn from(val: &NonTailList) -> Self { [INFO] [stdout] 115 ~ val.data.clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/opt/author_name_filter.rs:66:31 [INFO] [stdout] | [INFO] [stdout] 66 | Self::Regex(r) => r.replace_all(author, "").to_owned().to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] = note: `#[warn(clippy::suspicious_to_owned)]` on by default [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 66 | Self::Regex(r) => r.replace_all(author, "").into_owned().to_string(), [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 66 - Self::Regex(r) => r.replace_all(author, "").to_owned().to_string(), [INFO] [stdout] 66 + Self::Regex(r) => r.replace_all(author, "").clone().to_string(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/opt/author_name_filter.rs:80:9 [INFO] [stdout] | [INFO] [stdout] 80 | return ori; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 80 - return ori; [INFO] [stdout] 80 + ori [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/opt/author_name_filter.rs:132:9 [INFO] [stdout] | [INFO] [stdout] 132 | return Err(Self::Error::from("")); [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 132 - return Err(Self::Error::from("")); [INFO] [stdout] 132 + Err(Self::Error::from("")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/fanbox/creator.rs:91:24 [INFO] [stdout] | [INFO] [stdout] 91 | Some(s) => match s { [INFO] [stdout] | ________________________^ [INFO] [stdout] 92 | | "image" => Self::Image(FanboxProfileImage::new(data, client)), [INFO] [stdout] 93 | | _ => Self::Unknown(data.clone()), [INFO] [stdout] 94 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/fanbox/creator.rs:91:18 [INFO] [stdout] | [INFO] [stdout] 91 | Some(s) => match s { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 92 | "image" => Self::Image(FanboxProfileImage::new(data, client)), [INFO] [stdout] | ^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/opt/author_name_filter.rs:111:21 [INFO] [stdout] | [INFO] [stdout] 111 | let t = (&j["type"]) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `j["type"]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/opt/author_name_filter.rs:115:24 [INFO] [stdout] | [INFO] [stdout] 115 | let rule = (&j["rule"]) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `j["rule"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `r` after checking its variant with `is_err` [INFO] [stdout] --> src/opt/author_name_filter.rs:142:13 [INFO] [stdout] | [INFO] [stdout] 138 | if r.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = &r` [INFO] [stdout] ... [INFO] [stdout] 142 | r.as_ref().unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `HTTP` contains a capitalized acronym [INFO] [stdout] --> src/opt/proxy.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | HTTP(Option), [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Http` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `HTTPS` contains a capitalized acronym [INFO] [stdout] --> src/opt/proxy.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | HTTPS(Option), [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Https` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [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/opt/proxy.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | / match value.as_str() { [INFO] [stdout] 51 | | Some(s) => { [INFO] [stdout] 52 | | return Ok(Self::All(Some(Url::parse(s)?))); [INFO] [stdout] ... | [INFO] [stdout] 55 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 50 ~ if let Some(s) = value.as_str() { [INFO] [stdout] 51 + return Ok(Self::All(Some(Url::parse(s)?))); [INFO] [stdout] 52 + } [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/opt/proxy.rs:146:13 [INFO] [stdout] | [INFO] [stdout] 146 | / match i.r#match(url) { [INFO] [stdout] 147 | | Some(u) => { [INFO] [stdout] 148 | | return u; [INFO] [stdout] ... | [INFO] [stdout] 151 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 146 ~ if let Some(u) = i.r#match(url) { [INFO] [stdout] 147 + return u; [INFO] [stdout] 148 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/opt/proxy.rs:157:1 [INFO] [stdout] | [INFO] [stdout] 157 | / impl Default for ProxyChain { [INFO] [stdout] 158 | | fn default() -> Self { [INFO] [stdout] 159 | | Self { [INFO] [stdout] 160 | | proxies: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 163 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 136 + #[derive(Default)] [INFO] [stdout] 137 | pub struct ProxyChain { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `ok` [INFO] [stdout] --> src/opt/size.rs:8:24 [INFO] [stdout] | [INFO] [stdout] 8 | Some(s) => match parse_size::parse_size(s) { [INFO] [stdout] | ________________________^ [INFO] [stdout] 9 | | Ok(s) => Some(s), [INFO] [stdout] 10 | | Err(_) => None, [INFO] [stdout] 11 | | }, [INFO] [stdout] | |_____________^ help: replace with: `parse_size::parse_size(s).ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `ok` [INFO] [stdout] --> src/opt/size.rs:20:20 [INFO] [stdout] | [INFO] [stdout] 20 | Some(s) => match u32::try_from(s) { [INFO] [stdout] | ____________________^ [INFO] [stdout] 21 | | Ok(s) => Some(s), [INFO] [stdout] 22 | | Err(_) => None, [INFO] [stdout] 23 | | }, [INFO] [stdout] | |_________^ help: replace with: `u32::try_from(s).ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err [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/opthelper.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | / match self.opt.get_ref().download_base { [INFO] [stdout] 116 | | Some(ref r) => { [INFO] [stdout] 117 | | return r.clone(); [INFO] [stdout] ... | [INFO] [stdout] 120 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 115 ~ if let Some(ref r) = self.opt.get_ref().download_base { [INFO] [stdout] 116 + return r.clone(); [INFO] [stdout] 117 + } [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/opthelper.rs:121:9 [INFO] [stdout] | [INFO] [stdout] 121 | / match self.settings.get_ref().get_str("download-base") { [INFO] [stdout] 122 | | Some(r) => { [INFO] [stdout] 123 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 126 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 121 ~ if let Some(r) = self.settings.get_ref().get_str("download-base") { [INFO] [stdout] 122 + return r; [INFO] [stdout] 123 + } [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/opthelper.rs:135:9 [INFO] [stdout] | [INFO] [stdout] 135 | / match self.opt.get_ref().download_multiple_posts { [INFO] [stdout] 136 | | Some(r) => { [INFO] [stdout] 137 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 140 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 135 ~ if let Some(r) = self.opt.get_ref().download_multiple_posts { [INFO] [stdout] 136 + return r; [INFO] [stdout] 137 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `re` after checking its variant with `is_some` [INFO] [stdout] --> src/opthelper.rs:158:25 [INFO] [stdout] | [INFO] [stdout] 157 | if re.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = re` [INFO] [stdout] 158 | return Some(re.unwrap().as_i64().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `re` after checking its variant with `is_some` [INFO] [stdout] --> src/opthelper.rs:170:25 [INFO] [stdout] | [INFO] [stdout] 169 | if re.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = re` [INFO] [stdout] 170 | return Some(re.unwrap().as_i64().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [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/opthelper.rs:208:9 [INFO] [stdout] | [INFO] [stdout] 208 | / match self.opt.get_ref().force_yuv420p { [INFO] [stdout] 209 | | Some(r) => { [INFO] [stdout] 210 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 213 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 208 ~ if let Some(r) = self.opt.get_ref().force_yuv420p { [INFO] [stdout] 209 + return r; [INFO] [stdout] 210 + } [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/opthelper.rs:233:9 [INFO] [stdout] | [INFO] [stdout] 233 | / match self.opt.get_ref().max_download_post_tasks { [INFO] [stdout] 234 | | Some(r) => { [INFO] [stdout] 235 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 238 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 233 ~ if let Some(r) = self.opt.get_ref().max_download_post_tasks { [INFO] [stdout] 234 + return r; [INFO] [stdout] 235 + } [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/opthelper.rs:239:9 [INFO] [stdout] | [INFO] [stdout] 239 | / match self.settings.get_ref().get("max-download-post-tasks") { [INFO] [stdout] 240 | | Some(re) => { [INFO] [stdout] 241 | | return re.as_usize().unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 244 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 239 ~ if let Some(re) = self.settings.get_ref().get("max-download-post-tasks") { [INFO] [stdout] 240 + return re.as_usize().unwrap(); [INFO] [stdout] 241 + } [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/opthelper.rs:250:9 [INFO] [stdout] | [INFO] [stdout] 250 | / match self.opt.get_ref().max_download_tasks { [INFO] [stdout] 251 | | Some(r) => { [INFO] [stdout] 252 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 255 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 250 ~ if let Some(r) = self.opt.get_ref().max_download_tasks { [INFO] [stdout] 251 + return r; [INFO] [stdout] 252 + } [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/opthelper.rs:256:9 [INFO] [stdout] | [INFO] [stdout] 256 | / match self.settings.get_ref().get("max-download-tasks") { [INFO] [stdout] 257 | | Some(re) => { [INFO] [stdout] 258 | | return re.as_usize().unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 261 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 256 ~ if let Some(re) = self.settings.get_ref().get("max-download-tasks") { [INFO] [stdout] 257 + return re.as_usize().unwrap(); [INFO] [stdout] 258 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `re` after checking its variant with `is_some` [INFO] [stdout] --> src/opthelper.rs:275:20 [INFO] [stdout] | [INFO] [stdout] 274 | if re.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = re` [INFO] [stdout] 275 | return re.unwrap().as_u64().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [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/opthelper.rs:267:9 [INFO] [stdout] | [INFO] [stdout] 267 | / match self.opt.get_ref().max_threads { [INFO] [stdout] 268 | | Some(r) => { [INFO] [stdout] 269 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 272 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 267 ~ if let Some(r) = self.opt.get_ref().max_threads { [INFO] [stdout] 268 + return r; [INFO] [stdout] 269 + } [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/opthelper.rs:282:9 [INFO] [stdout] | [INFO] [stdout] 282 | / match self.opt.get_ref().multiple_threads_download { [INFO] [stdout] 283 | | Some(r) => { [INFO] [stdout] 284 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 287 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 282 ~ if let Some(r) = self.opt.get_ref().multiple_threads_download { [INFO] [stdout] 283 + return r; [INFO] [stdout] 284 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `re` after checking its variant with `is_some` [INFO] [stdout] --> src/opthelper.rs:312:35 [INFO] [stdout] | [INFO] [stdout] 311 | if re.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = &re` [INFO] [stdout] 312 | return parse_u32_size(re.as_ref().unwrap()).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [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/opthelper.rs:304:9 [INFO] [stdout] | [INFO] [stdout] 304 | / match self.opt.get_ref().part_size { [INFO] [stdout] 305 | | Some(r) => { [INFO] [stdout] 306 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 309 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 304 ~ if let Some(r) = self.opt.get_ref().part_size { [INFO] [stdout] 305 + return r; [INFO] [stdout] 306 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `opt.use_progress_bar` after checking its variant with `is_some` [INFO] [stdout] --> src/opthelper.rs:335:43 [INFO] [stdout] | [INFO] [stdout] 334 | .replace_with2(if opt.use_progress_bar.is_some() { [INFO] [stdout] | --------------------------------- help: try: `if let Some() = opt.use_progress_bar` [INFO] [stdout] 335 | Some(UseProgressBar::from(opt.use_progress_bar.unwrap())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/opthelper.rs:354:38 [INFO] [stdout] | [INFO] [stdout] 354 | HeaderMap::from_json(&settings.get("fanbox-http-headers").unwrap()).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `settings.get("fanbox-http-headers").unwrap()` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/opthelper.rs:385:13 [INFO] [stdout] | [INFO] [stdout] 385 | / match self.log_cfg() { [INFO] [stdout] 386 | | Some(cfg) => { [INFO] [stdout] 387 | | crate::log_cfg::init_with_file(cfg); [INFO] [stdout] ... | [INFO] [stdout] 390 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 385 ~ if let Some(cfg) = self.log_cfg() { [INFO] [stdout] 386 + crate::log_cfg::init_with_file(cfg); [INFO] [stdout] 387 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `re` after checking its variant with `is_some` [INFO] [stdout] --> src/opthelper.rs:401:25 [INFO] [stdout] | [INFO] [stdout] 400 | if re.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = re` [INFO] [stdout] 401 | return Some(re.unwrap().as_i64().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [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/opthelper.rs:441:9 [INFO] [stdout] | [INFO] [stdout] 441 | / match self.opt.get_ref().use_web_description { [INFO] [stdout] 442 | | Some(t) => { [INFO] [stdout] 443 | | return t; [INFO] [stdout] ... | [INFO] [stdout] 446 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 441 ~ if let Some(t) = self.opt.get_ref().use_web_description { [INFO] [stdout] 442 + return t; [INFO] [stdout] 443 + } [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/opthelper.rs:469:9 [INFO] [stdout] | [INFO] [stdout] 469 | / match self.opt.get_ref().user_agent.as_ref() { [INFO] [stdout] 470 | | Some(ua) => return ua.to_owned(), [INFO] [stdout] 471 | | None => {} [INFO] [stdout] 472 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(ua) = self.opt.get_ref().user_agent.as_ref() { return ua.to_owned() }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/opthelper.rs:473:9 [INFO] [stdout] | [INFO] [stdout] 473 | / match self.settings.get_ref().get("user-agent") { [INFO] [stdout] 474 | | Some(ua) => return ua.as_str().unwrap().to_owned(), [INFO] [stdout] 475 | | None => {} [INFO] [stdout] 476 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(ua) = self.settings.get_ref().get("user-agent") { return ua.as_str().unwrap().to_owned() }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/opthelper.rs:481:9 [INFO] [stdout] | [INFO] [stdout] 481 | / match self.opt.get_ref().browser.as_ref() { [INFO] [stdout] 482 | | Some(b) => return b.to_owned(), [INFO] [stdout] 483 | | None => {} [INFO] [stdout] 484 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(b) = self.opt.get_ref().browser.as_ref() { return b.to_owned() }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/opthelper.rs:485:9 [INFO] [stdout] | [INFO] [stdout] 485 | / match self.settings.get_ref().get("browser") { [INFO] [stdout] 486 | | Some(w) => return serde_json::from_str(&format!("\"{}\"", w.as_str().unwrap())).unwrap(), [INFO] [stdout] 487 | | None => {} [INFO] [stdout] 488 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(w) = self.settings.get_ref().get("browser") { return serde_json::from_str(&format!("\"{}\"", w.as_str().unwrap())).unwrap() }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/opthelper.rs:493:9 [INFO] [stdout] | [INFO] [stdout] 493 | / match self.opt.get_ref().os.as_ref() { [INFO] [stdout] 494 | | Some(b) => return b.to_owned(), [INFO] [stdout] 495 | | None => {} [INFO] [stdout] 496 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(b) = self.opt.get_ref().os.as_ref() { return b.to_owned() }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/opthelper.rs:497:9 [INFO] [stdout] | [INFO] [stdout] 497 | / match self.settings.get_ref().get("os") { [INFO] [stdout] 498 | | Some(w) => return serde_json::from_str(&format!("\"{}\"", w.as_str().unwrap())).unwrap(), [INFO] [stdout] 499 | | None => {} [INFO] [stdout] 500 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(w) = self.settings.get_ref().get("os") { return serde_json::from_str(&format!("\"{}\"", w.as_str().unwrap())).unwrap() }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/fanbox/item_list.rs:64:24 [INFO] [stdout] | [INFO] [stdout] 64 | let next_url = match value["nextUrl"].as_str() { [INFO] [stdout] | ________________________^ [INFO] [stdout] 65 | | Some(next_url) => Some(next_url.to_owned()), [INFO] [stdout] 66 | | None => None, [INFO] [stdout] 67 | | }; [INFO] [stdout] | |_________^ help: try: `value["nextUrl"].as_str().map(|next_url| next_url.to_owned())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [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/opthelper.rs:539:9 [INFO] [stdout] | [INFO] [stdout] 539 | / match self.opt.get_ref().download_multiple_files { [INFO] [stdout] 540 | | Some(r) => { [INFO] [stdout] 541 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 544 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 539 ~ if let Some(r) = self.opt.get_ref().download_multiple_files { [INFO] [stdout] 540 + return r; [INFO] [stdout] 541 + } [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/opthelper.rs:557:9 [INFO] [stdout] | [INFO] [stdout] 557 | / match self.opt.get_ref().ugoira_max_fps { [INFO] [stdout] 558 | | Some(r) => { [INFO] [stdout] 559 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 562 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 557 ~ if let Some(r) = self.opt.get_ref().ugoira_max_fps { [INFO] [stdout] 558 + return r; [INFO] [stdout] 559 + } [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/opthelper.rs:572:9 [INFO] [stdout] | [INFO] [stdout] 572 | / match self.opt.get_ref().x264_crf { [INFO] [stdout] 573 | | Some(r) => { [INFO] [stdout] 574 | | return Some(r); [INFO] [stdout] ... | [INFO] [stdout] 577 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 572 ~ if let Some(r) = self.opt.get_ref().x264_crf { [INFO] [stdout] 573 + return Some(r); [INFO] [stdout] 574 + } [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/opthelper.rs:587:9 [INFO] [stdout] | [INFO] [stdout] 587 | / match self.opt.get_ref().x264_profile { [INFO] [stdout] 588 | | Some(r) => { [INFO] [stdout] 589 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 592 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 587 ~ if let Some(r) = self.opt.get_ref().x264_profile { [INFO] [stdout] 588 + return r; [INFO] [stdout] 589 + } [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/opthelper.rs:602:9 [INFO] [stdout] | [INFO] [stdout] 602 | / match self.opt.get_ref().fanbox_page_number { [INFO] [stdout] 603 | | Some(r) => { [INFO] [stdout] 604 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 607 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 602 ~ if let Some(r) = self.opt.get_ref().fanbox_page_number { [INFO] [stdout] 603 + return r; [INFO] [stdout] 604 + } [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/opthelper.rs:680:9 [INFO] [stdout] | [INFO] [stdout] 680 | / match self.opt.get_ref().ugoira.as_ref() { [INFO] [stdout] 681 | | Some(d) => { [INFO] [stdout] 682 | | return Some(d.clone()); [INFO] [stdout] ... | [INFO] [stdout] 685 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 680 ~ if let Some(d) = self.opt.get_ref().ugoira.as_ref() { [INFO] [stdout] 681 + return Some(d.clone()); [INFO] [stdout] 682 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/opthelper.rs:747:21 [INFO] [stdout] | [INFO] [stdout] 747 | None => match self.settings.get_ref().get_str("ffprobe") { [INFO] [stdout] | _____________________^ [INFO] [stdout] 748 | | Some(s) => Some(s.clone()), [INFO] [stdout] 749 | | None => { [INFO] [stdout] 750 | | #[cfg(feature = "docker")] [INFO] [stdout] ... | [INFO] [stdout] 754 | | }, [INFO] [stdout] | |_____________^ help: try: `self.settings.get_ref().get_str("ffprobe").map(|s| s.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/opthelper.rs:762:21 [INFO] [stdout] | [INFO] [stdout] 762 | None => match self.settings.get_ref().get_str("ffmpeg") { [INFO] [stdout] | _____________________^ [INFO] [stdout] 763 | | Some(s) => Some(s.clone()), [INFO] [stdout] 764 | | None => { [INFO] [stdout] 765 | | #[cfg(feature = "docker")] [INFO] [stdout] ... | [INFO] [stdout] 769 | | }, [INFO] [stdout] | |_____________^ help: try: `self.settings.get_ref().get_str("ffmpeg").map(|s| s.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [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/fanbox/paginated_creator_posts.rs:106:17 [INFO] [stdout] | [INFO] [stdout] 106 | / match pages.get_page(0).await { [INFO] [stdout] 107 | | Some(data) => { [INFO] [stdout] 108 | | println!("{:?}", data); [INFO] [stdout] 109 | | if data.has_next_page() { [INFO] [stdout] ... | [INFO] [stdout] 120 | | None => {} [INFO] [stdout] 121 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 106 ~ if let Some(data) = pages.get_page(0).await { [INFO] [stdout] 107 + println!("{:?}", data); [INFO] [stdout] 108 + if data.has_next_page() { [INFO] [stdout] 109 + match data.get_next_page().await { [INFO] [stdout] 110 + Ok(data) => { [INFO] [stdout] 111 + println!("{:?}", data); [INFO] [stdout] 112 + } [INFO] [stdout] 113 + Err(e) => { [INFO] [stdout] 114 + println!("{}", e); [INFO] [stdout] 115 + } [INFO] [stdout] 116 + } [INFO] [stdout] 117 + } [INFO] [stdout] 118 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self._config` after checking its variant with `is_some` [INFO] [stdout] --> src/opts.rs:236:35 [INFO] [stdout] | [INFO] [stdout] 235 | if self._config.is_some() { [INFO] [stdout] | ------------------------- help: try: `if let Some() = &self._config` [INFO] [stdout] 236 | if check_file_exists(&self._config.as_ref().unwrap()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/opts.rs:236:34 [INFO] [stdout] | [INFO] [stdout] 236 | if check_file_exists(&self._config.as_ref().unwrap()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self._config.as_ref().unwrap()` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/opts.rs:307:15 [INFO] [stdout] | [INFO] [stdout] 307 | let tmp = match s { [INFO] [stdout] | _______________^ [INFO] [stdout] 308 | | Some(s) => Some(s.as_ref().to_lowercase()), [INFO] [stdout] 309 | | None => None, [INFO] [stdout] 310 | | }; [INFO] [stdout] | |_____^ help: try: `s.map(|s| s.as_ref().to_lowercase())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `r` after checking its variant with `is_err` [INFO] [stdout] --> src/opts.rs:890:17 [INFO] [stdout] | [INFO] [stdout] 886 | if r.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = r` [INFO] [stdout] ... [INFO] [stdout] 890 | r.unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `r` after checking its variant with `is_err` [INFO] [stdout] --> src/opts.rs:910:17 [INFO] [stdout] | [INFO] [stdout] 904 | if r.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = r` [INFO] [stdout] ... [INFO] [stdout] 910 | r.unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `r` after checking its variant with `is_err` [INFO] [stdout] --> src/opts.rs:945:17 [INFO] [stdout] | [INFO] [stdout] 941 | if r.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = r` [INFO] [stdout] ... [INFO] [stdout] 945 | r.unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/post.rs:217:9 [INFO] [stdout] | [INFO] [stdout] 217 | / match self.comment_list() { [INFO] [stdout] 218 | | Some(list) => { [INFO] [stdout] 219 | | for i in list.items { [INFO] [stdout] 220 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 223 | | None => {} [INFO] [stdout] 224 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 217 ~ if let Some(list) = self.comment_list() { [INFO] [stdout] 218 + for i in list.items { [INFO] [stdout] 219 + i.check_unknown()?; [INFO] [stdout] 220 + } [INFO] [stdout] 221 + } [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/fanbox/post.rs:225:9 [INFO] [stdout] | [INFO] [stdout] 225 | / match self.next_post() { [INFO] [stdout] 226 | | Some(post) => post.check_unknown()?, [INFO] [stdout] 227 | | None => {} [INFO] [stdout] 228 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(post) = self.next_post() { post.check_unknown()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/opts.rs:769:34 [INFO] [stdout] | [INFO] [stdout] 769 | log::error!("{}", err.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` 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/fanbox/post.rs:229:9 [INFO] [stdout] | [INFO] [stdout] 229 | / match self.prev_post() { [INFO] [stdout] 230 | | Some(post) => post.check_unknown()?, [INFO] [stdout] 231 | | None => {} [INFO] [stdout] 232 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(post) = self.prev_post() { post.check_unknown()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/opts.rs:773:35 [INFO] [stdout] | [INFO] [stdout] 773 | if result.opt_present("h") || result.free.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `result.free.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/post.rs:333:9 [INFO] [stdout] | [INFO] [stdout] 333 | / match self.name() { [INFO] [stdout] 334 | | Some(name) => match self.extension() { [INFO] [stdout] 335 | | Some(ext) => { [INFO] [stdout] 336 | | dh.set_file_name((name.to_owned() + "." + ext).as_str()); [INFO] [stdout] ... | [INFO] [stdout] 342 | | None => {} [INFO] [stdout] 343 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 333 ~ if let Some(name) = self.name() { match self.extension() { [INFO] [stdout] 334 + Some(ext) => { [INFO] [stdout] 335 + dh.set_file_name((name.to_owned() + "." + ext).as_str()); [INFO] [stdout] 336 + } [INFO] [stdout] 337 + None => { [INFO] [stdout] 338 + dh.set_file_name(name); [INFO] [stdout] 339 + } [INFO] [stdout] 340 + } } [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/fanbox/post.rs:413:9 [INFO] [stdout] | [INFO] [stdout] 413 | / match self.files() { [INFO] [stdout] 414 | | Some(list) => { [INFO] [stdout] 415 | | for i in list { [INFO] [stdout] 416 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 419 | | None => {} [INFO] [stdout] 420 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 413 ~ if let Some(list) = self.files() { [INFO] [stdout] 414 + for i in list { [INFO] [stdout] 415 + i.check_unknown()?; [INFO] [stdout] 416 + } [INFO] [stdout] 417 + } [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/opts.rs:1062:18 [INFO] [stdout] | [INFO] [stdout] 1062 | Ok(r) => match r { [INFO] [stdout] | __________________^ [INFO] [stdout] 1063 | | Some(crf) => { [INFO] [stdout] 1064 | | if crf < -1f32 { [INFO] [stdout] 1065 | | log::error!("{}", gettext("x264-crf can not less than -1.")); [INFO] [stdout] ... | [INFO] [stdout] 1071 | | None => {} [INFO] [stdout] 1072 | | }, [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1062 ~ Ok(r) => if let Some(crf) = r { [INFO] [stdout] 1063 + if crf < -1f32 { [INFO] [stdout] 1064 + log::error!("{}", gettext("x264-crf can not less than -1.")); [INFO] [stdout] 1065 + return None; [INFO] [stdout] 1066 + } else { [INFO] [stdout] 1067 + re.as_mut().unwrap().x264_crf.replace(crf); [INFO] [stdout] 1068 + } [INFO] [stdout] 1069 ~ }, [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/opts.rs:1085:18 [INFO] [stdout] | [INFO] [stdout] 1085 | Ok(r) => match r { [INFO] [stdout] | __________________^ [INFO] [stdout] 1086 | | Some(crf) => { [INFO] [stdout] 1087 | | if crf <= 0f32 || crf > 1000f32 { [INFO] [stdout] 1088 | | log::error!( [INFO] [stdout] ... | [INFO] [stdout] 1097 | | None => {} [INFO] [stdout] 1098 | | }, [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1085 ~ Ok(r) => if let Some(crf) = r { [INFO] [stdout] 1086 + if crf <= 0f32 || crf > 1000f32 { [INFO] [stdout] 1087 + log::error!( [INFO] [stdout] 1088 + "{}", [INFO] [stdout] 1089 + gettext("ugoira-max-fps can not less than 0 or greater than 1000.") [INFO] [stdout] 1090 + ); [INFO] [stdout] 1091 + return None; [INFO] [stdout] 1092 + } else { [INFO] [stdout] 1093 + re.as_mut().unwrap().ugoira_max_fps.replace(crf); [INFO] [stdout] 1094 + } [INFO] [stdout] 1095 ~ }, [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/fanbox/post.rs:624:9 [INFO] [stdout] | [INFO] [stdout] 624 | / match self.body() { [INFO] [stdout] 625 | | Some(body) => { [INFO] [stdout] 626 | | body.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 629 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 624 ~ if let Some(body) = self.body() { [INFO] [stdout] 625 + body.check_unknown()?; [INFO] [stdout] 626 + } [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/fanbox/post.rs:630:9 [INFO] [stdout] | [INFO] [stdout] 630 | / match self.comment_list() { [INFO] [stdout] 631 | | Some(list) => { [INFO] [stdout] 632 | | list.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 635 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 630 ~ if let Some(list) = self.comment_list() { [INFO] [stdout] 631 + list.check_unknown()?; [INFO] [stdout] 632 + } [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/fanbox/post.rs:636:9 [INFO] [stdout] | [INFO] [stdout] 636 | / match self.next_post() { [INFO] [stdout] 637 | | Some(next) => { [INFO] [stdout] 638 | | next.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 641 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 636 ~ if let Some(next) = self.next_post() { [INFO] [stdout] 637 + next.check_unknown()?; [INFO] [stdout] 638 + } [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/fanbox/post.rs:642:9 [INFO] [stdout] | [INFO] [stdout] 642 | / match self.prev_post() { [INFO] [stdout] 643 | | Some(prev) => { [INFO] [stdout] 644 | | prev.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 647 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 642 ~ if let Some(prev) = self.prev_post() { [INFO] [stdout] 643 + prev.check_unknown()?; [INFO] [stdout] 644 + } [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/fanbox/post.rs:726:9 [INFO] [stdout] | [INFO] [stdout] 726 | / match self.images() { [INFO] [stdout] 727 | | Some(imgs) => { [INFO] [stdout] 728 | | for img in imgs { [INFO] [stdout] 729 | | img.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 732 | | None => {} [INFO] [stdout] 733 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 726 ~ if let Some(imgs) = self.images() { [INFO] [stdout] 727 + for img in imgs { [INFO] [stdout] 728 + img.check_unknown()?; [INFO] [stdout] 729 + } [INFO] [stdout] 730 + } [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/opts.rs:1238:5 [INFO] [stdout] | [INFO] [stdout] 1238 | / match result.opt_str("browser") { [INFO] [stdout] 1239 | | Some(r) => { [INFO] [stdout] 1240 | | match serde_json::from_str(&format!("\"{}\"", r)) { [INFO] [stdout] 1241 | | Ok(r) => { [INFO] [stdout] ... | [INFO] [stdout] 1256 | | None => {} [INFO] [stdout] 1257 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1238 ~ if let Some(r) = result.opt_str("browser") { [INFO] [stdout] 1239 + match serde_json::from_str(&format!("\"{}\"", r)) { [INFO] [stdout] 1240 + Ok(r) => { [INFO] [stdout] 1241 + re.as_mut().unwrap().browser = Some(r); [INFO] [stdout] 1242 + } [INFO] [stdout] 1243 + Err(e) => { [INFO] [stdout] 1244 + log::error!( [INFO] [stdout] 1245 + "{} {}", [INFO] [stdout] 1246 + gettext("Failed to parse :") [INFO] [stdout] 1247 + .replace("", "browser") [INFO] [stdout] 1248 + .as_str(), [INFO] [stdout] 1249 + e [INFO] [stdout] 1250 + ); [INFO] [stdout] 1251 + return None; [INFO] [stdout] 1252 + } [INFO] [stdout] 1253 + } [INFO] [stdout] 1254 + } [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/opts.rs:1258:5 [INFO] [stdout] | [INFO] [stdout] 1258 | / match result.opt_str("os") { [INFO] [stdout] 1259 | | Some(r) => { [INFO] [stdout] 1260 | | match serde_json::from_str(&format!("\"{}\"", r)) { [INFO] [stdout] 1261 | | Ok(r) => { [INFO] [stdout] ... | [INFO] [stdout] 1276 | | None => {} [INFO] [stdout] 1277 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1258 ~ if let Some(r) = result.opt_str("os") { [INFO] [stdout] 1259 + match serde_json::from_str(&format!("\"{}\"", r)) { [INFO] [stdout] 1260 + Ok(r) => { [INFO] [stdout] 1261 + re.as_mut().unwrap().os = Some(r); [INFO] [stdout] 1262 + } [INFO] [stdout] 1263 + Err(e) => { [INFO] [stdout] 1264 + log::error!( [INFO] [stdout] 1265 + "{} {}", [INFO] [stdout] 1266 + gettext("Failed to parse :") [INFO] [stdout] 1267 + .replace("", "os") [INFO] [stdout] 1268 + .as_str(), [INFO] [stdout] 1269 + e [INFO] [stdout] 1270 + ); [INFO] [stdout] 1271 + return None; [INFO] [stdout] 1272 + } [INFO] [stdout] 1273 + } [INFO] [stdout] 1274 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/parser/description.rs:51:1 [INFO] [stdout] | [INFO] [stdout] 51 | / impl Default for DescriptionNode { [INFO] [stdout] 52 | | fn default() -> Self { [INFO] [stdout] 53 | | Self { [INFO] [stdout] 54 | | tag: String::from(""), [INFO] [stdout] ... | [INFO] [stdout] 59 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 42 + #[derive(Default)] [INFO] [stdout] 43 | struct DescriptionNode { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/parser/description.rs:71:9 [INFO] [stdout] | [INFO] [stdout] 71 | / match self.tag.as_str() { [INFO] [stdout] 72 | | "h1" => true, [INFO] [stdout] 73 | | "h2" => true, [INFO] [stdout] 74 | | "h3" => true, [INFO] [stdout] ... | [INFO] [stdout] 78 | | _ => false, [INFO] [stdout] 79 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 71 - match self.tag.as_str() { [INFO] [stdout] 72 - "h1" => true, [INFO] [stdout] 73 - "h2" => true, [INFO] [stdout] 74 - "h3" => true, [INFO] [stdout] 75 - "h4" => true, [INFO] [stdout] 76 - "h5" => true, [INFO] [stdout] 77 - "h6" => true, [INFO] [stdout] 78 - _ => false, [INFO] [stdout] 79 - } [INFO] [stdout] 71 + matches!(self.tag.as_str(), "h1" | "h2" | "h3" | "h4" | "h5" | "h6") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `href` after checking its variant with `is_some` [INFO] [stdout] --> src/parser/description.rs:228:36 [INFO] [stdout] | [INFO] [stdout] 227 | if href.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = href` [INFO] [stdout] 228 | let href = href.unwrap().value.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parser/description.rs:203:20 [INFO] [stdout] | [INFO] [stdout] 203 | if self.nodes.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.nodes.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/parser/description.rs:223:17 [INFO] [stdout] | [INFO] [stdout] 223 | nod.tag = tag.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `parser::description::DescriptionNode { tag: tag.to_string(), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/parser/description.rs:222:17 [INFO] [stdout] | [INFO] [stdout] 222 | let mut nod = DescriptionNode::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parser/description.rs:215:24 [INFO] [stdout] | [INFO] [stdout] 215 | if self.nodes.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.nodes.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/post.rs:947:9 [INFO] [stdout] | [INFO] [stdout] 947 | / match self.body() { [INFO] [stdout] 948 | | Some(body) => { [INFO] [stdout] 949 | | body.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 952 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 947 ~ if let Some(body) = self.body() { [INFO] [stdout] 948 + body.check_unknown()?; [INFO] [stdout] 949 + } [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/fanbox/post.rs:953:9 [INFO] [stdout] | [INFO] [stdout] 953 | / match self.comment_list() { [INFO] [stdout] 954 | | Some(list) => { [INFO] [stdout] 955 | | for i in list.items { [INFO] [stdout] 956 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 959 | | None => {} [INFO] [stdout] 960 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 953 ~ if let Some(list) = self.comment_list() { [INFO] [stdout] 954 + for i in list.items { [INFO] [stdout] 955 + i.check_unknown()?; [INFO] [stdout] 956 + } [INFO] [stdout] 957 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parser/description.rs:275:20 [INFO] [stdout] | [INFO] [stdout] 275 | if self.nodes.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.nodes.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/parser/description.rs:301:73 [INFO] [stdout] | [INFO] [stdout] 301 | format!("{} {}", gettext("Failed to parse HTML:"), e.to_string()).into(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/post.rs:961:9 [INFO] [stdout] | [INFO] [stdout] 961 | / match self.next_post() { [INFO] [stdout] 962 | | Some(post) => post.check_unknown()?, [INFO] [stdout] 963 | | None => {} [INFO] [stdout] 964 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(post) = self.next_post() { post.check_unknown()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/post.rs:965:9 [INFO] [stdout] | [INFO] [stdout] 965 | / match self.prev_post() { [INFO] [stdout] 966 | | Some(post) => post.check_unknown()?, [INFO] [stdout] 967 | | None => {} [INFO] [stdout] 968 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(post) = self.prev_post() { post.check_unknown()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parser/description.rs:308:12 [INFO] [stdout] | [INFO] [stdout] 308 | if self.nodes.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.nodes.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `ok` [INFO] [stdout] --> src/parser/json.rs:7:26 [INFO] [stdout] | [INFO] [stdout] 7 | Some(num) => match num.trim().parse::() { [INFO] [stdout] | __________________________^ [INFO] [stdout] 8 | | Ok(num) => Some(num), [INFO] [stdout] 9 | | Err(_) => None, [INFO] [stdout] 10 | | }, [INFO] [stdout] | |_____________^ help: replace with: `num.trim().parse::().ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `r` after checking its variant with `is_err` [INFO] [stdout] --> src/parser/metadata.rs:53:80 [INFO] [stdout] | [INFO] [stdout] 52 | if r.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = r` [INFO] [stdout] 53 | log::error!("{} {}", gettext("Failed to parse JSON:"), r.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/parser/metadata.rs:79:73 [INFO] [stdout] | [INFO] [stdout] 79 | log::error!("{} {}", gettext("Failed to parse HTML:"), e.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/pixiv_app.rs:37:1 [INFO] [stdout] | [INFO] [stdout] 37 | / impl ToString for PixivRestrictType { [INFO] [stdout] 38 | | fn to_string(&self) -> String { [INFO] [stdout] 39 | | match self { [INFO] [stdout] 40 | | PixivRestrictType::Public => String::from("public"), [INFO] [stdout] ... | [INFO] [stdout] 45 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/pixiv_app.rs:47:1 [INFO] [stdout] | [INFO] [stdout] 47 | / impl ToString for PixivRestrictLessType { [INFO] [stdout] 48 | | fn to_string(&self) -> String { [INFO] [stdout] 49 | | match self { [INFO] [stdout] 50 | | PixivRestrictLessType::Public => String::from("public"), [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [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/fanbox/post.rs:1213:9 [INFO] [stdout] | [INFO] [stdout] 1213 | / match self.comment_list() { [INFO] [stdout] 1214 | | Some(list) => { [INFO] [stdout] 1215 | | for i in list.items { [INFO] [stdout] 1216 | | i.check_unknown()?; [INFO] [stdout] ... | [INFO] [stdout] 1219 | | None => {} [INFO] [stdout] 1220 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1213 ~ if let Some(list) = self.comment_list() { [INFO] [stdout] 1214 + for i in list.items { [INFO] [stdout] 1215 + i.check_unknown()?; [INFO] [stdout] 1216 + } [INFO] [stdout] 1217 + } [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/fanbox/post.rs:1221:9 [INFO] [stdout] | [INFO] [stdout] 1221 | / match self.next_post() { [INFO] [stdout] 1222 | | Some(post) => post.check_unknown()?, [INFO] [stdout] 1223 | | None => {} [INFO] [stdout] 1224 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(post) = self.next_post() { post.check_unknown()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/fanbox/post.rs:1225:9 [INFO] [stdout] | [INFO] [stdout] 1225 | / match self.prev_post() { [INFO] [stdout] 1226 | | Some(post) => post.check_unknown()?, [INFO] [stdout] 1227 | | None => {} [INFO] [stdout] 1228 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(post) = self.prev_post() { post.check_unknown()? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/fanbox/post.rs:1274:25 [INFO] [stdout] | [INFO] [stdout] 1274 | Some(id) => match self.client.get_post_info(id).await { [INFO] [stdout] | _________________________^ [INFO] [stdout] 1275 | | Some(s) => Some(FanboxPost::new(&s["body"], Arc::clone(&self.client))), [INFO] [stdout] 1276 | | None => None, [INFO] [stdout] 1277 | | }, [INFO] [stdout] | |_____________^ help: try: `self.client.get_post_info(id).await.map(|s| FanboxPost::new(&s["body"], Arc::clone(&self.client)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/pixiv_app.rs:172:26 [INFO] [stdout] | [INFO] [stdout] 172 | .expect(gettext("refresh_token not setted.")), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("{}", gettext("refresh_token not setted.")))` [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: unneeded `return` statement [INFO] [stdout] --> src/pixiv_app.rs:204:17 [INFO] [stdout] | [INFO] [stdout] 204 | return Ok(r.clone()); [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 204 - return Ok(r.clone()); [INFO] [stdout] 204 + Ok(r.clone()) [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/fanbox/post.rs:1598:21 [INFO] [stdout] | [INFO] [stdout] 1598 | / match data.next_post() { [INFO] [stdout] 1599 | | Some(r) => { [INFO] [stdout] 1600 | | println!("{:#?}", r); [INFO] [stdout] 1601 | | match r.get_post().await { [INFO] [stdout] ... | [INFO] [stdout] 1620 | | None => {} [INFO] [stdout] 1621 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1598 ~ if let Some(r) = data.next_post() { [INFO] [stdout] 1599 + println!("{:#?}", r); [INFO] [stdout] 1600 + match r.get_post().await { [INFO] [stdout] 1601 + Some(n) => { [INFO] [stdout] 1602 + println!("{:#?}", n); [INFO] [stdout] 1603 + assert_eq!(n.id(), r.id()); [INFO] [stdout] 1604 + assert_eq!(n.user_id(), Some(705370)); [INFO] [stdout] 1605 ~ assert_eq!(n.user_name(), Some("しらたま")); [INFO] [stdout] 1606 + assert_eq!(n.creator_id(), Some("shiratamaco")); [INFO] [stdout] 1607 + match n.check_unknown() { [INFO] [stdout] 1608 + Ok(_) => {} [INFO] [stdout] 1609 + Err(e) => { [INFO] [stdout] 1610 + panic!("Check unknown: {}", e); [INFO] [stdout] 1611 + } [INFO] [stdout] 1612 + } [INFO] [stdout] 1613 + } [INFO] [stdout] 1614 + None => { [INFO] [stdout] 1615 + panic!("Failed to get next post.") [INFO] [stdout] 1616 + } [INFO] [stdout] 1617 + } [INFO] [stdout] 1618 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/fanbox_api.rs:27:1 [INFO] [stdout] | [INFO] [stdout] 27 | / impl Default for FanboxDownloadDetectMiddleware { [INFO] [stdout] 28 | | fn default() -> Self { [INFO] [stdout] 29 | | Self { _unused: [] } [INFO] [stdout] 30 | | } [INFO] [stdout] 31 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 23 + #[derive(Default)] [INFO] [stdout] 24 | pub struct FanboxDownloadDetectMiddleware { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/fanbox_api.rs:105:17 [INFO] [stdout] | [INFO] [stdout] 105 | / if !self.client.read_cookies(c.as_str()) { [INFO] [stdout] 106 | | return false; [INFO] [stdout] 107 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 104 ~ Some(c) [INFO] [stdout] 105 ~ if !self.client.read_cookies(c.as_str()) => { [INFO] [stdout] 106 | return false; [INFO] [stdout] 107 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `num` after checking its variant with `is_ok` [INFO] [stdout] --> src/pixiv_link.rs:60:42 [INFO] [stdout] | [INFO] [stdout] 59 | if num.is_ok() { [INFO] [stdout] | -------------- help: try: `if let Ok() = num` [INFO] [stdout] 60 | return Some(PixivID::Artwork(num.unwrap())); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [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/fanbox_api.rs:103:9 [INFO] [stdout] | [INFO] [stdout] 103 | / match cookies { [INFO] [stdout] 104 | | Some(c) => { [INFO] [stdout] 105 | | if !self.client.read_cookies(c.as_str()) { [INFO] [stdout] 106 | | return false; [INFO] [stdout] ... | [INFO] [stdout] 109 | | None => {} [INFO] [stdout] 110 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 103 ~ if let Some(c) = cookies { [INFO] [stdout] 104 + if !self.client.read_cookies(c.as_str()) { [INFO] [stdout] 105 + return false; [INFO] [stdout] 106 + } [INFO] [stdout] 107 + } [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/pixiv_link.rs:62:9 [INFO] [stdout] | [INFO] [stdout] 62 | / match RE.captures(s) { [INFO] [stdout] 63 | | Some(re) => match re.name("id") { [INFO] [stdout] 64 | | Some(r) => match r.as_str().parse::() { [INFO] [stdout] 65 | | Ok(r) => return Some(Self::Artwork(r)), [INFO] [stdout] ... | [INFO] [stdout] 70 | | None => {} [INFO] [stdout] 71 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 62 ~ if let Some(re) = RE.captures(s) { match re.name("id") { [INFO] [stdout] 63 + Some(r) => match r.as_str().parse::() { [INFO] [stdout] 64 + Ok(r) => return Some(Self::Artwork(r)), [INFO] [stdout] 65 + Err(_) => {} [INFO] [stdout] 66 + }, [INFO] [stdout] 67 + None => {} [INFO] [stdout] 68 + } } [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/pixiv_link.rs:63:25 [INFO] [stdout] | [INFO] [stdout] 63 | Some(re) => match re.name("id") { [INFO] [stdout] | _________________________^ [INFO] [stdout] 64 | | Some(r) => match r.as_str().parse::() { [INFO] [stdout] 65 | | Ok(r) => return Some(Self::Artwork(r)), [INFO] [stdout] 66 | | Err(_) => {} [INFO] [stdout] 67 | | }, [INFO] [stdout] 68 | | None => {} [INFO] [stdout] 69 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 63 ~ Some(re) => if let Some(r) = re.name("id") { match r.as_str().parse::() { [INFO] [stdout] 64 + Ok(r) => return Some(Self::Artwork(r)), [INFO] [stdout] 65 + Err(_) => {} [INFO] [stdout] 66 ~ } }, [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/pixiv_link.rs:64:28 [INFO] [stdout] | [INFO] [stdout] 64 | Some(r) => match r.as_str().parse::() { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 65 | | Ok(r) => return Some(Self::Artwork(r)), [INFO] [stdout] 66 | | Err(_) => {} [INFO] [stdout] 67 | | }, [INFO] [stdout] | |_________________^ help: try: `if let Ok(r) = r.as_str().parse::() { return Some(Self::Artwork(r)) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/pixiv_link.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | / match RE2.captures(s) { [INFO] [stdout] 73 | | Some(re) => match re.name("creator") { [INFO] [stdout] 74 | | Some(creator) => match re.name("id") { [INFO] [stdout] 75 | | Some(id) => match id.as_str().parse::() { [INFO] [stdout] ... | [INFO] [stdout] 85 | | None => {} [INFO] [stdout] 86 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 72 ~ if let Some(re) = RE2.captures(s) { match re.name("creator") { [INFO] [stdout] 73 + Some(creator) => match re.name("id") { [INFO] [stdout] 74 + Some(id) => match id.as_str().parse::() { [INFO] [stdout] 75 + Ok(id) => { [INFO] [stdout] 76 + return Some(Self::FanboxPost(FanboxPostID::new(creator.as_str(), id))); [INFO] [stdout] 77 + } [INFO] [stdout] 78 + Err(_) => {} [INFO] [stdout] 79 + }, [INFO] [stdout] 80 + None => {} [INFO] [stdout] 81 + }, [INFO] [stdout] 82 + None => {} [INFO] [stdout] 83 + } } [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/pixiv_link.rs:73:25 [INFO] [stdout] | [INFO] [stdout] 73 | Some(re) => match re.name("creator") { [INFO] [stdout] | _________________________^ [INFO] [stdout] 74 | | Some(creator) => match re.name("id") { [INFO] [stdout] 75 | | Some(id) => match id.as_str().parse::() { [INFO] [stdout] 76 | | Ok(id) => { [INFO] [stdout] ... | [INFO] [stdout] 83 | | None => {} [INFO] [stdout] 84 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 73 ~ Some(re) => if let Some(creator) = re.name("creator") { match re.name("id") { [INFO] [stdout] 74 + Some(id) => match id.as_str().parse::() { [INFO] [stdout] 75 + Ok(id) => { [INFO] [stdout] 76 + return Some(Self::FanboxPost(FanboxPostID::new(creator.as_str(), id))); [INFO] [stdout] 77 + } [INFO] [stdout] 78 + Err(_) => {} [INFO] [stdout] 79 + }, [INFO] [stdout] 80 + None => {} [INFO] [stdout] 81 ~ } }, [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/pixiv_link.rs:74:34 [INFO] [stdout] | [INFO] [stdout] 74 | Some(creator) => match re.name("id") { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 75 | | Some(id) => match id.as_str().parse::() { [INFO] [stdout] 76 | | Ok(id) => { [INFO] [stdout] 77 | | return Some(Self::FanboxPost(FanboxPostID::new(creator.as_str(), id))); [INFO] [stdout] ... | [INFO] [stdout] 81 | | None => {} [INFO] [stdout] 82 | | }, [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 74 ~ Some(creator) => if let Some(id) = re.name("id") { match id.as_str().parse::() { [INFO] [stdout] 75 + Ok(id) => { [INFO] [stdout] 76 + return Some(Self::FanboxPost(FanboxPostID::new(creator.as_str(), id))); [INFO] [stdout] 77 + } [INFO] [stdout] 78 + Err(_) => {} [INFO] [stdout] 79 ~ } }, [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/pixiv_link.rs:75:33 [INFO] [stdout] | [INFO] [stdout] 75 | Some(id) => match id.as_str().parse::() { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 76 | | Ok(id) => { [INFO] [stdout] 77 | | return Some(Self::FanboxPost(FanboxPostID::new(creator.as_str(), id))); [INFO] [stdout] ... | [INFO] [stdout] 80 | | }, [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 75 ~ Some(id) => if let Ok(id) = id.as_str().parse::() { [INFO] [stdout] 76 + return Some(Self::FanboxPost(FanboxPostID::new(creator.as_str(), id))); [INFO] [stdout] 77 ~ }, [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/pixiv_link.rs:87:9 [INFO] [stdout] | [INFO] [stdout] 87 | / match RE3.captures(s) { [INFO] [stdout] 88 | | Some(re) => match re.name("creator") { [INFO] [stdout] 89 | | Some(creator) => match re.name("id") { [INFO] [stdout] 90 | | Some(id) => match id.as_str().parse::() { [INFO] [stdout] ... | [INFO] [stdout] 100 | | None => {} [INFO] [stdout] 101 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 87 ~ if let Some(re) = RE3.captures(s) { match re.name("creator") { [INFO] [stdout] 88 + Some(creator) => match re.name("id") { [INFO] [stdout] 89 + Some(id) => match id.as_str().parse::() { [INFO] [stdout] 90 + Ok(id) => { [INFO] [stdout] 91 + return Some(Self::FanboxPost(FanboxPostID::new(creator.as_str(), id))); [INFO] [stdout] 92 + } [INFO] [stdout] 93 + Err(_) => {} [INFO] [stdout] 94 + }, [INFO] [stdout] 95 + None => {} [INFO] [stdout] 96 + }, [INFO] [stdout] 97 + None => {} [INFO] [stdout] 98 + } } [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/pixiv_link.rs:88:25 [INFO] [stdout] | [INFO] [stdout] 88 | Some(re) => match re.name("creator") { [INFO] [stdout] | _________________________^ [INFO] [stdout] 89 | | Some(creator) => match re.name("id") { [INFO] [stdout] 90 | | Some(id) => match id.as_str().parse::() { [INFO] [stdout] 91 | | Ok(id) => { [INFO] [stdout] ... | [INFO] [stdout] 98 | | None => {} [INFO] [stdout] 99 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 88 ~ Some(re) => if let Some(creator) = re.name("creator") { match re.name("id") { [INFO] [stdout] 89 + Some(id) => match id.as_str().parse::() { [INFO] [stdout] 90 + Ok(id) => { [INFO] [stdout] 91 + return Some(Self::FanboxPost(FanboxPostID::new(creator.as_str(), id))); [INFO] [stdout] 92 + } [INFO] [stdout] 93 + Err(_) => {} [INFO] [stdout] 94 + }, [INFO] [stdout] 95 + None => {} [INFO] [stdout] 96 ~ } }, [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/pixiv_link.rs:89:34 [INFO] [stdout] | [INFO] [stdout] 89 | Some(creator) => match re.name("id") { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 90 | | Some(id) => match id.as_str().parse::() { [INFO] [stdout] 91 | | Ok(id) => { [INFO] [stdout] 92 | | return Some(Self::FanboxPost(FanboxPostID::new(creator.as_str(), id))); [INFO] [stdout] ... | [INFO] [stdout] 96 | | None => {} [INFO] [stdout] 97 | | }, [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 89 ~ Some(creator) => if let Some(id) = re.name("id") { match id.as_str().parse::() { [INFO] [stdout] 90 + Ok(id) => { [INFO] [stdout] 91 + return Some(Self::FanboxPost(FanboxPostID::new(creator.as_str(), id))); [INFO] [stdout] 92 + } [INFO] [stdout] 93 + Err(_) => {} [INFO] [stdout] 94 ~ } }, [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/pixiv_link.rs:90:33 [INFO] [stdout] | [INFO] [stdout] 90 | Some(id) => match id.as_str().parse::() { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 91 | | Ok(id) => { [INFO] [stdout] 92 | | return Some(Self::FanboxPost(FanboxPostID::new(creator.as_str(), id))); [INFO] [stdout] ... | [INFO] [stdout] 95 | | }, [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 90 ~ Some(id) => if let Ok(id) = id.as_str().parse::() { [INFO] [stdout] 91 + return Some(Self::FanboxPost(FanboxPostID::new(creator.as_str(), id))); [INFO] [stdout] 92 ~ }, [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/pixiv_link.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | / match RE4.captures(s) { [INFO] [stdout] 103 | | Some(re) => match re.name("creator") { [INFO] [stdout] 104 | | Some(creator) => match creator.as_str() { [INFO] [stdout] 105 | | "www" => {} [INFO] [stdout] ... | [INFO] [stdout] 110 | | None => {} [INFO] [stdout] 111 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 102 ~ if let Some(re) = RE4.captures(s) { match re.name("creator") { [INFO] [stdout] 103 + Some(creator) => match creator.as_str() { [INFO] [stdout] 104 + "www" => {} [INFO] [stdout] 105 + _ => return Some(Self::FanboxCreator(String::from(creator.as_str()))), [INFO] [stdout] 106 + }, [INFO] [stdout] 107 + None => {} [INFO] [stdout] 108 + } } [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/pixiv_link.rs:103:25 [INFO] [stdout] | [INFO] [stdout] 103 | Some(re) => match re.name("creator") { [INFO] [stdout] | _________________________^ [INFO] [stdout] 104 | | Some(creator) => match creator.as_str() { [INFO] [stdout] 105 | | "www" => {} [INFO] [stdout] 106 | | _ => return Some(Self::FanboxCreator(String::from(creator.as_str()))), [INFO] [stdout] 107 | | }, [INFO] [stdout] 108 | | None => {} [INFO] [stdout] 109 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 103 ~ Some(re) => if let Some(creator) = re.name("creator") { match creator.as_str() { [INFO] [stdout] 104 + "www" => {} [INFO] [stdout] 105 + _ => return Some(Self::FanboxCreator(String::from(creator.as_str()))), [INFO] [stdout] 106 ~ } }, [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/pixiv_link.rs:112:9 [INFO] [stdout] | [INFO] [stdout] 112 | / match RE5.captures(s) { [INFO] [stdout] 113 | | Some(re) => match re.name("creator") { [INFO] [stdout] 114 | | Some(creator) => { [INFO] [stdout] 115 | | return Some(Self::FanboxCreator(String::from(creator.as_str()))); [INFO] [stdout] ... | [INFO] [stdout] 119 | | None => {} [INFO] [stdout] 120 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 112 ~ if let Some(re) = RE5.captures(s) { match re.name("creator") { [INFO] [stdout] 113 + Some(creator) => { [INFO] [stdout] 114 + return Some(Self::FanboxCreator(String::from(creator.as_str()))); [INFO] [stdout] 115 + } [INFO] [stdout] 116 + None => {} [INFO] [stdout] 117 + } } [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/pixiv_link.rs:113:25 [INFO] [stdout] | [INFO] [stdout] 113 | Some(re) => match re.name("creator") { [INFO] [stdout] | _________________________^ [INFO] [stdout] 114 | | Some(creator) => { [INFO] [stdout] 115 | | return Some(Self::FanboxCreator(String::from(creator.as_str()))); [INFO] [stdout] ... | [INFO] [stdout] 118 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 113 ~ Some(re) => if let Some(creator) = re.name("creator") { [INFO] [stdout] 114 + return Some(Self::FanboxCreator(String::from(creator.as_str()))); [INFO] [stdout] 115 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to both the expression and the patterns [INFO] [stdout] --> src/pixiv_link.rs:144:9 [INFO] [stdout] | [INFO] [stdout] 144 | / match &self { [INFO] [stdout] 145 | | &PixivID::Artwork(id) => { [INFO] [stdout] 146 | | Some(json::value!({"type": "artwork", "id": id.clone(), "link": self.to_link()})) [INFO] [stdout] ... | [INFO] [stdout] 153 | | ), [INFO] [stdout] 154 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 144 ~ match self { [INFO] [stdout] 145 ~ PixivID::Artwork(id) => { [INFO] [stdout] 146 | Some(json::value!({"type": "artwork", "id": id.clone(), "link": self.to_link()})) [INFO] [stdout] 147 | } [INFO] [stdout] 148 ~ PixivID::FanboxPost(id) => Some( [INFO] [stdout] 149 | json::value!({"type": "fanbox_post", "post_id": id.post_id.clone(), "creator_id": id.creator_id.clone(), "link": self.to_link()}), [INFO] [stdout] 150 | ), [INFO] [stdout] 151 ~ PixivID::FanboxCreator(id) => Some( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/pixiv_link.rs:146:61 [INFO] [stdout] | [INFO] [stdout] 146 | Some(json::value!({"type": "artwork", "id": id.clone(), "link": self.to_link()})) [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `(*id)` [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 `u64` which implements the `Copy` trait [INFO] [stdout] --> src/pixiv_link.rs:149:65 [INFO] [stdout] | [INFO] [stdout] 149 | ... json::value!({"type": "fanbox_post", "post_id": id.post_id.clone(), "creator_id": id.creator_id.clone(), "link": self.to_link... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `id.post_id` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/pixiv_link.rs:172:24 [INFO] [stdout] | [INFO] [stdout] 172 | PixivID::parse(*self) [INFO] [stdout] | ^^^^^ help: try: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/pixiv_link.rs:209:40 [INFO] [stdout] | [INFO] [stdout] 209 | PixivID::Artwork(id) => Ok(id.clone()), [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*id` [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 `u64` which implements the `Copy` trait [INFO] [stdout] --> src/pixiv_link.rs:210:43 [INFO] [stdout] | [INFO] [stdout] 210 | PixivID::FanboxPost(id) => Ok(id.post_id.clone()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `id.post_id` [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: called `unwrap` on `u.query` after checking its variant with `is_some` [INFO] [stdout] --> src/pixiv_link.rs:222:21 [INFO] [stdout] | [INFO] [stdout] 221 | if u.query.is_some() { [INFO] [stdout] | -------------------- help: try: `if let Some() = &u.query` [INFO] [stdout] 222 | let q = u.query.as_ref().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `re` after checking its variant with `is_ok` [INFO] [stdout] --> src/pixiv_link.rs:225:24 [INFO] [stdout] | [INFO] [stdout] 224 | if re.is_ok() { [INFO] [stdout] | ------------- help: try: `if let Ok() = re` [INFO] [stdout] 225 | return re.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pixiv_link.rs:220:5 [INFO] [stdout] | [INFO] [stdout] 220 | / if path.ends_with("/jump.php") { [INFO] [stdout] 221 | | if u.query.is_some() { [INFO] [stdout] 222 | | let q = u.query.as_ref().unwrap(); [INFO] [stdout] 223 | | let re = urlparse::unquote(q); [INFO] [stdout] ... | [INFO] [stdout] 228 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 220 ~ if path.ends_with("/jump.php") [INFO] [stdout] 221 ~ && u.query.is_some() { [INFO] [stdout] 222 | let q = u.query.as_ref().unwrap(); [INFO] [stdout] ... [INFO] [stdout] 226 | } [INFO] [stdout] 227 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `c` after checking its variant with `is_some` [INFO] [stdout] --> src/pixiv_web.rs:43:42 [INFO] [stdout] | [INFO] [stdout] 42 | if c.is_some() { [INFO] [stdout] | -------------- help: try: `if let Some() = &c` [INFO] [stdout] 43 | if !self.client.read_cookies(c.as_ref().unwrap()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `l` after checking its variant with `is_some` [INFO] [stdout] --> src/pixiv_web.rs:51:48 [INFO] [stdout] | [INFO] [stdout] 49 | if l.is_some() { [INFO] [stdout] | -------------- help: try: `if let Some() = &l` [INFO] [stdout] 50 | self.client [INFO] [stdout] 51 | .set_header("Accept-Language", l.as_ref().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `l` after checking its variant with `is_some` [INFO] [stdout] --> src/pixiv_web.rs:54:50 [INFO] [stdout] | [INFO] [stdout] 49 | if l.is_some() { [INFO] [stdout] | -------------- help: try: `if let Some() = &l` [INFO] [stdout] ... [INFO] [stdout] 54 | .replace(json::object! { "lang": l.as_ref().unwrap().replace("-", "_").as_str() }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pixiv_web.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | / if c.is_some() { [INFO] [stdout] 43 | | if !self.client.read_cookies(c.as_ref().unwrap()) { [INFO] [stdout] 44 | | return false; [INFO] [stdout] 45 | | } [INFO] [stdout] 46 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 42 ~ if c.is_some() [INFO] [stdout] 43 ~ && !self.client.read_cookies(c.as_ref().unwrap()) { [INFO] [stdout] 44 | return false; [INFO] [stdout] 45 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `data` after checking its variant with `is_err` [INFO] [stdout] --> src/pixiv_web.rs:97:17 [INFO] [stdout] | [INFO] [stdout] 92 | if data.is_err() { [INFO] [stdout] | ---------------- help: try: `if let Err() = data` [INFO] [stdout] ... [INFO] [stdout] 97 | data.unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `data` after checking its variant with `is_err` [INFO] [stdout] --> src/pixiv_web.rs:126:81 [INFO] [stdout] | [INFO] [stdout] 122 | if data.is_err() { [INFO] [stdout] | ---------------- help: try: `if let Err() = data` [INFO] [stdout] ... [INFO] [stdout] 126 | log::error!(target: "pixiv_web","{} {}", gettext("Network error:"), data.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `re` after checking its variant with `is_err` [INFO] [stdout] --> src/pixiv_web.rs:135:92 [INFO] [stdout] | [INFO] [stdout] 131 | if re.is_err() { [INFO] [stdout] | -------------- help: try: `if let Err() = re` [INFO] [stdout] ... [INFO] [stdout] 135 | log::error!(target: "pixiv_web","{} {}", gettext("Failed to parse JSON:"), re.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `message` after checking its variant with `is_some` [INFO] [stdout] --> src/pixiv_web.rs:155:55 [INFO] [stdout] | [INFO] [stdout] 154 | if message.is_some() { [INFO] [stdout] | -------------------- help: try: `if let Some() = message` [INFO] [stdout] 155 | log::error!(target: "pixiv_web","{}", message.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/pixiv_web.rs:140:21 [INFO] [stdout] | [INFO] [stdout] 140 | let error = (&value["error"]).as_bool(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `value["error"]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/pixiv_web.rs:150:27 [INFO] [stdout] | [INFO] [stdout] 150 | let message = (&value["message"]).as_str(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `value["message"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `v` after checking its variant with `is_some` [INFO] [stdout] --> src/pixiv_web.rs:186:17 [INFO] [stdout] | [INFO] [stdout] 181 | if v.is_some() { [INFO] [stdout] | -------------- help: try: `if let Some() = &v` [INFO] [stdout] ... [INFO] [stdout] 186 | v.as_ref().unwrap().pretty(2) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/pixiv_web.rs:176:9 [INFO] [stdout] | [INFO] [stdout] 176 | / if r.is_none() { [INFO] [stdout] 177 | | return None; [INFO] [stdout] 178 | | } [INFO] [stdout] | |_________^ help: replace it with: `r.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/fanbox_api.rs:281:9 [INFO] [stdout] | [INFO] [stdout] 281 | / match value["urlContext"]["user"]["isLoggedIn"].as_bool() { [INFO] [stdout] 282 | | Some(b) => b, [INFO] [stdout] 283 | | None => false, [INFO] [stdout] 284 | | } [INFO] [stdout] | |_________^ help: replace it with: `value["urlContext"]["user"]["isLoggedIn"].as_bool().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `data` after checking its variant with `is_err` [INFO] [stdout] --> src/pixiv_web.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 213 | if data.is_err() { [INFO] [stdout] | ---------------- help: try: `if let Err() = data` [INFO] [stdout] ... [INFO] [stdout] 218 | data.unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/pixiv_web.rs:202:9 [INFO] [stdout] | [INFO] [stdout] 202 | / if r.is_none() { [INFO] [stdout] 203 | | return None; [INFO] [stdout] 204 | | } [INFO] [stdout] | |_________^ help: replace it with: `r.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/fanbox_api.rs:327:9 [INFO] [stdout] | [INFO] [stdout] 327 | / match self.client.get_creator(creator_id).await { [INFO] [stdout] 328 | | Some(s) => Some(FanboxCreator::new(&s["body"], Arc::clone(&self.client))), [INFO] [stdout] 329 | | None => None, [INFO] [stdout] 330 | | } [INFO] [stdout] | |_________^ help: try: `self.client.get_creator(creator_id).await.map(|s| FanboxCreator::new(&s["body"], Arc::clone(&self.client)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `v` after checking its variant with `is_some` [INFO] [stdout] --> src/pixiv_web.rs:257:17 [INFO] [stdout] | [INFO] [stdout] 252 | if v.is_some() { [INFO] [stdout] | -------------- help: try: `if let Some() = &v` [INFO] [stdout] ... [INFO] [stdout] 257 | v.as_ref().unwrap().pretty(2) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/pixiv_web.rs:247:9 [INFO] [stdout] | [INFO] [stdout] 247 | / if r.is_none() { [INFO] [stdout] 248 | | return None; [INFO] [stdout] 249 | | } [INFO] [stdout] | |_________^ help: replace it with: `r.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/fanbox_api.rs:337:9 [INFO] [stdout] | [INFO] [stdout] 337 | / match self.client.get_post_info(post_id).await { [INFO] [stdout] 338 | | Some(s) => Some(FanboxPost::new(&s["body"], Arc::clone(&self.client))), [INFO] [stdout] 339 | | None => None, [INFO] [stdout] 340 | | } [INFO] [stdout] | |_________^ help: try: `self.client.get_post_info(post_id).await.map(|s| FanboxPost::new(&s["body"], Arc::clone(&self.client)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `v` after checking its variant with `is_some` [INFO] [stdout] --> src/pixiv_web.rs:287:17 [INFO] [stdout] | [INFO] [stdout] 282 | if v.is_some() { [INFO] [stdout] | -------------- help: try: `if let Some() = &v` [INFO] [stdout] ... [INFO] [stdout] 287 | v.as_ref().unwrap().pretty(2) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/pixiv_web.rs:277:9 [INFO] [stdout] | [INFO] [stdout] 277 | / if r.is_none() { [INFO] [stdout] 278 | | return None; [INFO] [stdout] 279 | | } [INFO] [stdout] | |_________^ help: replace it with: `r.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `v` after checking its variant with `is_some` [INFO] [stdout] --> src/pixiv_web.rs:316:17 [INFO] [stdout] | [INFO] [stdout] 311 | if v.is_some() { [INFO] [stdout] | -------------- help: try: `if let Some() = &v` [INFO] [stdout] ... [INFO] [stdout] 316 | v.as_ref().unwrap().pretty(2) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/pixiv_web.rs:306:9 [INFO] [stdout] | [INFO] [stdout] 306 | / if r.is_none() { [INFO] [stdout] 307 | | return None; [INFO] [stdout] 308 | | } [INFO] [stdout] | |_________^ help: replace it with: `r.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `v` after checking its variant with `is_some` [INFO] [stdout] --> src/pixiv_web.rs:360:17 [INFO] [stdout] | [INFO] [stdout] 355 | if v.is_some() { [INFO] [stdout] | -------------- help: try: `if let Some() = &v` [INFO] [stdout] ... [INFO] [stdout] 360 | v.as_ref().unwrap().pretty(2) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `v` after checking its variant with `is_some` [INFO] [stdout] --> src/pixiv_web.rs:388:17 [INFO] [stdout] | [INFO] [stdout] 383 | if v.is_some() { [INFO] [stdout] | -------------- help: try: `if let Some() = &v` [INFO] [stdout] ... [INFO] [stdout] 388 | v.as_ref().unwrap().pretty(2) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `HTTP` contains a capitalized acronym [INFO] [stdout] --> src/pixivapp/error.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | HTTP(PixivAppHTTPError), [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Http` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `API` contains a capitalized acronym [INFO] [stdout] --> src/pixivapp/error.rs:118:5 [INFO] [stdout] | [INFO] [stdout] 118 | API(PixivAppAPIError), [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Api` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [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/formdata.rs:58:13 [INFO] [stdout] | [INFO] [stdout] 58 | / match &self.mime { [INFO] [stdout] 59 | | Some(m) => { [INFO] [stdout] 60 | | p.field("mime", &m.as_str()); [INFO] [stdout] ... | [INFO] [stdout] 63 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 58 ~ if let Some(m) = &self.mime { [INFO] [stdout] 59 + p.field("mime", &m.as_str()); [INFO] [stdout] 60 + } [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/formdata.rs:64:13 [INFO] [stdout] | [INFO] [stdout] 64 | / match &self.filename { [INFO] [stdout] 65 | | Some(f) => { [INFO] [stdout] 66 | | p.field("filename", &f.as_str()); [INFO] [stdout] ... | [INFO] [stdout] 69 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 64 ~ if let Some(f) = &self.filename { [INFO] [stdout] 65 + p.field("filename", &f.as_str()); [INFO] [stdout] 66 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/pixivapp/illust.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | return ImageUrls::new(self.data["image_urls"].clone()); [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return ImageUrls::new(self.data["image_urls"].clone()); [INFO] [stdout] 30 + ImageUrls::new(self.data["image_urls"].clone()) [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/formdata.rs:144:13 [INFO] [stdout] | [INFO] [stdout] 144 | / match &v.mime { [INFO] [stdout] 145 | | Some(m) => { [INFO] [stdout] 146 | | part = part.mime_str(m)?; [INFO] [stdout] ... | [INFO] [stdout] 149 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 144 ~ if let Some(m) = &v.mime { [INFO] [stdout] 145 + part = part.mime_str(m)?; [INFO] [stdout] 146 + } [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/formdata.rs:150:13 [INFO] [stdout] | [INFO] [stdout] 150 | / match &v.filename { [INFO] [stdout] 151 | | Some(f) => { [INFO] [stdout] 152 | | part = part.file_name(f.clone()); [INFO] [stdout] ... | [INFO] [stdout] 155 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 150 ~ if let Some(f) = &v.filename { [INFO] [stdout] 151 + part = part.file_name(f.clone()); [INFO] [stdout] 152 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/formdata.rs:163:1 [INFO] [stdout] | [INFO] [stdout] 163 | / impl Default for FormData { [INFO] [stdout] 164 | | fn default() -> Self { [INFO] [stdout] 165 | | Self { fields: Vec::new() } [INFO] [stdout] 166 | | } [INFO] [stdout] 167 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 80 + #[derive(Default)] [INFO] [stdout] 81 | pub struct FormData { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/i18n.rs:100:5 [INFO] [stdout] | [INFO] [stdout] 100 | return String::from("en-US"); [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 100 - return String::from("en-US"); [INFO] [stdout] 100 + String::from("en-US") [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/i18n.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | / match std::env::var("PIXIV_DOWNLOADER_LANG") { [INFO] [stdout] 7 | | Ok(lang) => { [INFO] [stdout] 8 | | return lang; [INFO] [stdout] ... | [INFO] [stdout] 11 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 ~ if let Ok(lang) = std::env::var("PIXIV_DOWNLOADER_LANG") { [INFO] [stdout] 7 + return lang; [INFO] [stdout] 8 + } [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/i18n.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | / match lan { [INFO] [stdout] 14 | | Ok(l) => { [INFO] [stdout] 15 | | if l.len() > 0 { [INFO] [stdout] 16 | | return l; [INFO] [stdout] ... | [INFO] [stdout] 19 | | Err(_) => {} [INFO] [stdout] 20 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 13 ~ if let Ok(l) = lan { [INFO] [stdout] 14 + if l.len() > 0 { [INFO] [stdout] 15 + return l; [INFO] [stdout] 16 + } [INFO] [stdout] 17 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/i18n.rs:15:16 [INFO] [stdout] | [INFO] [stdout] 15 | if l.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/i18n.rs:139:5 [INFO] [stdout] | [INFO] [stdout] 139 | return None; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 139 - return None; [INFO] [stdout] 139 + None [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/i18n.rs:114:9 [INFO] [stdout] | [INFO] [stdout] 114 | / match f { [INFO] [stdout] 115 | | Ok(f) => { [INFO] [stdout] 116 | | return Some(f); [INFO] [stdout] ... | [INFO] [stdout] 119 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 114 ~ if let Ok(f) = f { [INFO] [stdout] 115 + return Some(f); [INFO] [stdout] 116 + } [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/i18n.rs:131:13 [INFO] [stdout] | [INFO] [stdout] 131 | / match f { [INFO] [stdout] 132 | | Ok(f) => { [INFO] [stdout] 133 | | return Some(f); [INFO] [stdout] ... | [INFO] [stdout] 136 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 131 ~ if let Ok(f) = f { [INFO] [stdout] 132 + return Some(f); [INFO] [stdout] 133 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/i18n.rs:168:9 [INFO] [stdout] | [INFO] [stdout] 168 | return I18n { catalog: catalog }; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 168 - return I18n { catalog: catalog }; [INFO] [stdout] 168 + I18n { catalog: catalog } [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/i18n.rs:156:9 [INFO] [stdout] | [INFO] [stdout] 156 | / match re { [INFO] [stdout] 157 | | Some(f) => { [INFO] [stdout] 158 | | let re = Catalog::parse(f); [INFO] [stdout] 159 | | match re { [INFO] [stdout] ... | [INFO] [stdout] 166 | | None => {} [INFO] [stdout] 167 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 156 ~ if let Some(f) = re { [INFO] [stdout] 157 + let re = Catalog::parse(f); [INFO] [stdout] 158 + match re { [INFO] [stdout] 159 + Ok(c) => { [INFO] [stdout] 160 + catalog = Some(c); [INFO] [stdout] 161 + } [INFO] [stdout] 162 + Err(_) => {} [INFO] [stdout] 163 + } [INFO] [stdout] 164 + } [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/i18n.rs:159:17 [INFO] [stdout] | [INFO] [stdout] 159 | / match re { [INFO] [stdout] 160 | | Ok(c) => { [INFO] [stdout] 161 | | catalog = Some(c); [INFO] [stdout] ... | [INFO] [stdout] 164 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 159 ~ if let Ok(c) = re { [INFO] [stdout] 160 + catalog = Some(c); [INFO] [stdout] 161 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/i18n.rs:182:13 [INFO] [stdout] | [INFO] [stdout] 182 | return c.gettext(s); [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 182 - return c.gettext(s); [INFO] [stdout] 182 + c.gettext(s) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/i18n.rs:185:13 [INFO] [stdout] | [INFO] [stdout] 185 | return s; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 185 - return s; [INFO] [stdout] 185 + s [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/list.rs:107:1 [INFO] [stdout] | [INFO] [stdout] 107 | impl Into> for NonTailList { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] = note: `#[warn(clippy::from_over_into)]` on by default [INFO] [stdout] help: replace the `Into` implementation with `From>` [INFO] [stdout] | [INFO] [stdout] 107 ~ impl From> for Vec { [INFO] [stdout] 108 ~ fn from(val: NonTailList) -> Self { [INFO] [stdout] 109 ~ val.data [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/list.rs:113:1 [INFO] [stdout] | [INFO] [stdout] 113 | impl Into> for &NonTailList { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From<&list::NonTailList>` [INFO] [stdout] | [INFO] [stdout] 113 ~ impl From<&NonTailList> for Vec { [INFO] [stdout] 114 ~ fn from(val: &NonTailList) -> Self { [INFO] [stdout] 115 ~ val.data.clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/opt/author_name_filter.rs:66:31 [INFO] [stdout] | [INFO] [stdout] 66 | Self::Regex(r) => r.replace_all(author, "").to_owned().to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] = note: `#[warn(clippy::suspicious_to_owned)]` on by default [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 66 | Self::Regex(r) => r.replace_all(author, "").into_owned().to_string(), [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 66 - Self::Regex(r) => r.replace_all(author, "").to_owned().to_string(), [INFO] [stdout] 66 + Self::Regex(r) => r.replace_all(author, "").clone().to_string(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/opt/author_name_filter.rs:80:9 [INFO] [stdout] | [INFO] [stdout] 80 | return ori; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 80 - return ori; [INFO] [stdout] 80 + ori [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/opt/author_name_filter.rs:132:9 [INFO] [stdout] | [INFO] [stdout] 132 | return Err(Self::Error::from("")); [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 132 - return Err(Self::Error::from("")); [INFO] [stdout] 132 + Err(Self::Error::from("")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/opt/author_name_filter.rs:111:21 [INFO] [stdout] | [INFO] [stdout] 111 | let t = (&j["type"]) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `j["type"]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/opt/author_name_filter.rs:115:24 [INFO] [stdout] | [INFO] [stdout] 115 | let rule = (&j["rule"]) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `j["rule"]` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/pixivapp/illusts.rs:53:24 [INFO] [stdout] | [INFO] [stdout] 53 | let next_url = match value["next_url"].as_str() { [INFO] [stdout] | ________________________^ [INFO] [stdout] 54 | | Some(next_url) => Some(next_url.to_owned()), [INFO] [stdout] 55 | | None => None, [INFO] [stdout] 56 | | }; [INFO] [stdout] | |_________^ help: try: `value["next_url"].as_str().map(|next_url| next_url.to_owned())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `r` after checking its variant with `is_err` [INFO] [stdout] --> src/opt/author_name_filter.rs:142:13 [INFO] [stdout] | [INFO] [stdout] 138 | if r.is_err() { [INFO] [stdout] | ------------- help: try: `if let Err() = &r` [INFO] [stdout] ... [INFO] [stdout] 142 | r.as_ref().unwrap_err() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `opt::author_name_filter::AuthorNameFilter` [INFO] [stdout] --> src/opt/author_name_filter.rs:166:43 [INFO] [stdout] | [INFO] [stdout] 166 | vec![AuthorNameFilter::from("🌸"), AuthorNameFilter::from(r)] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `AuthorNameFilter::from()`: `r` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `HTTP` contains a capitalized acronym [INFO] [stdout] --> src/opt/proxy.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | HTTP(Option), [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Http` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `HTTPS` contains a capitalized acronym [INFO] [stdout] --> src/opt/proxy.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | HTTPS(Option), [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Https` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [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/opt/proxy.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | / match value.as_str() { [INFO] [stdout] 51 | | Some(s) => { [INFO] [stdout] 52 | | return Ok(Self::All(Some(Url::parse(s)?))); [INFO] [stdout] ... | [INFO] [stdout] 55 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 50 ~ if let Some(s) = value.as_str() { [INFO] [stdout] 51 + return Ok(Self::All(Some(Url::parse(s)?))); [INFO] [stdout] 52 + } [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/opt/proxy.rs:146:13 [INFO] [stdout] | [INFO] [stdout] 146 | / match i.r#match(url) { [INFO] [stdout] 147 | | Some(u) => { [INFO] [stdout] 148 | | return u; [INFO] [stdout] ... | [INFO] [stdout] 151 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 146 ~ if let Some(u) = i.r#match(url) { [INFO] [stdout] 147 + return u; [INFO] [stdout] 148 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/opt/proxy.rs:157:1 [INFO] [stdout] | [INFO] [stdout] 157 | / impl Default for ProxyChain { [INFO] [stdout] 158 | | fn default() -> Self { [INFO] [stdout] 159 | | Self { [INFO] [stdout] 160 | | proxies: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 163 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 136 + #[derive(Default)] [INFO] [stdout] 137 | pub struct ProxyChain { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `ok` [INFO] [stdout] --> src/opt/size.rs:8:24 [INFO] [stdout] | [INFO] [stdout] 8 | Some(s) => match parse_size::parse_size(s) { [INFO] [stdout] | ________________________^ [INFO] [stdout] 9 | | Ok(s) => Some(s), [INFO] [stdout] 10 | | Err(_) => None, [INFO] [stdout] 11 | | }, [INFO] [stdout] | |_____________^ help: replace with: `parse_size::parse_size(s).ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `ok` [INFO] [stdout] --> src/opt/size.rs:20:20 [INFO] [stdout] | [INFO] [stdout] 20 | Some(s) => match u32::try_from(s) { [INFO] [stdout] | ____________________^ [INFO] [stdout] 21 | | Ok(s) => Some(s), [INFO] [stdout] 22 | | Err(_) => None, [INFO] [stdout] 23 | | }, [INFO] [stdout] | |_________^ help: replace with: `u32::try_from(s).ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err [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/opthelper.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | / match self.opt.get_ref().download_base { [INFO] [stdout] 116 | | Some(ref r) => { [INFO] [stdout] 117 | | return r.clone(); [INFO] [stdout] ... | [INFO] [stdout] 120 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 115 ~ if let Some(ref r) = self.opt.get_ref().download_base { [INFO] [stdout] 116 + return r.clone(); [INFO] [stdout] 117 + } [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/opthelper.rs:121:9 [INFO] [stdout] | [INFO] [stdout] 121 | / match self.settings.get_ref().get_str("download-base") { [INFO] [stdout] 122 | | Some(r) => { [INFO] [stdout] 123 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 126 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 121 ~ if let Some(r) = self.settings.get_ref().get_str("download-base") { [INFO] [stdout] 122 + return r; [INFO] [stdout] 123 + } [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/opthelper.rs:135:9 [INFO] [stdout] | [INFO] [stdout] 135 | / match self.opt.get_ref().download_multiple_posts { [INFO] [stdout] 136 | | Some(r) => { [INFO] [stdout] 137 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 140 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 135 ~ if let Some(r) = self.opt.get_ref().download_multiple_posts { [INFO] [stdout] 136 + return r; [INFO] [stdout] 137 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `re` after checking its variant with `is_some` [INFO] [stdout] --> src/opthelper.rs:158:25 [INFO] [stdout] | [INFO] [stdout] 157 | if re.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = re` [INFO] [stdout] 158 | return Some(re.unwrap().as_i64().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `re` after checking its variant with `is_some` [INFO] [stdout] --> src/opthelper.rs:170:25 [INFO] [stdout] | [INFO] [stdout] 169 | if re.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = re` [INFO] [stdout] 170 | return Some(re.unwrap().as_i64().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [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/opthelper.rs:208:9 [INFO] [stdout] | [INFO] [stdout] 208 | / match self.opt.get_ref().force_yuv420p { [INFO] [stdout] 209 | | Some(r) => { [INFO] [stdout] 210 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 213 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 208 ~ if let Some(r) = self.opt.get_ref().force_yuv420p { [INFO] [stdout] 209 + return r; [INFO] [stdout] 210 + } [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/opthelper.rs:233:9 [INFO] [stdout] | [INFO] [stdout] 233 | / match self.opt.get_ref().max_download_post_tasks { [INFO] [stdout] 234 | | Some(r) => { [INFO] [stdout] 235 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 238 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 233 ~ if let Some(r) = self.opt.get_ref().max_download_post_tasks { [INFO] [stdout] 234 + return r; [INFO] [stdout] 235 + } [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/opthelper.rs:239:9 [INFO] [stdout] | [INFO] [stdout] 239 | / match self.settings.get_ref().get("max-download-post-tasks") { [INFO] [stdout] 240 | | Some(re) => { [INFO] [stdout] 241 | | return re.as_usize().unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 244 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 239 ~ if let Some(re) = self.settings.get_ref().get("max-download-post-tasks") { [INFO] [stdout] 240 + return re.as_usize().unwrap(); [INFO] [stdout] 241 + } [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/opthelper.rs:250:9 [INFO] [stdout] | [INFO] [stdout] 250 | / match self.opt.get_ref().max_download_tasks { [INFO] [stdout] 251 | | Some(r) => { [INFO] [stdout] 252 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 255 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 250 ~ if let Some(r) = self.opt.get_ref().max_download_tasks { [INFO] [stdout] 251 + return r; [INFO] [stdout] 252 + } [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/opthelper.rs:256:9 [INFO] [stdout] | [INFO] [stdout] 256 | / match self.settings.get_ref().get("max-download-tasks") { [INFO] [stdout] 257 | | Some(re) => { [INFO] [stdout] 258 | | return re.as_usize().unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 261 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 256 ~ if let Some(re) = self.settings.get_ref().get("max-download-tasks") { [INFO] [stdout] 257 + return re.as_usize().unwrap(); [INFO] [stdout] 258 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `re` after checking its variant with `is_some` [INFO] [stdout] --> src/opthelper.rs:275:20 [INFO] [stdout] | [INFO] [stdout] 274 | if re.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = re` [INFO] [stdout] 275 | return re.unwrap().as_u64().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [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/opthelper.rs:267:9 [INFO] [stdout] | [INFO] [stdout] 267 | / match self.opt.get_ref().max_threads { [INFO] [stdout] 268 | | Some(r) => { [INFO] [stdout] 269 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 272 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 267 ~ if let Some(r) = self.opt.get_ref().max_threads { [INFO] [stdout] 268 + return r; [INFO] [stdout] 269 + } [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/push/telegram/botapi_client.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | / match &cfg.timeout { [INFO] [stdout] 55 | | Some(t) => { [INFO] [stdout] 56 | | client.set_timeout(Some(Duration::from_millis(t.clone()))); [INFO] [stdout] ... | [INFO] [stdout] 59 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 54 ~ if let Some(t) = &cfg.timeout { [INFO] [stdout] 55 + client.set_timeout(Some(Duration::from_millis(t.clone()))); [INFO] [stdout] 56 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/push/telegram/botapi_client.rs:56:63 [INFO] [stdout] | [INFO] [stdout] 56 | client.set_timeout(Some(Duration::from_millis(t.clone()))); [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*t` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/opthelper.rs:282:9 [INFO] [stdout] | [INFO] [stdout] 282 | / match self.opt.get_ref().multiple_threads_download { [INFO] [stdout] 283 | | Some(r) => { [INFO] [stdout] 284 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 287 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 282 ~ if let Some(r) = self.opt.get_ref().multiple_threads_download { [INFO] [stdout] 283 + return r; [INFO] [stdout] 284 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `re` after checking its variant with `is_some` [INFO] [stdout] --> src/opthelper.rs:312:35 [INFO] [stdout] | [INFO] [stdout] 311 | if re.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = &re` [INFO] [stdout] 312 | return parse_u32_size(re.as_ref().unwrap()).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type parameter `T` goes unused in function definition [INFO] [stdout] --> src/push/telegram/botapi_client.rs:70:32 [INFO] [stdout] | [INFO] [stdout] 70 | pub async fn send_animation + ?Sized>( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters [INFO] [stdout] = note: `#[warn(clippy::extra_unused_type_parameters)]` on by default [INFO] [stdout] help: consider removing the parameter [INFO] [stdout] | [INFO] [stdout] 70 - pub async fn send_animation + ?Sized>( [INFO] [stdout] 70 + pub async fn send_animation( [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/opthelper.rs:304:9 [INFO] [stdout] | [INFO] [stdout] 304 | / match self.opt.get_ref().part_size { [INFO] [stdout] 305 | | Some(r) => { [INFO] [stdout] 306 | | return r; [INFO] [stdout] ... | [INFO] [stdout] 309 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 304 ~ if let Some(r) = self.opt.get_ref().part_size { [INFO] [stdout] 305 + return r; [INFO] [stdout] 306 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `opt.use_progress_bar` after checking its variant with `is_some` [INFO] [stdout] --> src/opthelper.rs:335:43 [INFO] [stdout] | [INFO] [stdout] 334 | .replace_with2(if opt.use_progress_bar.is_some() { [INFO] [stdout] | --------------------------------- help: try: `if let Some() = opt.use_progress_bar` [INFO] [stdout] 335 | Some(UseProgressBar::from(opt.use_progress_bar.unwrap())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/opthelper.rs:354:38 [INFO] [stdout] | [INFO] [stdout] 354 | HeaderMap::from_json(&settings.get("fanbox-http-headers").unwrap()).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `settings.get("fanbox-http-headers").unwrap()` [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 function has too many arguments (16/7) [INFO] [stdout] --> src/push/telegram/botapi_client.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 70 | / pub async fn send_animation + ?Sized>( [INFO] [stdout] 71 | | &self, [INFO] [stdout] 72 | | chat_id: &ChatId, [INFO] [stdout] 73 | | message_thread_id: Option, [INFO] [stdout] ... | [INFO] [stdout] 86 | | reply_parameters: Option<&ReplyParameters>, [INFO] [stdout] 87 | | ) -> Result, BotapiClientError> { [INFO] [stdout] | |_________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` 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/push/telegram/botapi_client.rs:90:9 [INFO] [stdout] | [INFO] [stdout] 90 | / match message_thread_id { [INFO] [stdout] 91 | | Some(m) => { [INFO] [stdout] 92 | | form.data("message_thread_id", &m.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 95 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 90 ~ if let Some(m) = message_thread_id { [INFO] [stdout] 91 + form.data("message_thread_id", &m.to_string()); [INFO] [stdout] 92 + } [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/push/telegram/botapi_client.rs:104:9 [INFO] [stdout] | [INFO] [stdout] 104 | / match duration { [INFO] [stdout] 105 | | Some(d) => { [INFO] [stdout] 106 | | form.data("duration", &d.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 109 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 104 ~ if let Some(d) = duration { [INFO] [stdout] 105 + form.data("duration", &d.to_string()); [INFO] [stdout] 106 + } [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/push/telegram/botapi_client.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | / match width { [INFO] [stdout] 111 | | Some(d) => { [INFO] [stdout] 112 | | form.data("width", &d.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 115 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 110 ~ if let Some(d) = width { [INFO] [stdout] 111 + form.data("width", &d.to_string()); [INFO] [stdout] 112 + } [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/push/telegram/botapi_client.rs:116:9 [INFO] [stdout] | [INFO] [stdout] 116 | / match height { [INFO] [stdout] 117 | | Some(d) => { [INFO] [stdout] 118 | | form.data("height", &d.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 121 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 116 ~ if let Some(d) = height { [INFO] [stdout] 117 + form.data("height", &d.to_string()); [INFO] [stdout] 118 + } [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/push/telegram/botapi_client.rs:122:9 [INFO] [stdout] | [INFO] [stdout] 122 | / match thumbnail { [INFO] [stdout] 123 | | Some(m) => match m { [INFO] [stdout] 124 | | InputFile::URL(u) => { [INFO] [stdout] 125 | | form.data("thumbnail", &u); [INFO] [stdout] ... | [INFO] [stdout] 131 | | None => {} [INFO] [stdout] 132 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 122 ~ if let Some(m) = thumbnail { match m { [INFO] [stdout] 123 + InputFile::URL(u) => { [INFO] [stdout] 124 + form.data("thumbnail", &u); [INFO] [stdout] 125 + } [INFO] [stdout] 126 + InputFile::Content(c) => { [INFO] [stdout] 127 + form.part("thumbnail", c); [INFO] [stdout] 128 + } [INFO] [stdout] 129 + } } [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/push/telegram/botapi_client.rs:133:9 [INFO] [stdout] | [INFO] [stdout] 133 | / match caption { [INFO] [stdout] 134 | | Some(c) => { [INFO] [stdout] 135 | | form.data("caption", c); [INFO] [stdout] ... | [INFO] [stdout] 138 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 133 ~ if let Some(c) = caption { [INFO] [stdout] 134 + form.data("caption", c); [INFO] [stdout] 135 + } [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/push/telegram/botapi_client.rs:139:9 [INFO] [stdout] | [INFO] [stdout] 139 | / match parse_mode { [INFO] [stdout] 140 | | Some(p) => { [INFO] [stdout] 141 | | form.data("parse_mode", p.as_ref()); [INFO] [stdout] ... | [INFO] [stdout] 144 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 139 ~ if let Some(p) = parse_mode { [INFO] [stdout] 140 + form.data("parse_mode", p.as_ref()); [INFO] [stdout] 141 + } [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/opthelper.rs:385:13 [INFO] [stdout] | [INFO] [stdout] 385 | / match self.log_cfg() { [INFO] [stdout] 386 | | Some(cfg) => { [INFO] [stdout] 387 | | crate::log_cfg::init_with_file(cfg); [INFO] [stdout] ... | [INFO] [stdout] 390 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 385 ~ if let Some(cfg) = self.log_cfg() { [INFO] [stdout] 386 + crate::log_cfg::init_with_file(cfg); [INFO] [stdout] 387 + } [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/push/telegram/botapi_client.rs:145:9 [INFO] [stdout] | [INFO] [stdout] 145 | / match show_caption_above_media { [INFO] [stdout] 146 | | Some(p) => { [INFO] [stdout] 147 | | form.data("show_caption_above_media", &p.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 150 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 145 ~ if let Some(p) = show_caption_above_media { [INFO] [stdout] 146 + form.data("show_caption_above_media", &p.to_string()); [INFO] [stdout] 147 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `re` after checking its variant with `is_some` [INFO] [stdout] --> src/opthelper.rs:401:25 [INFO] [stdout] | [INFO] [stdout] 400 | if re.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = re` [INFO] [stdout] 401 | return Some(re.unwrap().as_i64().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [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/push/telegram/botapi_client.rs:151:9 [INFO] [stdout] | [INFO] [stdout] 151 | / match has_spoiler { [INFO] [stdout] 152 | | Some(p) => { [INFO] [stdout] 153 | | form.data("has_spoiler", &p.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 156 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 151 ~ if let Some(p) = has_spoiler { [INFO] [stdout] 152 + form.data("has_spoiler", &p.to_string()); [INFO] [stdout] 153 + } [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/push/telegram/botapi_client.rs:157:9 [INFO] [stdout] | [INFO] [stdout] 157 | / match disable_notification { [INFO] [stdout] 158 | | Some(d) => { [INFO] [stdout] 159 | | form.data("disable_notification", &d.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 162 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 157 ~ if let Some(d) = disable_notification { [INFO] [stdout] 158 + form.data("disable_notification", &d.to_string()); [INFO] [stdout] 159 + } [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/push/telegram/botapi_client.rs:163:9 [INFO] [stdout] | [INFO] [stdout] 163 | / match protect_content { [INFO] [stdout] 164 | | Some(p) => { [INFO] [stdout] 165 | | form.data("protect_content", &p.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 168 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 163 ~ if let Some(p) = protect_content { [INFO] [stdout] 164 + form.data("protect_content", &p.to_string()); [INFO] [stdout] 165 + } [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/opthelper.rs:441:9 [INFO] [stdout] | [INFO] [stdout] 441 | / match self.opt.get_ref().use_web_description { [INFO] [stdout] 442 | | Some(t) => { [INFO] [stdout] 443 | | return t; [INFO] [stdout] ... | [INFO] [stdout] 446 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 441 ~ if let Some(t) = self.opt.get_ref().use_web_description { [INFO] [stdout] 442 + return t; [INFO] [stdout] 443 + } [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/push/telegram/botapi_client.rs:169:9 [INFO] [stdout] | [INFO] [stdout] 169 | / match message_effect_id { [INFO] [stdout] 170 | | Some(m) => { [INFO] [stdout] 171 | | form.data("message_effect_id", m); [INFO] [stdout] ... | [INFO] [stdout] 174 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 169 ~ if let Some(m) = message_effect_id { [INFO] [stdout] 170 + form.data("message_effect_id", m); [INFO] [stdout] 171 + } [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/push/telegram/botapi_client.rs:175:9 [INFO] [stdout] | [INFO] [stdout] 175 | / match reply_parameters { [INFO] [stdout] 176 | | Some(r) => { [INFO] [stdout] 177 | | form.data("reply_parameters", serde_json::to_string(r)?.as_str()); [INFO] [stdout] ... | [INFO] [stdout] 180 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [WARN] too many lines in the log, truncating it