[INFO] cloning repository https://github.com/dsainz3/govee2mqtt [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/dsainz3/govee2mqtt" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdsainz3%2Fgovee2mqtt", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdsainz3%2Fgovee2mqtt'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 27309824cc9ca9868e1c039b354cb9fb8e0706d2 [INFO] linting dsainz3/govee2mqtt against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdsainz3%2Fgovee2mqtt" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/dsainz3/govee2mqtt [INFO] finished tweaking git repo https://github.com/dsainz3/govee2mqtt [INFO] tweaked toml for git repo https://github.com/dsainz3/govee2mqtt written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/dsainz3/govee2mqtt 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/dsainz3/govee2mqtt 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] Blocking waiting for file lock on package cache [INFO] [stderr] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded rc2 v0.8.1 [INFO] [stderr] Downloaded des v0.8.1 [INFO] [stderr] Downloaded phf_shared v0.12.1 [INFO] [stderr] Downloaded arc-swap v1.8.0 [INFO] [stderr] Downloaded clap-num v1.2.0 [INFO] [stderr] Downloaded env_filter v0.1.4 [INFO] [stderr] Downloaded serde_json_path_to_error v0.1.5 [INFO] [stderr] Downloaded sqlite-cache v0.1.4 [INFO] [stderr] Downloaded terminal_size v0.2.6 [INFO] [stderr] Downloaded p12 v0.6.3 [INFO] [stderr] Downloaded csscolorparser v0.8.1 [INFO] [stderr] Downloaded rustix v0.37.28 [INFO] [stderr] Downloaded chrono-tz v0.10.4 [INFO] [stderr] Downloaded phf v0.12.1 [INFO] [stderr] Downloaded zmij v1.0.10 [INFO] [stderr] Downloaded color-backtrace v0.7.2 [INFO] [stderr] Downloaded k9 v0.12.0 [INFO] [stderr] Downloaded mosquitto-rs v0.11.2 [INFO] [stderr] Downloaded cc v1.2.47 [INFO] [stderr] Downloaded serde_json v1.0.148 [INFO] [stderr] Downloaded openssl-src v300.5.4+3.5.4 [INFO] [stderr] Downloaded libmosquitto-sys v0.2.3 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 533bb9d1b6e2fd5bbf835e56c115ed3c43c3071c695f3a8eb38a45bb4fa4b6c8 [INFO] running `Command { std: "docker" "start" "-a" "533bb9d1b6e2fd5bbf835e56c115ed3c43c3071c695f3a8eb38a45bb4fa4b6c8", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "533bb9d1b6e2fd5bbf835e56c115ed3c43c3071c695f3a8eb38a45bb4fa4b6c8", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "533bb9d1b6e2fd5bbf835e56c115ed3c43c3071c695f3a8eb38a45bb4fa4b6c8", kill_on_drop: false }` [INFO] [stdout] 533bb9d1b6e2fd5bbf835e56c115ed3c43c3071c695f3a8eb38a45bb4fa4b6c8 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] fee2a31471d7b99a28c70ac777f7f6dbfe48ed56e3a142e51660a1dc0645f388 [INFO] running `Command { std: "docker" "start" "-a" "fee2a31471d7b99a28c70ac777f7f6dbfe48ed56e3a142e51660a1dc0645f388", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.103 [INFO] [stderr] Compiling quote v1.0.42 [INFO] [stderr] Compiling libc v0.2.177 [INFO] [stderr] Checking memchr v2.7.6 [INFO] [stderr] Compiling find-msvc-tools v0.1.5 [INFO] [stderr] Checking bytes v1.11.0 [INFO] [stderr] Compiling serde_core v1.0.228 [INFO] [stderr] Checking tracing-core v0.1.34 [INFO] [stderr] Checking futures-channel v0.3.31 [INFO] [stderr] Checking futures-task v0.3.31 [INFO] [stderr] Checking futures-io v0.3.31 [INFO] [stderr] Compiling uncased v0.9.10 [INFO] [stderr] Compiling zmij v1.0.10 [INFO] [stderr] Compiling zerocopy v0.8.28 [INFO] [stderr] Compiling crossbeam-utils v0.8.21 [INFO] [stderr] Compiling icu_properties_data v2.1.1 [INFO] [stderr] Checking indexmap v2.12.1 [INFO] [stderr] Compiling cc v1.2.47 [INFO] [stderr] Checking block-padding v0.3.3 [INFO] [stderr] Compiling serde_json v1.0.148 [INFO] [stderr] Compiling openssl v0.10.75 [INFO] [stderr] Checking siphasher v1.0.1 [INFO] [stderr] Checking inout v0.1.4 [INFO] [stderr] Compiling unicase v2.8.1 [INFO] [stderr] Checking regex-syntax v0.8.8 [INFO] [stderr] Checking http v1.3.1 [INFO] [stderr] Checking cipher v0.4.4 [INFO] [stderr] Compiling fastrand v2.3.0 [INFO] [stderr] Compiling mime_guess v2.0.5 [INFO] [stderr] Compiling anyhow v1.0.100 [INFO] [stderr] Compiling phf_shared v0.13.1 [INFO] [stderr] Compiling object v0.37.3 [INFO] [stderr] Compiling io-lifetimes v1.0.11 [INFO] [stderr] Checking concurrent-queue v2.5.0 [INFO] [stderr] Checking aho-corasick v1.1.4 [INFO] [stderr] Checking gimli v0.32.3 [INFO] [stderr] Compiling phf_generator v0.13.1 [INFO] [stderr] Checking unicode-ident v1.0.22 [INFO] [stderr] Compiling getrandom v0.3.4 [INFO] [stderr] Checking event-listener v5.4.1 [INFO] [stderr] Checking http-body v1.0.1 [INFO] [stderr] Checking http-body-util v0.1.3 [INFO] [stderr] Compiling rustix v0.37.28 [INFO] [stderr] Compiling syn v2.0.110 [INFO] [stderr] Checking miniz_oxide v0.8.9 [INFO] [stderr] Compiling openssl-src v300.5.4+3.5.4 [INFO] [stderr] Checking event-listener-strategy v0.5.4 [INFO] [stderr] Checking phf_shared v0.12.1 [INFO] [stderr] Checking rustc-demangle v0.1.26 [INFO] [stderr] Compiling chrono-tz v0.10.4 [INFO] [stderr] Checking http-range-header v0.4.2 [INFO] [stderr] Checking linux-raw-sys v0.3.8 [INFO] [stderr] Checking iana-time-zone v0.1.64 [INFO] [stderr] Checking iri-string v0.7.9 [INFO] [stderr] Checking clap_lex v0.7.6 [INFO] [stderr] Checking zeroize v1.8.2 [INFO] [stderr] Checking fallible-iterator v0.3.0 [INFO] [stderr] Compiling thiserror v2.0.17 [INFO] [stderr] Checking regex-automata v0.4.13 [INFO] [stderr] Checking fallible-streaming-iterator v0.1.9 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Checking clap_builder v4.5.53 [INFO] [stderr] Checking ahash v0.8.12 [INFO] [stderr] Checking rustls-pki-types v1.13.0 [INFO] [stderr] Checking phf v0.12.1 [INFO] [stderr] Checking async-channel v2.5.0 [INFO] [stderr] Checking hashbrown v0.14.5 [INFO] [stderr] Checking socket2 v0.6.1 [INFO] [stderr] Checking mio v1.1.0 [INFO] [stderr] Checking parking_lot_core v0.9.12 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Checking dirs-sys-next v0.1.2 [INFO] [stderr] Checking hmac v0.12.1 [INFO] [stderr] Checking cbc v0.1.2 [INFO] [stderr] Checking des v0.8.1 [INFO] [stderr] Checking rc2 v0.8.1 [INFO] [stderr] Checking sha1_smol v1.0.1 [INFO] [stderr] Checking yasna v0.5.2 [INFO] [stderr] Checking jiff v0.2.16 [INFO] [stderr] Compiling govee v0.1.0 (/opt/rustwide/workdir) [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> build.rs:11:15 [INFO] [stdout] | [INFO] [stdout] 11 | .args(&[ [INFO] [stdout] | _______________^ [INFO] [stdout] 12 | | "-c", [INFO] [stdout] 13 | | "core.abbrev=8", [INFO] [stdout] 14 | | "show", [INFO] [stdout] ... | [INFO] [stdout] 17 | | "--date=format:%Y.%m.%d", [INFO] [stdout] 18 | | ]) [INFO] [stdout] | |_________^ [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 11 ~ .args([ [INFO] [stdout] 12 + "-c", [INFO] [stdout] 13 + "core.abbrev=8", [INFO] [stdout] 14 + "show", [INFO] [stdout] 15 + "-s", [INFO] [stdout] 16 + "--format=%cd-%h", [INFO] [stdout] 17 + "--date=format:%Y.%m.%d", [INFO] [stdout] 18 ~ ]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking uuid v1.19.0 [INFO] [stderr] Compiling openssl-sys v0.9.111 [INFO] [stderr] Compiling libsqlite3-sys v0.30.1 [INFO] [stderr] Compiling libmosquitto-sys v0.2.3 [INFO] [stderr] Checking dirs-next v2.0.0 [INFO] [stderr] Checking arc-swap v1.8.0 [INFO] [stderr] Checking if-addrs v0.14.0 [INFO] [stderr] Checking p12 v0.6.3 [INFO] [stderr] Checking hashlink v0.9.1 [INFO] [stderr] Checking colored v2.2.0 [INFO] [stderr] Checking clap-num v1.2.0 [INFO] [stderr] Checking addr2line v0.25.1 [INFO] [stderr] Checking diff v0.1.13 [INFO] [stderr] Checking regex v1.12.2 [INFO] [stderr] Checking serde_path_to_error v0.1.20 [INFO] [stderr] Checking env_filter v0.1.4 [INFO] [stderr] Checking terminal_size v0.2.6 [INFO] [stderr] Checking backtrace v0.3.76 [INFO] [stderr] Checking color-backtrace v0.7.2 [INFO] [stderr] Checking k9 v0.12.0 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Checking env_logger v0.11.8 [INFO] [stderr] Compiling zerovec-derive v0.11.2 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling tracing-attributes v0.1.30 [INFO] [stderr] Compiling tokio-macros v2.6.0 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling phf_macros v0.13.1 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling clap_derive v4.5.49 [INFO] [stderr] Compiling thiserror-impl v2.0.17 [INFO] [stderr] Compiling strum_macros v0.27.2 [INFO] [stderr] Compiling async-trait v0.1.89 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.1 [INFO] [stderr] Checking tokio v1.48.0 [INFO] [stderr] Checking phf v0.13.1 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking csscolorparser v0.8.1 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking yoke v0.8.1 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Checking zerovec v0.11.5 [INFO] [stderr] Checking zerotrie v0.2.3 [INFO] [stderr] Checking axum-core v0.5.5 [INFO] [stderr] Checking clap v4.5.53 [INFO] [stderr] Checking strum v0.27.2 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking tinystr v0.8.2 [INFO] [stderr] Checking potential_utf v0.1.4 [INFO] [stderr] Checking chrono v0.4.42 [INFO] [stderr] Checking serde_json_path_to_error v0.1.5 [INFO] [stderr] Checking icu_collections v2.1.1 [INFO] [stderr] Checking icu_locale_core v2.1.1 [INFO] [stderr] Checking icu_provider v2.1.1 [INFO] [stderr] Checking icu_normalizer v2.1.1 [INFO] [stderr] Checking icu_properties v2.1.1 [INFO] [stderr] Checking futures-executor v0.3.31 [INFO] [stderr] Checking futures v0.3.31 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Checking url v2.5.7 [INFO] [stderr] Checking tokio-util v0.7.17 [INFO] [stderr] Checking tower v0.5.2 [INFO] [stderr] Checking h2 v0.4.12 [INFO] [stderr] Checking tower-http v0.6.8 [INFO] [stderr] Checking rusqlite v0.32.1 [INFO] [stderr] Checking sqlite-cache v0.1.4 [INFO] [stderr] Checking hyper v1.8.1 [INFO] [stderr] Checking hyper-util v0.1.18 [INFO] [stderr] Checking axum v0.8.8 [INFO] [stderr] Compiling native-tls v0.2.14 [INFO] [stderr] Checking tokio-native-tls v0.3.1 [INFO] [stderr] Checking hyper-tls v0.6.0 [INFO] [stderr] Checking reqwest v0.12.28 [INFO] [stderr] Checking mosquitto-rs v0.11.2 [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/hass_mqtt/sensor.rs:153:17 [INFO] [stdout] | [INFO] [stdout] 153 | state_class: state_class, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `state_class` [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/hass_mqtt/sensor.rs:153:17 [INFO] [stdout] | [INFO] [stdout] 153 | state_class: state_class, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `state_class` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/ble.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | encode: Box anyhow::Result> + Sync + Send>, [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/ble.rs:22:13 [INFO] [stdout] | [INFO] [stdout] 22 | decode: Box anyhow::Result + Sync + Send>, [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] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ble.rs:60:21 [INFO] [stdout] | [INFO] [stdout] 60 | / if codec.supported_skus.iter().any(|s| *s == sku) { [INFO] [stdout] 61 | | if map.insert(codec.type_id.clone(), codec.clone()).is_some() { [INFO] [stdout] 62 | | eprintln!("Conflicting PacketCodecs for {sku} {:?}", codec.type_id); [INFO] [stdout] 63 | | } [INFO] [stdout] 64 | | } [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] 60 ~ if codec.supported_skus.iter().any(|s| *s == sku) [INFO] [stdout] 61 ~ && map.insert(codec.type_id.clone(), codec.clone()).is_some() { [INFO] [stdout] 62 | eprintln!("Conflicting PacketCodecs for {sku} {:?}", codec.type_id); [INFO] [stdout] 63 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/ble.rs:60:24 [INFO] [stdout] | [INFO] [stdout] 60 | if codec.supported_skus.iter().any(|s| *s == sku) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `codec.supported_skus.contains(&sku)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TypeId` which implements the `Copy` trait [INFO] [stdout] --> src/ble.rs:61:39 [INFO] [stdout] | [INFO] [stdout] 61 | if map.insert(codec.type_id.clone(), codec.clone()).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `codec.type_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] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `data.get(0)` [INFO] [stdout] --> src/ble.rs:255:18 [INFO] [stdout] | [INFO] [stdout] 255 | *self = *data.get(0).ok_or_else(|| anyhow!("EOF"))?; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `data.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `data.get(0)` [INFO] [stdout] --> src/ble.rs:266:19 [INFO] [stdout] | [INFO] [stdout] 266 | let lo = *data.get(0).ok_or_else(|| anyhow!("EOF"))?; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `data.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [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/ble.rs:289:1 [INFO] [stdout] | [INFO] [stdout] 289 | impl Into for NotifyHumidifierNightlightParams { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [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] 289 ~ impl From for SetHumidifierNightlightParams { [INFO] [stdout] 290 ~ fn from(val: NotifyHumidifierNightlightParams) -> Self { [INFO] [stdout] 291 | SetHumidifierNightlightParams { [INFO] [stdout] 292 ~ on: val.on, [INFO] [stdout] 293 ~ r: val.r, [INFO] [stdout] 294 ~ g: val.g, [INFO] [stdout] 295 ~ b: val.b, [INFO] [stdout] 296 ~ brightness: val.brightness, [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/ble.rs:315:1 [INFO] [stdout] | [INFO] [stdout] 315 | impl Into for TargetHumidity { [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` [INFO] [stdout] | [INFO] [stdout] 315 ~ impl From for u8 { [INFO] [stdout] 316 ~ fn from(val: TargetHumidity) -> Self { [INFO] [stdout] 317 ~ val.0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/ble.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | encode: Box anyhow::Result> + Sync + Send>, [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/ble.rs:22:13 [INFO] [stdout] | [INFO] [stdout] 22 | decode: Box anyhow::Result + Sync + Send>, [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] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/ble.rs:481:9 [INFO] [stdout] | [INFO] [stdout] 481 | checksum = checksum ^ b; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `checksum ^= b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/cache.rs:20:18 [INFO] [stdout] | [INFO] [stdout] 20 | .or_else(|| dirs_next::cache_dir()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `dirs_next::cache_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/cache.rs:29:10 [INFO] [stdout] | [INFO] [stdout] 29 | .expect(&format!("failed to open {cache_file:?}")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("failed to open {cache_file:?}"))` [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: useless conversion to the same type: `std::sync::Arc` [INFO] [stdout] --> src/cache.rs:45:17 [INFO] [stdout] | [INFO] [stdout] 45 | CACHE.store(open_cache()?.into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `open_cache()?` [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: this `if` statement can be collapsed [INFO] [stdout] --> src/ble.rs:60:21 [INFO] [stdout] | [INFO] [stdout] 60 | / if codec.supported_skus.iter().any(|s| *s == sku) { [INFO] [stdout] 61 | | if map.insert(codec.type_id.clone(), codec.clone()).is_some() { [INFO] [stdout] 62 | | eprintln!("Conflicting PacketCodecs for {sku} {:?}", codec.type_id); [INFO] [stdout] 63 | | } [INFO] [stdout] 64 | | } [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] 60 ~ if codec.supported_skus.iter().any(|s| *s == sku) [INFO] [stdout] 61 ~ && map.insert(codec.type_id.clone(), codec.clone()).is_some() { [INFO] [stdout] 62 | eprintln!("Conflicting PacketCodecs for {sku} {:?}", codec.type_id); [INFO] [stdout] 63 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/ble.rs:60:24 [INFO] [stdout] | [INFO] [stdout] 60 | if codec.supported_skus.iter().any(|s| *s == sku) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `codec.supported_skus.contains(&sku)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TypeId` which implements the `Copy` trait [INFO] [stdout] --> src/ble.rs:61:39 [INFO] [stdout] | [INFO] [stdout] 61 | if map.insert(codec.type_id.clone(), codec.clone()).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `codec.type_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] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `data.get(0)` [INFO] [stdout] --> src/ble.rs:255:18 [INFO] [stdout] | [INFO] [stdout] 255 | *self = *data.get(0).ok_or_else(|| anyhow!("EOF"))?; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `data.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `data.get(0)` [INFO] [stdout] --> src/ble.rs:266:19 [INFO] [stdout] | [INFO] [stdout] 266 | let lo = *data.get(0).ok_or_else(|| anyhow!("EOF"))?; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `data.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [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/ble.rs:289:1 [INFO] [stdout] | [INFO] [stdout] 289 | impl Into for NotifyHumidifierNightlightParams { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [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] 289 ~ impl From for SetHumidifierNightlightParams { [INFO] [stdout] 290 ~ fn from(val: NotifyHumidifierNightlightParams) -> Self { [INFO] [stdout] 291 | SetHumidifierNightlightParams { [INFO] [stdout] 292 ~ on: val.on, [INFO] [stdout] 293 ~ r: val.r, [INFO] [stdout] 294 ~ g: val.g, [INFO] [stdout] 295 ~ b: val.b, [INFO] [stdout] 296 ~ brightness: val.brightness, [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/ble.rs:315:1 [INFO] [stdout] | [INFO] [stdout] 315 | impl Into for TargetHumidity { [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` [INFO] [stdout] | [INFO] [stdout] 315 ~ impl From for u8 { [INFO] [stdout] 316 ~ fn from(val: TargetHumidity) -> Self { [INFO] [stdout] 317 ~ val.0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands/http_control.rs:97:61 [INFO] [stdout] | [INFO] [stdout] 97 | let result = client.control_device(&device, &cap, value).await?; [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands/http_control.rs:191:65 [INFO] [stdout] | [INFO] [stdout] 191 | let result = client.control_device(&device, &cap, value).await?; [INFO] [stdout] | ^^^^ help: change this to: `cap` [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 an assign operation [INFO] [stdout] --> src/ble.rs:481:9 [INFO] [stdout] | [INFO] [stdout] 481 | checksum = checksum ^ b; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `checksum ^= b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/cache.rs:20:18 [INFO] [stdout] | [INFO] [stdout] 20 | .or_else(|| dirs_next::cache_dir()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `dirs_next::cache_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/cache.rs:29:10 [INFO] [stdout] | [INFO] [stdout] 29 | .expect(&format!("failed to open {cache_file:?}")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("failed to open {cache_file:?}"))` [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: useless conversion to the same type: `std::sync::Arc` [INFO] [stdout] --> src/cache.rs:45:17 [INFO] [stdout] | [INFO] [stdout] 45 | CACHE.store(open_cache()?.into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `open_cache()?` [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: this boolean expression can be simplified [INFO] [stdout] --> src/commands/lan_disco.rs:21:16 [INFO] [stdout] | [INFO] [stdout] 21 | if !state.device_by_id(&lan_device.device).await.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.device_by_id(&lan_device.device).await.is_none()` [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: redundant closure [INFO] [stdout] --> src/commands/list.rs:92:37 [INFO] [stdout] | [INFO] [stdout] 92 | .unwrap_or_else(|| String::new()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `String::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: named constant with interior mutability [INFO] [stdout] --> src/commands/serve.rs:18:11 [INFO] [stdout] | [INFO] [stdout] 18 | pub const POLL_INTERVAL: Lazy = Lazy::new(|| chrono::Duration::seconds(900)); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: did you mean to make this a `static` item [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const [INFO] [stdout] = note: `#[warn(clippy::declare_interior_mutable_const)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/commands/serve.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | / if !needs_platform { [INFO] [stdout] 88 | | if state.poll_iot_api(&device).await? { [INFO] [stdout] 89 | | return Ok(()); [INFO] [stdout] 90 | | } [INFO] [stdout] 91 | | } [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] 87 ~ if !needs_platform [INFO] [stdout] 88 ~ && state.poll_iot_api(&device).await? { [INFO] [stdout] 89 | return Ok(()); [INFO] [stdout] 90 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands/serve.rs:88:31 [INFO] [stdout] | [INFO] [stdout] 88 | if state.poll_iot_api(&device).await? { [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands/serve.rs:93:29 [INFO] [stdout] | [INFO] [stdout] 93 | state.poll_platform_api(&device).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands/http_control.rs:97:61 [INFO] [stdout] | [INFO] [stdout] 97 | let result = client.control_device(&device, &cap, value).await?; [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands/http_control.rs:191:65 [INFO] [stdout] | [INFO] [stdout] 191 | let result = client.control_device(&device, &cap, value).await?; [INFO] [stdout] | ^^^^ help: change this to: `cap` [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: all variants have the same postfix: `OneClick` [INFO] [stdout] --> src/commands/undoc.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / enum SubCommand { [INFO] [stdout] 12 | | DumpOneClick {}, [INFO] [stdout] 13 | | ShowOneClick {}, [INFO] [stdout] 14 | | OneClick { name: String }, [INFO] [stdout] 15 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the postfixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands/undoc.rs:44:40 [INFO] [stdout] | [INFO] [stdout] 44 | iot.activate_one_click(&item).await?; [INFO] [stdout] | ^^^^^ help: change this to: `item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/commands/lan_disco.rs:21:16 [INFO] [stdout] | [INFO] [stdout] 21 | if !state.device_by_id(&lan_device.device).await.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.device_by_id(&lan_device.device).await.is_none()` [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: redundant closure [INFO] [stdout] --> src/commands/list.rs:92:37 [INFO] [stdout] | [INFO] [stdout] 92 | .unwrap_or_else(|| String::new()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `String::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: named constant with interior mutability [INFO] [stdout] --> src/commands/serve.rs:18:11 [INFO] [stdout] | [INFO] [stdout] 18 | pub const POLL_INTERVAL: Lazy = Lazy::new(|| chrono::Duration::seconds(900)); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: did you mean to make this a `static` item [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const [INFO] [stdout] = note: `#[warn(clippy::declare_interior_mutable_const)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/climate.rs:132:29 [INFO] [stdout] | [INFO] [stdout] 132 | self.number.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/climate.rs:132:37 [INFO] [stdout] | [INFO] [stdout] 132 | self.number.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [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 `if` statement can be collapsed [INFO] [stdout] --> src/commands/serve.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | / if !needs_platform { [INFO] [stdout] 88 | | if state.poll_iot_api(&device).await? { [INFO] [stdout] 89 | | return Ok(()); [INFO] [stdout] 90 | | } [INFO] [stdout] 91 | | } [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] 87 ~ if !needs_platform [INFO] [stdout] 88 ~ && state.poll_iot_api(&device).await? { [INFO] [stdout] 89 | return Ok(()); [INFO] [stdout] 90 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands/serve.rs:88:31 [INFO] [stdout] | [INFO] [stdout] 88 | if state.poll_iot_api(&device).await? { [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands/serve.rs:93:29 [INFO] [stdout] | [INFO] [stdout] 93 | state.poll_platform_api(&device).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/climate.rs:178:45 [INFO] [stdout] | [INFO] [stdout] 178 | return self.number.notify_state(&client, &value).await; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [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 lifetime isn't used in the function definition [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:82:33 [INFO] [stdout] | [INFO] [stdout] 82 | async fn entities_for_work_mode<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:147:44 [INFO] [stdout] | [INFO] [stdout] 147 | pub async fn enumerate_entities_for_device<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] 148 | d: &'a ServiceDevice, [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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:160:46 [INFO] [stdout] | [INFO] [stdout] 160 | entities.add(DeviceLight::for_device(&d, state, None).await?); [INFO] [stdout] | ^^ help: change this to: `d` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:167:38 [INFO] [stdout] | [INFO] [stdout] 167 | entities.add(Humidifier::new(&d, state).await?); [INFO] [stdout] | ^^ help: change this to: `d` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:180:56 [INFO] [stdout] | [INFO] [stdout] 180 | entities.add(CapabilitySwitch::new(&d, state, cap).await?); [INFO] [stdout] | ^^ help: change this to: `d` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:196:56 [INFO] [stdout] | [INFO] [stdout] 196 | entities.add(CapabilitySensor::new(&d, state, cap).await?); [INFO] [stdout] | ^^ help: change this to: `d` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:200:63 [INFO] [stdout] | [INFO] [stdout] 200 | entities.add(TargetTemperatureEntity::new(&d, state, cap).await?); [INFO] [stdout] | ^^ help: change this to: `d` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:214:54 [INFO] [stdout] | [INFO] [stdout] 214 | entities.add(DeviceLight::for_device(&d, state, Some(n)).await?); [INFO] [stdout] | ^^ help: change this to: `d` [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: all variants have the same postfix: `OneClick` [INFO] [stdout] --> src/commands/undoc.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / enum SubCommand { [INFO] [stdout] 12 | | DumpOneClick {}, [INFO] [stdout] 13 | | ShowOneClick {}, [INFO] [stdout] 14 | | OneClick { name: String }, [INFO] [stdout] 15 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the postfixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/hass_mqtt/humidifier.rs:111:25 [INFO] [stdout] | [INFO] [stdout] 111 | / if unit.as_deref() == Some("unit.percent") { [INFO] [stdout] 112 | | min_humidity.replace(*min as u8); [INFO] [stdout] 113 | | max_humidity.replace(*max as u8); [INFO] [stdout] 114 | | } [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] 110 ~ }) [INFO] [stdout] 111 ~ if unit.as_deref() == Some("unit.percent") => { [INFO] [stdout] 112 | min_humidity.replace(*min as u8); [INFO] [stdout] 113 | max_humidity.replace(*max as u8); [INFO] [stdout] 114 ~ } [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/hass_mqtt/humidifier.rs:106:17 [INFO] [stdout] | [INFO] [stdout] 106 | / match &cap.parameters { [INFO] [stdout] 107 | | Some(DeviceParameters::Integer { [INFO] [stdout] 108 | | range: IntegerRange { min, max, .. }, [INFO] [stdout] 109 | | unit, [INFO] [stdout] ... | [INFO] [stdout] 116 | | _ => {} [INFO] [stdout] 117 | | } [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] 106 ~ if let Some(DeviceParameters::Integer { [INFO] [stdout] 107 + range: IntegerRange { min, max, .. }, [INFO] [stdout] 108 + unit, [INFO] [stdout] 109 + }) = &cap.parameters { [INFO] [stdout] 110 + if unit.as_deref() == Some("unit.percent") { [INFO] [stdout] 111 + min_humidity.replace(*min as u8); [INFO] [stdout] 112 + max_humidity.replace(*max as u8); [INFO] [stdout] 113 + } [INFO] [stdout] 114 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands/undoc.rs:44:40 [INFO] [stdout] | [INFO] [stdout] 44 | iot.activate_one_click(&item).await?; [INFO] [stdout] | ^^^^^ help: change this to: `item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/light.rs:65:28 [INFO] [stdout] | [INFO] [stdout] 65 | self.light.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/light.rs:65:36 [INFO] [stdout] | [INFO] [stdout] 65 | self.light.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `unwrap_or` to construct default value [INFO] [stdout] --> src/hass_mqtt/light.rs:158:52 [INFO] [stdout] | [INFO] [stdout] 158 | seg = segment.map(|n| format!("-{n}")).unwrap_or(String::new()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/climate.rs:132:29 [INFO] [stdout] | [INFO] [stdout] 132 | self.number.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/climate.rs:132:37 [INFO] [stdout] | [INFO] [stdout] 132 | self.number.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/climate.rs:178:45 [INFO] [stdout] | [INFO] [stdout] 178 | return self.number.notify_state(&client, &value).await; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/number.rs:119:29 [INFO] [stdout] | [INFO] [stdout] 119 | self.number.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/number.rs:119:37 [INFO] [stdout] | [INFO] [stdout] 119 | self.number.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [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 lifetime isn't used in the function definition [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:82:33 [INFO] [stdout] | [INFO] [stdout] 82 | async fn entities_for_work_mode<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:147:44 [INFO] [stdout] | [INFO] [stdout] 147 | pub async fn enumerate_entities_for_device<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] 148 | d: &'a ServiceDevice, [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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:160:46 [INFO] [stdout] | [INFO] [stdout] 160 | entities.add(DeviceLight::for_device(&d, state, None).await?); [INFO] [stdout] | ^^ help: change this to: `d` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/scene.rs:26:22 [INFO] [stdout] | [INFO] [stdout] 26 | self.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:167:38 [INFO] [stdout] | [INFO] [stdout] 167 | entities.add(Humidifier::new(&d, state).await?); [INFO] [stdout] | ^^ help: change this to: `d` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:180:56 [INFO] [stdout] | [INFO] [stdout] 180 | entities.add(CapabilitySwitch::new(&d, state, cap).await?); [INFO] [stdout] | ^^ help: change this to: `d` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/scene.rs:26:30 [INFO] [stdout] | [INFO] [stdout] 26 | self.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:196:56 [INFO] [stdout] | [INFO] [stdout] 196 | entities.add(CapabilitySensor::new(&d, state, cap).await?); [INFO] [stdout] | ^^ help: change this to: `d` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:200:63 [INFO] [stdout] | [INFO] [stdout] 200 | entities.add(TargetTemperatureEntity::new(&d, state, cap).await?); [INFO] [stdout] | ^^ help: change this to: `d` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/select.rs:66:29 [INFO] [stdout] | [INFO] [stdout] 66 | self.select.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/enumerator.rs:214:54 [INFO] [stdout] | [INFO] [stdout] 214 | entities.add(DeviceLight::for_device(&d, state, Some(n)).await?); [INFO] [stdout] | ^^ help: change this to: `d` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/select.rs:66:37 [INFO] [stdout] | [INFO] [stdout] 66 | self.select.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/select.rs:145:29 [INFO] [stdout] | [INFO] [stdout] 145 | self.select.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/select.rs:145:37 [INFO] [stdout] | [INFO] [stdout] 145 | self.select.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [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 `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/hass_mqtt/humidifier.rs:111:25 [INFO] [stdout] | [INFO] [stdout] 111 | / if unit.as_deref() == Some("unit.percent") { [INFO] [stdout] 112 | | min_humidity.replace(*min as u8); [INFO] [stdout] 113 | | max_humidity.replace(*max as u8); [INFO] [stdout] 114 | | } [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] 110 ~ }) [INFO] [stdout] 111 ~ if unit.as_deref() == Some("unit.percent") => { [INFO] [stdout] 112 | min_humidity.replace(*min as u8); [INFO] [stdout] 113 | max_humidity.replace(*max as u8); [INFO] [stdout] 114 ~ } [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/hass_mqtt/humidifier.rs:106:17 [INFO] [stdout] | [INFO] [stdout] 106 | / match &cap.parameters { [INFO] [stdout] 107 | | Some(DeviceParameters::Integer { [INFO] [stdout] 108 | | range: IntegerRange { min, max, .. }, [INFO] [stdout] 109 | | unit, [INFO] [stdout] ... | [INFO] [stdout] 116 | | _ => {} [INFO] [stdout] 117 | | } [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] 106 ~ if let Some(DeviceParameters::Integer { [INFO] [stdout] 107 + range: IntegerRange { min, max, .. }, [INFO] [stdout] 108 + unit, [INFO] [stdout] 109 + }) = &cap.parameters { [INFO] [stdout] 110 + if unit.as_deref() == Some("unit.percent") { [INFO] [stdout] 111 + min_humidity.replace(*min as u8); [INFO] [stdout] 112 + max_humidity.replace(*max as u8); [INFO] [stdout] 113 + } [INFO] [stdout] 114 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:60:29 [INFO] [stdout] | [INFO] [stdout] 60 | self.sensor.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:60:37 [INFO] [stdout] | [INFO] [stdout] 60 | self.sensor.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:64:34 [INFO] [stdout] | [INFO] [stdout] 64 | self.sensor.notify_state(&client, &self.value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:167:29 [INFO] [stdout] | [INFO] [stdout] 167 | self.sensor.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:167:37 [INFO] [stdout] | [INFO] [stdout] 167 | self.sensor.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:218:45 [INFO] [stdout] | [INFO] [stdout] 218 | return self.sensor.notify_state(&client, &value).await; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:264:29 [INFO] [stdout] | [INFO] [stdout] 264 | self.sensor.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:264:37 [INFO] [stdout] | [INFO] [stdout] 264 | self.sensor.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [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: borrow of a named constant with interior mutability [INFO] [stdout] --> src/hass_mqtt/sensor.rs:283:25 [INFO] [stdout] | [INFO] [stdout] 283 | let threshold = *POLL_INTERVAL + chrono::Duration::seconds(30); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this deref expression is a call to `Deref::deref` [INFO] [stdout] = help: this lint can be silenced by assigning the value to a local variable before borrowing [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_interior_mutable_const [INFO] [stdout] = note: `#[warn(clippy::borrow_interior_mutable_const)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:305:34 [INFO] [stdout] | [INFO] [stdout] 305 | self.sensor.notify_state(&client, &summary).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/light.rs:65:28 [INFO] [stdout] | [INFO] [stdout] 65 | self.light.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/light.rs:65:36 [INFO] [stdout] | [INFO] [stdout] 65 | self.light.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/switch.rs:87:29 [INFO] [stdout] | [INFO] [stdout] 87 | self.switch.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/switch.rs:87:37 [INFO] [stdout] | [INFO] [stdout] 87 | self.switch.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `unwrap_or` to construct default value [INFO] [stdout] --> src/hass_mqtt/light.rs:158:52 [INFO] [stdout] | [INFO] [stdout] 158 | seg = segment.map(|n| format!("-{n}")).unwrap_or(String::new()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::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/hass_mqtt/work_mode.rs:35:9 [INFO] [stdout] | [INFO] [stdout] 35 | / match &wm.field_type { [INFO] [stdout] 36 | | DeviceParameters::Enum { options } => { [INFO] [stdout] 37 | | for opt in options { [INFO] [stdout] 38 | | work_modes.add(opt.name.to_string(), opt.value.clone()); [INFO] [stdout] ... | [INFO] [stdout] 41 | | _ => {} [INFO] [stdout] 42 | | } [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] 35 ~ if let DeviceParameters::Enum { options } = &wm.field_type { [INFO] [stdout] 36 + for opt in options { [INFO] [stdout] 37 + work_modes.add(opt.name.to_string(), opt.value.clone()); [INFO] [stdout] 38 + } [INFO] [stdout] 39 + } [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/hass_mqtt/work_mode.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | / match &mv.field_type { [INFO] [stdout] 46 | | DeviceParameters::Enum { options } => { [INFO] [stdout] 47 | | for opt in options { [INFO] [stdout] 48 | | let mode_name = &opt.name; [INFO] [stdout] ... | [INFO] [stdout] 54 | | _ => {} [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] 45 ~ if let DeviceParameters::Enum { options } = &mv.field_type { [INFO] [stdout] 46 + for opt in options { [INFO] [stdout] 47 + let mode_name = &opt.name; [INFO] [stdout] 48 + if let Some(work_mode) = work_modes.get_mut(mode_name) { [INFO] [stdout] 49 + work_mode.add_values(opt); [INFO] [stdout] 50 + } [INFO] [stdout] 51 + } [INFO] [stdout] 52 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:78:17 [INFO] [stdout] | [INFO] [stdout] 78 | / self.modes [INFO] [stdout] 79 | | .get_mut("Manual") [INFO] [stdout] 80 | | .map(|m| m.label = "Manual: Mist Level".to_string()); [INFO] [stdout] | |________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] = note: `#[warn(clippy::option_map_unit_fn)]` on by default [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 78 ~ if let Some(m) = self.modes [INFO] [stdout] 79 + .get_mut("Manual") { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:83:17 [INFO] [stdout] | [INFO] [stdout] 83 | / self.modes.get_mut("gearMode").map(|m| { [INFO] [stdout] 84 | | m.label = "Heat".to_string(); [INFO] [stdout] 85 | | }); [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 83 - self.modes.get_mut("gearMode").map(|m| { [INFO] [stdout] 84 - m.label = "Heat".to_string(); [INFO] [stdout] 85 - }); [INFO] [stdout] 83 + if let Some(m) = self.modes.get_mut("gearMode") { m.label = "Heat".to_string(); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:88:17 [INFO] [stdout] | [INFO] [stdout] 88 | / self.modes.get_mut("gearMode").map(|m| { [INFO] [stdout] 89 | | m.label = "Heat".to_string(); [INFO] [stdout] 90 | | }); [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 88 - self.modes.get_mut("gearMode").map(|m| { [INFO] [stdout] 89 - m.label = "Heat".to_string(); [INFO] [stdout] 90 - }); [INFO] [stdout] 88 + if let Some(m) = self.modes.get_mut("gearMode") { m.label = "Heat".to_string(); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:101:9 [INFO] [stdout] | [INFO] [stdout] 101 | / for mode in self.modes.values() { [INFO] [stdout] 102 | | if mode.value == *value { [INFO] [stdout] 103 | | return Some(mode); [INFO] [stdout] ... | [INFO] [stdout] 106 | | None [INFO] [stdout] | |____________^ help: replace with an iterator: `self.modes.values().find(|&mode| mode.value == *value).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: manual implementation of `Iterator::find` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | / for mode in self.modes.values() { [INFO] [stdout] 116 | | if mode.label() == name { [INFO] [stdout] 117 | | return Some(mode); [INFO] [stdout] ... | [INFO] [stdout] 120 | | None [INFO] [stdout] | |____________^ help: replace with an iterator: `self.modes.values().find(|&mode| mode.label() == 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] [INFO] [stdout] [INFO] [stdout] warning: this `.filter_map(..)` can be written more simply using `.filter(..)` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:146:29 [INFO] [stdout] | [INFO] [stdout] 146 | self.modes.values().filter_map(|mode| { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 147 | | if mode.values.is_empty() { [INFO] [stdout] 148 | | None [INFO] [stdout] 149 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 152 | | }) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map [INFO] [stdout] = note: `#[warn(clippy::unnecessary_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/number.rs:119:29 [INFO] [stdout] | [INFO] [stdout] 119 | self.number.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/number.rs:119:37 [INFO] [stdout] | [INFO] [stdout] 119 | self.number.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [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: accessing first element with `self.values.get(0)` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:240:25 [INFO] [stdout] | [INFO] [stdout] 240 | .or_else(|| self.values.get(0).and_then(|wmv| wmv.value.as_i64())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `self.values.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:270:13 [INFO] [stdout] | [INFO] [stdout] 270 | expect = expect + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `expect += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/scene.rs:26:22 [INFO] [stdout] | [INFO] [stdout] 26 | self.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/scene.rs:26:30 [INFO] [stdout] | [INFO] [stdout] 26 | self.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/select.rs:66:29 [INFO] [stdout] | [INFO] [stdout] 66 | self.select.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/select.rs:66:37 [INFO] [stdout] | [INFO] [stdout] 66 | self.select.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/select.rs:145:29 [INFO] [stdout] | [INFO] [stdout] 145 | self.select.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/select.rs:145:37 [INFO] [stdout] | [INFO] [stdout] 145 | self.select.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:60:29 [INFO] [stdout] | [INFO] [stdout] 60 | self.sensor.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:60:37 [INFO] [stdout] | [INFO] [stdout] 60 | self.sensor.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:64:34 [INFO] [stdout] | [INFO] [stdout] 64 | self.sensor.notify_state(&client, &self.value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:167:29 [INFO] [stdout] | [INFO] [stdout] 167 | self.sensor.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:167:37 [INFO] [stdout] | [INFO] [stdout] 167 | self.sensor.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:218:45 [INFO] [stdout] | [INFO] [stdout] 218 | return self.sensor.notify_state(&client, &value).await; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:264:29 [INFO] [stdout] | [INFO] [stdout] 264 | self.sensor.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:264:37 [INFO] [stdout] | [INFO] [stdout] 264 | self.sensor.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [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: borrow of a named constant with interior mutability [INFO] [stdout] --> src/hass_mqtt/sensor.rs:283:25 [INFO] [stdout] | [INFO] [stdout] 283 | let threshold = *POLL_INTERVAL + chrono::Duration::seconds(30); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this deref expression is a call to `Deref::deref` [INFO] [stdout] = help: this lint can be silenced by assigning the value to a local variable before borrowing [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_interior_mutable_const [INFO] [stdout] = note: `#[warn(clippy::borrow_interior_mutable_const)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/sensor.rs:305:34 [INFO] [stdout] | [INFO] [stdout] 305 | self.sensor.notify_state(&client, &summary).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/switch.rs:87:29 [INFO] [stdout] | [INFO] [stdout] 87 | self.switch.publish(&state, &client).await [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hass_mqtt/switch.rs:87:37 [INFO] [stdout] | [INFO] [stdout] 87 | self.switch.publish(&state, &client).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [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/hass_mqtt/work_mode.rs:35:9 [INFO] [stdout] | [INFO] [stdout] 35 | / match &wm.field_type { [INFO] [stdout] 36 | | DeviceParameters::Enum { options } => { [INFO] [stdout] 37 | | for opt in options { [INFO] [stdout] 38 | | work_modes.add(opt.name.to_string(), opt.value.clone()); [INFO] [stdout] ... | [INFO] [stdout] 41 | | _ => {} [INFO] [stdout] 42 | | } [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] 35 ~ if let DeviceParameters::Enum { options } = &wm.field_type { [INFO] [stdout] 36 + for opt in options { [INFO] [stdout] 37 + work_modes.add(opt.name.to_string(), opt.value.clone()); [INFO] [stdout] 38 + } [INFO] [stdout] 39 + } [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/hass_mqtt/work_mode.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | / match &mv.field_type { [INFO] [stdout] 46 | | DeviceParameters::Enum { options } => { [INFO] [stdout] 47 | | for opt in options { [INFO] [stdout] 48 | | let mode_name = &opt.name; [INFO] [stdout] ... | [INFO] [stdout] 54 | | _ => {} [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] 45 ~ if let DeviceParameters::Enum { options } = &mv.field_type { [INFO] [stdout] 46 + for opt in options { [INFO] [stdout] 47 + let mode_name = &opt.name; [INFO] [stdout] 48 + if let Some(work_mode) = work_modes.get_mut(mode_name) { [INFO] [stdout] 49 + work_mode.add_values(opt); [INFO] [stdout] 50 + } [INFO] [stdout] 51 + } [INFO] [stdout] 52 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:78:17 [INFO] [stdout] | [INFO] [stdout] 78 | / self.modes [INFO] [stdout] 79 | | .get_mut("Manual") [INFO] [stdout] 80 | | .map(|m| m.label = "Manual: Mist Level".to_string()); [INFO] [stdout] | |________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] = note: `#[warn(clippy::option_map_unit_fn)]` on by default [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 78 ~ if let Some(m) = self.modes [INFO] [stdout] 79 + .get_mut("Manual") { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:83:17 [INFO] [stdout] | [INFO] [stdout] 83 | / self.modes.get_mut("gearMode").map(|m| { [INFO] [stdout] 84 | | m.label = "Heat".to_string(); [INFO] [stdout] 85 | | }); [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 83 - self.modes.get_mut("gearMode").map(|m| { [INFO] [stdout] 84 - m.label = "Heat".to_string(); [INFO] [stdout] 85 - }); [INFO] [stdout] 83 + if let Some(m) = self.modes.get_mut("gearMode") { m.label = "Heat".to_string(); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:88:17 [INFO] [stdout] | [INFO] [stdout] 88 | / self.modes.get_mut("gearMode").map(|m| { [INFO] [stdout] 89 | | m.label = "Heat".to_string(); [INFO] [stdout] 90 | | }); [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 88 - self.modes.get_mut("gearMode").map(|m| { [INFO] [stdout] 89 - m.label = "Heat".to_string(); [INFO] [stdout] 90 - }); [INFO] [stdout] 88 + if let Some(m) = self.modes.get_mut("gearMode") { m.label = "Heat".to_string(); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:101:9 [INFO] [stdout] | [INFO] [stdout] 101 | / for mode in self.modes.values() { [INFO] [stdout] 102 | | if mode.value == *value { [INFO] [stdout] 103 | | return Some(mode); [INFO] [stdout] ... | [INFO] [stdout] 106 | | None [INFO] [stdout] | |____________^ help: replace with an iterator: `self.modes.values().find(|&mode| mode.value == *value).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: manual implementation of `Iterator::find` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | / for mode in self.modes.values() { [INFO] [stdout] 116 | | if mode.label() == name { [INFO] [stdout] 117 | | return Some(mode); [INFO] [stdout] ... | [INFO] [stdout] 120 | | None [INFO] [stdout] | |____________^ help: replace with an iterator: `self.modes.values().find(|&mode| mode.label() == 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] [INFO] [stdout] [INFO] [stdout] warning: this `.filter_map(..)` can be written more simply using `.filter(..)` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:146:29 [INFO] [stdout] | [INFO] [stdout] 146 | self.modes.values().filter_map(|mode| { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 147 | | if mode.values.is_empty() { [INFO] [stdout] 148 | | None [INFO] [stdout] 149 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 152 | | }) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map [INFO] [stdout] = note: `#[warn(clippy::unnecessary_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.values.get(0)` [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:240:25 [INFO] [stdout] | [INFO] [stdout] 240 | .or_else(|| self.values.get(0).and_then(|wmv| wmv.value.as_i64())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `self.values.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:270:13 [INFO] [stdout] | [INFO] [stdout] 270 | expect = expect + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `expect += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:374:23 [INFO] [stdout] | [INFO] [stdout] 374 | from_json(&include_str!("../../test-data/work-mode-issue-81.json")).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `include_str!("../../test-data/work-mode-issue-81.json")` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:516:23 [INFO] [stdout] | [INFO] [stdout] 516 | from_json(&include_str!("../../test-data/work-mode-issue-93.json")).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `include_str!("../../test-data/work-mode-issue-93.json")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/hass_mqtt/work_mode.rs:596:23 [INFO] [stdout] | [INFO] [stdout] 596 | from_json(&include_str!("../../test-data/work-mode-issue-100.json")).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `include_str!("../../test-data/work-mode-issue-100.json")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:232:49 [INFO] [stdout] | [INFO] [stdout] 232 | let scene_caps = self.get_device_scenes(&device).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:233:51 [INFO] [stdout] | [INFO] [stdout] 233 | let diy_caps = self.get_device_diy_scenes(&device).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [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/platform_api.rs:306:25 [INFO] [stdout] | [INFO] [stdout] 306 | / match &f.field_type { [INFO] [stdout] 307 | | DeviceParameters::Enum { options } => { [INFO] [stdout] 308 | | for opt in options { [INFO] [stdout] 309 | | result.push(format!("Music: {}", opt.name)); [INFO] [stdout] ... | [INFO] [stdout] 312 | | _ => {} [INFO] [stdout] 313 | | } [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] 306 ~ if let DeviceParameters::Enum { options } = &f.field_type { [INFO] [stdout] 307 + for opt in options { [INFO] [stdout] 308 + result.push(format!("Music: {}", opt.name)); [INFO] [stdout] 309 + } [INFO] [stdout] 310 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/platform_api.rs:331:12 [INFO] [stdout] | [INFO] [stdout] 331 | if scene == "" { [INFO] [stdout] | ^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `scene.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:345:52 [INFO] [stdout] | [INFO] [stdout] 345 | return self.control_device(&device, &cap, value).await; [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:345:61 [INFO] [stdout] | [INFO] [stdout] 345 | return self.control_device(&device, &cap, value).await; [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:357:56 [INFO] [stdout] | [INFO] [stdout] 357 | ... return self.control_device(&device, &cap, opt.value.clone()).await; [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:395:29 [INFO] [stdout] | [INFO] [stdout] 395 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:395:38 [INFO] [stdout] | [INFO] [stdout] 395 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:413:29 [INFO] [stdout] | [INFO] [stdout] 413 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:413:38 [INFO] [stdout] | [INFO] [stdout] 413 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:430:29 [INFO] [stdout] | [INFO] [stdout] 430 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:430:38 [INFO] [stdout] | [INFO] [stdout] 430 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:456:29 [INFO] [stdout] | [INFO] [stdout] 456 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:456:38 [INFO] [stdout] | [INFO] [stdout] 456 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:474:29 [INFO] [stdout] | [INFO] [stdout] 474 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:474:38 [INFO] [stdout] | [INFO] [stdout] 474 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:488:29 [INFO] [stdout] | [INFO] [stdout] 488 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:488:38 [INFO] [stdout] | [INFO] [stdout] 488 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:504:13 [INFO] [stdout] | [INFO] [stdout] 504 | &device, [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:505:13 [INFO] [stdout] | [INFO] [stdout] 505 | &cap, [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:531:13 [INFO] [stdout] | [INFO] [stdout] 531 | &device, [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:532:13 [INFO] [stdout] | [INFO] [stdout] 532 | &cap, [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:232:49 [INFO] [stdout] | [INFO] [stdout] 232 | let scene_caps = self.get_device_scenes(&device).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:233:51 [INFO] [stdout] | [INFO] [stdout] 233 | let diy_caps = self.get_device_diy_scenes(&device).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [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/platform_api.rs:306:25 [INFO] [stdout] | [INFO] [stdout] 306 | / match &f.field_type { [INFO] [stdout] 307 | | DeviceParameters::Enum { options } => { [INFO] [stdout] 308 | | for opt in options { [INFO] [stdout] 309 | | result.push(format!("Music: {}", opt.name)); [INFO] [stdout] ... | [INFO] [stdout] 312 | | _ => {} [INFO] [stdout] 313 | | } [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] 306 ~ if let DeviceParameters::Enum { options } = &f.field_type { [INFO] [stdout] 307 + for opt in options { [INFO] [stdout] 308 + result.push(format!("Music: {}", opt.name)); [INFO] [stdout] 309 + } [INFO] [stdout] 310 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/platform_api.rs:331:12 [INFO] [stdout] | [INFO] [stdout] 331 | if scene == "" { [INFO] [stdout] | ^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `scene.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:345:52 [INFO] [stdout] | [INFO] [stdout] 345 | return self.control_device(&device, &cap, value).await; [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:345:61 [INFO] [stdout] | [INFO] [stdout] 345 | return self.control_device(&device, &cap, value).await; [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:357:56 [INFO] [stdout] | [INFO] [stdout] 357 | ... return self.control_device(&device, &cap, opt.value.clone()).await; [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:395:29 [INFO] [stdout] | [INFO] [stdout] 395 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:395:38 [INFO] [stdout] | [INFO] [stdout] 395 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:413:29 [INFO] [stdout] | [INFO] [stdout] 413 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:413:38 [INFO] [stdout] | [INFO] [stdout] 413 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:430:29 [INFO] [stdout] | [INFO] [stdout] 430 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:430:38 [INFO] [stdout] | [INFO] [stdout] 430 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:456:29 [INFO] [stdout] | [INFO] [stdout] 456 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:456:38 [INFO] [stdout] | [INFO] [stdout] 456 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:474:29 [INFO] [stdout] | [INFO] [stdout] 474 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:474:38 [INFO] [stdout] | [INFO] [stdout] 474 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:488:29 [INFO] [stdout] | [INFO] [stdout] 488 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:488:38 [INFO] [stdout] | [INFO] [stdout] 488 | self.control_device(&device, &cap, value).await [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:504:13 [INFO] [stdout] | [INFO] [stdout] 504 | &device, [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:505:13 [INFO] [stdout] | [INFO] [stdout] 505 | &cap, [INFO] [stdout] | ^^^^ help: change this to: `cap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:531:13 [INFO] [stdout] | [INFO] [stdout] 531 | &device, [INFO] [stdout] | ^^^^^^^ help: change this to: `device` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/platform_api.rs:532:13 [INFO] [stdout] | [INFO] [stdout] 532 | &cap, [INFO] [stdout] | ^^^^ help: change this to: `cap` [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: borrow of a named constant with interior mutability [INFO] [stdout] --> src/service/device.rs:165:21 [INFO] [stdout] | [INFO] [stdout] 165 | *POLL_INTERVAL [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this deref expression is a call to `Deref::deref` [INFO] [stdout] = help: this lint can be silenced by assigning the value to a local variable before borrowing [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_interior_mutable_const [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: borrow of a named constant with interior mutability [INFO] [stdout] --> src/service/device.rs:168:18 [INFO] [stdout] | [INFO] [stdout] 168 | _ => *POLL_INTERVAL, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this deref expression is a call to `Deref::deref` [INFO] [stdout] = help: this lint can be silenced by assigning the value to a local variable before borrowing [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_interior_mutable_const [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: derefed type is same as origin [INFO] [stdout] --> src/service/device.rs:304:20 [INFO] [stdout] | [INFO] [stdout] 304 | if light_instance [INFO] [stdout] | ____________________^ [INFO] [stdout] 305 | | .as_deref() [INFO] [stdout] | |_______________________________^ help: try: `light_instance` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_option_as_deref [INFO] [stdout] = note: `#[warn(clippy::needless_option_as_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/platform_api.rs:1120:55 [INFO] [stdout] | [INFO] [stdout] 1120 | let resp: GetDeviceScenesResponse = from_json(&SCENE_LIST).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `SCENE_LIST` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/service/device.rs:365:9 [INFO] [stdout] | [INFO] [stdout] 365 | candidates.sort_by(|a, b| a.updated.cmp(&b.updated)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 365 - candidates.sort_by(|a, b| a.updated.cmp(&b.updated)); [INFO] [stdout] 365 + candidates.sort_by_key(|a| a.updated); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/platform_api.rs:1128:54 [INFO] [stdout] | [INFO] [stdout] 1128 | let resp: GetDeviceStateResponse = from_json(&GET_DEVICE_STATE_EXAMPLE).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `GET_DEVICE_STATE_EXAMPLE` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/platform_api.rs:1138:23 [INFO] [stdout] | [INFO] [stdout] 1138 | from_json(&include_str!("../test-data/list_devices_issue4.json")).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `include_str!("../test-data/list_devices_issue4.json")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/service/device.rs:442:9 [INFO] [stdout] | [INFO] [stdout] 442 | / match (device_type, self.sku.as_str()) { [INFO] [stdout] 443 | | (_, "H7160") => true, [INFO] [stdout] 444 | | (DeviceType::Light, _) => true, [INFO] [stdout] 445 | | _ => false, [INFO] [stdout] 446 | | } [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] 442 - match (device_type, self.sku.as_str()) { [INFO] [stdout] 443 - (_, "H7160") => true, [INFO] [stdout] 444 - (DeviceType::Light, _) => true, [INFO] [stdout] 445 - _ => false, [INFO] [stdout] 446 - } [INFO] [stdout] 442 + matches!((device_type, self.sku.as_str()), (_, "H7160") | (DeviceType::Light, _)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/platform_api.rs:1144:50 [INFO] [stdout] | [INFO] [stdout] 1144 | let resp: GetDevicesResponse = from_json(&LIST_DEVICES_EXAMPLE2).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `LIST_DEVICES_EXAMPLE2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/platform_api.rs:1150:50 [INFO] [stdout] | [INFO] [stdout] 1150 | let resp: GetDevicesResponse = from_json(&LIST_DEVICES_EXAMPLE).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `LIST_DEVICES_EXAMPLE` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/service/device.rs:590:9 [INFO] [stdout] | [INFO] [stdout] 590 | / if let Some(info) = &self.undoc_device_info { [INFO] [stdout] 591 | | Some(info.entry.device_ext.device_settings.wifi_name.is_none()) [INFO] [stdout] 592 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 595 | | } [INFO] [stdout] | |_________^ help: try: `self.undoc_device_info.as_ref().map(|info| info.entry.device_ext.device_settings.wifi_name.is_none())` [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: match expression looks like `matches!` macro [INFO] [stdout] --> src/service/device.rs:599:9 [INFO] [stdout] | [INFO] [stdout] 599 | / match self.is_ble_only_device() { [INFO] [stdout] 600 | | Some(true) => false, [INFO] [stdout] 601 | | _ => true, [INFO] [stdout] 602 | | } [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] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 599 - match self.is_ble_only_device() { [INFO] [stdout] 600 - Some(true) => false, [INFO] [stdout] 601 - _ => true, [INFO] [stdout] 602 - } [INFO] [stdout] 599 + !matches!(self.is_ble_only_device(), Some(true)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/rest_api.rs:253:23 [INFO] [stdout] | [INFO] [stdout] 253 | from_json(&include_str!("../test-data/rest-list-devices.json")).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `include_str!("../test-data/rest-list-devices.json")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/rest_api.rs:260:23 [INFO] [stdout] | [INFO] [stdout] 260 | from_json(&include_str!("../test-data/rest-appliances.json")).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `include_str!("../test-data/rest-appliances.json")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/hass.rs:374:41 [INFO] [stdout] | [INFO] [stdout] 374 | .set_segment_brightness(&info, segment, brightness) [INFO] [stdout] | ^^^^^ help: change this to: `info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/hass.rs:388:34 [INFO] [stdout] | [INFO] [stdout] 388 | .set_segment_rgb(&info, segment, color.r, color.g, color.b) [INFO] [stdout] | ^^^^^ help: change this to: `info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/hass.rs:431:28 [INFO] [stdout] | [INFO] [stdout] 431 | iot.activate_one_click(&item).await [INFO] [stdout] | ^^^^^ help: change this to: `item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: borrow of a named constant with interior mutability [INFO] [stdout] --> src/service/device.rs:165:21 [INFO] [stdout] | [INFO] [stdout] 165 | *POLL_INTERVAL [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this deref expression is a call to `Deref::deref` [INFO] [stdout] = help: this lint can be silenced by assigning the value to a local variable before borrowing [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_interior_mutable_const [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: borrow of a named constant with interior mutability [INFO] [stdout] --> src/service/device.rs:168:18 [INFO] [stdout] | [INFO] [stdout] 168 | _ => *POLL_INTERVAL, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this deref expression is a call to `Deref::deref` [INFO] [stdout] = help: this lint can be silenced by assigning the value to a local variable before borrowing [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_interior_mutable_const [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual checked division [INFO] [stdout] --> src/service/hass.rs:470:8 [INFO] [stdout] | [INFO] [stdout] 470 | if mired == 0 { [INFO] [stdout] | ^^^^^^^^^^ check performed here [INFO] [stdout] ... [INFO] [stdout] 473 | 1000000 / mired [INFO] [stdout] | --------------- division performed here [INFO] [stdout] | [INFO] [stdout] = help: consider using `checked_div` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_checked_ops [INFO] [stdout] = note: `#[warn(clippy::manual_checked_ops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual checked division [INFO] [stdout] --> src/service/hass.rs:478:8 [INFO] [stdout] | [INFO] [stdout] 478 | if kelvin == 0 { [INFO] [stdout] | ^^^^^^^^^^^ check performed here [INFO] [stdout] ... [INFO] [stdout] 481 | 1000000 / kelvin [INFO] [stdout] | ---------------- division performed here [INFO] [stdout] | [INFO] [stdout] = help: consider using `checked_div` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_checked_ops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: derefed type is same as origin [INFO] [stdout] --> src/service/device.rs:304:20 [INFO] [stdout] | [INFO] [stdout] 304 | if light_instance [INFO] [stdout] | ____________________^ [INFO] [stdout] 305 | | .as_deref() [INFO] [stdout] | |_______________________________^ help: try: `light_instance` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_option_as_deref [INFO] [stdout] = note: `#[warn(clippy::needless_option_as_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/service/device.rs:365:9 [INFO] [stdout] | [INFO] [stdout] 365 | candidates.sort_by(|a, b| a.updated.cmp(&b.updated)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 365 - candidates.sort_by(|a, b| a.updated.cmp(&b.updated)); [INFO] [stdout] 365 + candidates.sort_by_key(|a| a.updated); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/service/device.rs:442:9 [INFO] [stdout] | [INFO] [stdout] 442 | / match (device_type, self.sku.as_str()) { [INFO] [stdout] 443 | | (_, "H7160") => true, [INFO] [stdout] 444 | | (DeviceType::Light, _) => true, [INFO] [stdout] 445 | | _ => false, [INFO] [stdout] 446 | | } [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] 442 - match (device_type, self.sku.as_str()) { [INFO] [stdout] 443 - (_, "H7160") => true, [INFO] [stdout] 444 - (DeviceType::Light, _) => true, [INFO] [stdout] 445 - _ => false, [INFO] [stdout] 446 - } [INFO] [stdout] 442 + matches!((device_type, self.sku.as_str()), (_, "H7160") | (DeviceType::Light, _)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/hass.rs:577:33 [INFO] [stdout] | [INFO] [stdout] 577 | .register_with_hass(&state) [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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/service/device.rs:590:9 [INFO] [stdout] | [INFO] [stdout] 590 | / if let Some(info) = &self.undoc_device_info { [INFO] [stdout] 591 | | Some(info.entry.device_ext.device_settings.wifi_name.is_none()) [INFO] [stdout] 592 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 595 | | } [INFO] [stdout] | |_________^ help: try: `self.undoc_device_info.as_ref().map(|info| info.entry.device_ext.device_settings.wifi_name.is_none())` [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: match expression looks like `matches!` macro [INFO] [stdout] --> src/service/device.rs:599:9 [INFO] [stdout] | [INFO] [stdout] 599 | / match self.is_ble_only_device() { [INFO] [stdout] 600 | | Some(true) => false, [INFO] [stdout] 601 | | _ => true, [INFO] [stdout] 602 | | } [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] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 599 - match self.is_ble_only_device() { [INFO] [stdout] 600 - Some(true) => false, [INFO] [stdout] 601 - _ => true, [INFO] [stdout] 602 - } [INFO] [stdout] 599 + !matches!(self.is_ble_only_device(), Some(true)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/http.rs:45:37 [INFO] [stdout] | [INFO] [stdout] 45 | .resolve_device_for_control(&id) [INFO] [stdout] | ^^^ help: change this to: `id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/http.rs:51:36 [INFO] [stdout] | [INFO] [stdout] 51 | state.resolve_device_read_only(&id).await.map_err(not_found) [INFO] [stdout] | ^^^ help: change this to: `id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/http.rs:223:28 [INFO] [stdout] | [INFO] [stdout] 223 | iot.activate_one_click(&item).await.map_err(generic)?; [INFO] [stdout] | ^^^^^ help: change this to: `item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/hass.rs:374:41 [INFO] [stdout] | [INFO] [stdout] 374 | .set_segment_brightness(&info, segment, brightness) [INFO] [stdout] | ^^^^^ help: change this to: `info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/hass.rs:388:34 [INFO] [stdout] | [INFO] [stdout] 388 | .set_segment_rgb(&info, segment, color.r, color.g, color.b) [INFO] [stdout] | ^^^^^ help: change this to: `info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/hass.rs:431:28 [INFO] [stdout] | [INFO] [stdout] 431 | iot.activate_one_click(&item).await [INFO] [stdout] | ^^^^^ help: change this to: `item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual checked division [INFO] [stdout] --> src/service/hass.rs:470:8 [INFO] [stdout] | [INFO] [stdout] 470 | if mired == 0 { [INFO] [stdout] | ^^^^^^^^^^ check performed here [INFO] [stdout] ... [INFO] [stdout] 473 | 1000000 / mired [INFO] [stdout] | --------------- division performed here [INFO] [stdout] | [INFO] [stdout] = help: consider using `checked_div` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_checked_ops [INFO] [stdout] = note: `#[warn(clippy::manual_checked_ops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual checked division [INFO] [stdout] --> src/service/hass.rs:478:8 [INFO] [stdout] | [INFO] [stdout] 478 | if kelvin == 0 { [INFO] [stdout] | ^^^^^^^^^^^ check performed here [INFO] [stdout] ... [INFO] [stdout] 481 | 1000000 / kelvin [INFO] [stdout] | ---------------- division performed here [INFO] [stdout] | [INFO] [stdout] = help: consider using `checked_div` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_checked_ops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/hass.rs:577:33 [INFO] [stdout] | [INFO] [stdout] 577 | .register_with_hass(&state) [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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: using `clone` on type `NotifyHumidifierNightlightParams` which implements the `Copy` trait [INFO] [stdout] --> src/service/iot.rs:429:77 [INFO] [stdout] | [INFO] [stdout] 429 | ... device.set_nightlight_state(nl.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try removing the `clone` call: `nl` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/http.rs:45:37 [INFO] [stdout] | [INFO] [stdout] 45 | .resolve_device_for_control(&id) [INFO] [stdout] | ^^^ help: change this to: `id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/http.rs:51:36 [INFO] [stdout] | [INFO] [stdout] 51 | state.resolve_device_read_only(&id).await.map_err(not_found) [INFO] [stdout] | ^^^ help: change this to: `id` [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: methods called `from_*` usually take no `self` [INFO] [stdout] --> src/service/quirks.rs:15:45 [INFO] [stdout] | [INFO] [stdout] 15 | pub fn from_reading_to_relative_percent(&self, value: f64) -> f64 { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/http.rs:223:28 [INFO] [stdout] | [INFO] [stdout] 223 | iot.activate_one_click(&item).await.map_err(generic)?; [INFO] [stdout] | ^^^^^ help: change this to: `item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/service/state.rs:473:13 [INFO] [stdout] | [INFO] [stdout] 473 | device.nightlight_state.clone().unwrap_or_default().into(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `device.nightlight_state` [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 `NotifyHumidifierNightlightParams` which implements the `Copy` trait [INFO] [stdout] --> src/service/iot.rs:429:77 [INFO] [stdout] | [INFO] [stdout] 429 | ... device.set_nightlight_state(nl.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try removing the `clone` call: `nl` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/state.rs:683:56 [INFO] [stdout] | [INFO] [stdout] 683 | let Some(canonical_device) = self.device_by_id(&device_id).await else { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `device_id` [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: using `clone` on type `TemperatureValue` which implements the `Copy` trait [INFO] [stdout] --> src/temperature.rs:152:20 [INFO] [stdout] | [INFO] [stdout] 152 | return 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: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/temperature.rs:197:13 [INFO] [stdout] | [INFO] [stdout] 197 | let i = input [INFO] [stdout] | _____________^ [INFO] [stdout] 198 | | .find(|c: char| !c.is_numeric() && c != '.') [INFO] [stdout] 199 | | .unwrap_or_else(|| input.len()); [INFO] [stdout] | |_______________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 199 - .unwrap_or_else(|| input.len()); [INFO] [stdout] 199 + .unwrap_or(input.len()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `from_*` usually take no `self` [INFO] [stdout] --> src/service/quirks.rs:15:45 [INFO] [stdout] | [INFO] [stdout] 15 | pub fn from_reading_to_relative_percent(&self, value: f64) -> f64 { [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: accessing first element with `s.light_effects.get(0)` [INFO] [stdout] --> src/undoc_api.rs:387:41 [INFO] [stdout] | [INFO] [stdout] 387 | if let Some(param_id) = s.light_effects.get(0).map(|e| e.scence_param_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `s.light_effects.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/service/state.rs:473:13 [INFO] [stdout] | [INFO] [stdout] 473 | device.nightlight_state.clone().unwrap_or_default().into(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `device.nightlight_state` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/service/state.rs:683:56 [INFO] [stdout] | [INFO] [stdout] 683 | let Some(canonical_device) = self.device_by_id(&device_id).await else { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `device_id` [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: using `clone` on type `TemperatureValue` which implements the `Copy` trait [INFO] [stdout] --> src/temperature.rs:152:20 [INFO] [stdout] | [INFO] [stdout] 152 | return 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: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/temperature.rs:197:13 [INFO] [stdout] | [INFO] [stdout] 197 | let i = input [INFO] [stdout] | _____________^ [INFO] [stdout] 198 | | .find(|c: char| !c.is_numeric() && c != '.') [INFO] [stdout] 199 | | .unwrap_or_else(|| input.len()); [INFO] [stdout] | |_______________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 199 - .unwrap_or_else(|| input.len()); [INFO] [stdout] 199 + .unwrap_or(input.len()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `s.light_effects.get(0)` [INFO] [stdout] --> src/undoc_api.rs:387:41 [INFO] [stdout] | [INFO] [stdout] 387 | if let Some(param_id) = s.light_effects.get(0).map(|e| e.scence_param_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `s.light_effects.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 3m 39s [INFO] running `Command { std: "docker" "inspect" "fee2a31471d7b99a28c70ac777f7f6dbfe48ed56e3a142e51660a1dc0645f388", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "fee2a31471d7b99a28c70ac777f7f6dbfe48ed56e3a142e51660a1dc0645f388", kill_on_drop: false }` [INFO] [stdout] fee2a31471d7b99a28c70ac777f7f6dbfe48ed56e3a142e51660a1dc0645f388