[INFO] cloning repository https://github.com/mkdir700/uniclipboard [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mkdir700/uniclipboard" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmkdir700%2Funiclipboard", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmkdir700%2Funiclipboard'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] eabe82c88d87135fb708eb1aecd514c17ff8f597 [INFO] linting mkdir700/uniclipboard against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmkdir700%2Funiclipboard" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] removed /workspace/builds/worker-4-tc1/source/.cargo/config.toml [INFO] started tweaking git repo https://github.com/mkdir700/uniclipboard [INFO] finished tweaking git repo https://github.com/mkdir700/uniclipboard [INFO] tweaked toml for git repo https://github.com/mkdir700/uniclipboard written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/mkdir700/uniclipboard 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/mkdir700/uniclipboard 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] Downloading crates ... [INFO] [stderr] Downloaded addr2line v0.24.1 [INFO] [stderr] Downloaded reqwest_dav v0.1.13 [INFO] [stderr] Downloaded ctor v0.2.8 [INFO] [stderr] Downloaded readkey v0.2.1 [INFO] [stderr] Downloaded macos-accessibility-client v0.0.1 [INFO] [stderr] Downloaded console v0.15.8 [INFO] [stderr] Downloaded clipboard-rs v0.2.1 [INFO] [stderr] Downloaded clap v4.5.17 [INFO] [stderr] Downloaded cc v1.1.18 [INFO] [stderr] Downloaded png v0.17.14 [INFO] [stderr] Downloaded libfuzzer-sys v0.4.7 [INFO] [stderr] Downloaded clap_builder v4.5.17 [INFO] [stderr] Downloaded scc v2.1.17 [INFO] [stderr] Downloaded gimli v0.31.0 [INFO] [stderr] Downloaded flate2 v1.0.33 [INFO] [stderr] Downloaded diesel_derives v2.2.3 [INFO] [stderr] Downloaded image v0.25.2 [INFO] [stderr] Downloaded xkbcommon v0.7.0 [INFO] [stderr] Downloaded enigo v0.2.1 [INFO] [stderr] Downloaded bytemuck v1.18.0 [INFO] [stderr] Downloaded imgref v1.10.1 [INFO] [stderr] Downloaded diesel v2.2.4 [INFO] [stderr] Downloaded bitstream-io v2.5.3 [INFO] [stderr] Downloaded rustix v0.38.36 [INFO] [stderr] Downloaded neli v0.6.4 [INFO] [stderr] Downloaded schannel v0.1.24 [INFO] [stderr] Downloaded windows-core v0.56.0 [INFO] [stderr] Downloaded av1-grain v0.2.3 [INFO] [stderr] Downloaded built v0.7.4 [INFO] [stderr] Downloaded mockall_derive v0.11.4 [INFO] [stderr] Downloaded mockall v0.11.4 [INFO] [stderr] Downloaded mockito v0.31.1 [INFO] [stderr] Downloaded async-trait v0.1.82 [INFO] [stderr] Downloaded ipnet v2.10.0 [INFO] [stderr] Downloaded device_query v2.1.0 [INFO] [stderr] Downloaded migrations_macros v2.2.0 [INFO] [stderr] Downloaded memmap2 v0.8.0 [INFO] [stderr] Downloaded arbitrary v1.3.2 [INFO] [stderr] Downloaded ravif v0.11.10 [INFO] [stderr] Downloaded neli-proc-macros v0.1.3 [INFO] [stderr] Downloaded local-ip-address v0.6.3 [INFO] [stderr] Downloaded predicates v2.1.5 [INFO] [stderr] Downloaded predicates-tree v1.0.11 [INFO] [stderr] Downloaded readmouse v0.2.1 [INFO] [stderr] Downloaded dsl_auto_type v0.1.2 [INFO] [stderr] Downloaded scheduled-thread-pool v0.2.7 [INFO] [stderr] Downloaded migrations_internals v2.2.0 [INFO] [stderr] Downloaded diesel_migrations v2.2.0 [INFO] [stderr] Downloaded windows-implement v0.56.0 [INFO] [stderr] Downloaded windows-interface v0.56.0 [INFO] [stderr] Downloaded is-terminal v0.4.13 [INFO] [stderr] Downloaded profiling-procmacros v1.0.15 [INFO] [stderr] Downloaded v_frame v0.3.8 [INFO] [stderr] Downloaded predicates-core v1.0.8 [INFO] [stderr] Downloaded digest_auth v0.3.1 [INFO] [stderr] Downloaded sdd v3.0.3 [INFO] [stderr] Downloaded serial_test v3.1.1 [INFO] [stderr] Downloaded diesel_table_macro_syntax v0.2.0 [INFO] [stderr] Downloaded avif-serialize v0.8.1 [INFO] [stderr] Downloaded serial_test_derive v3.1.1 [INFO] [stderr] Downloaded uuid-macro-internal v1.10.0 [INFO] [stderr] Downloaded icrate v0.1.2 [INFO] [stderr] Downloaded openssl-src v300.3.2+3.3.2 [INFO] [stderr] Downloaded windows v0.56.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 1164c199a521b92537512dc651f8dadd9f794fd572d4b0c83dc614c639eae5c6 [INFO] running `Command { std: "docker" "start" "-a" "1164c199a521b92537512dc651f8dadd9f794fd572d4b0c83dc614c639eae5c6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "1164c199a521b92537512dc651f8dadd9f794fd572d4b0c83dc614c639eae5c6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1164c199a521b92537512dc651f8dadd9f794fd572d4b0c83dc614c639eae5c6", kill_on_drop: false }` [INFO] [stdout] 1164c199a521b92537512dc651f8dadd9f794fd572d4b0c83dc614c639eae5c6 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 897889cb3953c6728991201813aa3d423c218f60290214447c5a792576cfef94 [INFO] running `Command { std: "docker" "start" "-a" "897889cb3953c6728991201813aa3d423c218f60290214447c5a792576cfef94", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.86 [INFO] [stderr] Checking log v0.4.22 [INFO] [stderr] Compiling serde v1.0.210 [INFO] [stderr] Checking futures-channel v0.3.30 [INFO] [stderr] Compiling cc v1.1.18 [INFO] [stderr] Compiling thiserror v1.0.63 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Checking cpufeatures v0.2.14 [INFO] [stderr] Checking num-integer v0.1.46 [INFO] [stderr] Compiling anyhow v1.0.89 [INFO] [stderr] Checking spin v0.9.8 [INFO] [stderr] Compiling paste v1.0.15 [INFO] [stderr] Checking arrayvec v0.7.6 [INFO] [stderr] Checking adler2 v2.0.0 [INFO] [stderr] Compiling built v0.7.4 [INFO] [stderr] Compiling either v1.13.0 [INFO] [stderr] Checking aligned-vec v0.5.0 [INFO] [stderr] Compiling rustix v0.38.36 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Checking v_frame v0.3.8 [INFO] [stderr] Checking miniz_oxide v0.8.0 [INFO] [stderr] Checking nom v7.1.3 [INFO] [stderr] Compiling unicase v2.7.0 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking tracing v0.1.40 [INFO] [stderr] Checking crypto-common v0.1.6 [INFO] [stderr] Compiling serde_json v1.0.128 [INFO] [stderr] Checking regex-syntax v0.8.4 [INFO] [stderr] Checking bytemuck v1.18.0 [INFO] [stderr] Checking linux-raw-sys v0.4.14 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Compiling hashbrown v0.14.5 [INFO] [stderr] Checking num-bigint v0.4.6 [INFO] [stderr] Compiling equivalent v1.0.1 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Checking maybe-rayon v0.1.1 [INFO] [stderr] Compiling winnow v0.6.18 [INFO] [stderr] Compiling rav1e v0.7.1 [INFO] [stderr] Checking bitstream-io v2.5.3 [INFO] [stderr] Checking new_debug_unreachable v1.0.6 [INFO] [stderr] Checking imgref v1.10.1 [INFO] [stderr] Checking flate2 v1.0.33 [INFO] [stderr] Checking data-encoding v2.6.0 [INFO] [stderr] Compiling noop_proc_macro v0.3.0 [INFO] [stderr] Checking quick-error v2.0.1 [INFO] [stderr] Checking loop9 v0.1.5 [INFO] [stderr] Checking miniz_oxide v0.7.4 [INFO] [stderr] Checking rgb v0.8.50 [INFO] [stderr] Checking avif-serialize v0.8.1 [INFO] [stderr] Checking flume v0.11.0 [INFO] [stderr] Checking zune-inflate v0.2.54 [INFO] [stderr] Compiling indexmap v2.5.0 [INFO] [stderr] Checking inout v0.1.3 [INFO] [stderr] Checking half v2.4.1 [INFO] [stderr] Checking zune-core v0.4.12 [INFO] [stderr] Checking jpeg-decoder v0.3.1 [INFO] [stderr] Checking byteorder-lite v0.1.0 [INFO] [stderr] Checking lebe v0.5.2 [INFO] [stderr] Checking bit_field v0.10.2 [INFO] [stderr] Compiling quote v1.0.37 [INFO] [stderr] Checking gif v0.13.1 [INFO] [stderr] Compiling mime_guess v2.0.5 [INFO] [stderr] Checking tiff v0.9.1 [INFO] [stderr] Compiling syn v2.0.77 [INFO] [stderr] Checking image-webp v0.1.3 [INFO] [stderr] Checking exr v1.72.0 [INFO] [stderr] Checking zune-jpeg v0.4.13 [INFO] [stderr] Compiling openssl-sys v0.9.103 [INFO] [stderr] Compiling simd_helpers v0.1.0 [INFO] [stderr] Compiling libsqlite3-sys v0.30.1 [INFO] [stderr] Checking num-rational v0.4.2 [INFO] [stderr] Checking png v0.17.14 [INFO] [stderr] Compiling openssl v0.10.66 [INFO] [stderr] Compiling native-tls v0.2.12 [INFO] [stderr] Checking cipher v0.4.4 [INFO] [stderr] Checking universal-hash v0.5.1 [INFO] [stderr] Checking qoi v0.4.1 [INFO] [stderr] Checking rayon v1.10.0 [INFO] [stderr] Checking scheduled-thread-pool v0.2.7 [INFO] [stderr] Compiling x11 v2.21.0 [INFO] [stderr] Compiling multer v2.1.0 [INFO] [stderr] Checking opaque-debug v0.3.1 [INFO] [stderr] Checking x11rb-protocol v0.13.1 [INFO] [stderr] Checking av1-grain v0.2.3 [INFO] [stderr] Checking polyval v0.6.2 [INFO] [stderr] Checking regex-automata v0.4.7 [INFO] [stderr] Checking r2d2 v0.8.10 [INFO] [stderr] Checking md-5 v0.10.6 [INFO] [stderr] Checking sha2 v0.10.8 [INFO] [stderr] Checking headers-core v0.2.0 [INFO] [stderr] Compiling device_query v2.1.0 [INFO] [stderr] Checking unicode-width v0.1.13 [INFO] [stderr] Checking xml-rs v0.8.21 [INFO] [stderr] Checking ipnet v2.10.0 [INFO] [stderr] Checking headers v0.3.9 [INFO] [stderr] Checking console v0.15.8 [INFO] [stderr] Checking dirs-sys v0.4.1 [INFO] [stderr] Checking clap_builder v4.5.17 [INFO] [stderr] Checking ghash v0.5.1 [INFO] [stderr] Checking ctr v0.9.2 [INFO] [stderr] Checking aes v0.8.4 [INFO] [stderr] Checking aead v0.5.2 [INFO] [stderr] Checking is-terminal v0.4.13 [INFO] [stderr] Checking humantime v2.1.0 [INFO] [stderr] Checking predicates-core v1.0.8 [INFO] [stderr] Checking dirs v5.0.1 [INFO] [stderr] Checking itertools v0.10.5 [INFO] [stderr] Checking float-cmp v0.9.0 [INFO] [stderr] Checking memmap2 v0.8.0 [INFO] [stderr] Checking xkeysym v0.2.1 [INFO] [stderr] Checking termtree v0.4.1 [INFO] [stderr] Compiling cfg-if v1.0.0 [INFO] [stderr] Checking sdd v3.0.3 [INFO] [stderr] Checking predicates-tree v1.0.11 [INFO] [stderr] Checking colored v2.1.0 [INFO] [stderr] Checking fragile v2.0.0 [INFO] [stderr] Checking scc v2.1.17 [INFO] [stderr] Checking downcast v0.11.0 [INFO] [stderr] Checking aes-gcm v0.10.3 [INFO] [stderr] Checking dotenv v0.15.0 [INFO] [stderr] Checking tempfile v3.12.0 [INFO] [stderr] Checking xkbcommon v0.7.0 [INFO] [stderr] Checking enigo v0.2.1 [INFO] [stderr] Checking dialoguer v0.10.4 [INFO] [stderr] Checking regex v1.10.6 [INFO] [stderr] Checking env_logger v0.10.2 [INFO] [stderr] Checking predicates v2.1.5 [INFO] [stderr] Compiling mockall_derive v0.11.4 [INFO] [stderr] Compiling darling_core v0.20.10 [INFO] [stderr] Compiling diesel_table_macro_syntax v0.2.0 [INFO] [stderr] Compiling serde_derive v1.0.210 [INFO] [stderr] Compiling futures-macro v0.3.30 [INFO] [stderr] Compiling tokio-macros v2.4.0 [INFO] [stderr] Compiling zerocopy-derive v0.7.35 [INFO] [stderr] Compiling thiserror-impl v1.0.63 [INFO] [stderr] Compiling pin-project-internal v1.1.5 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling profiling-procmacros v1.0.15 [INFO] [stderr] Compiling arg_enum_proc_macro v0.3.4 [INFO] [stderr] Compiling num-derive v0.4.2 [INFO] [stderr] Compiling uuid-macro-internal v1.10.0 [INFO] [stderr] Compiling async-trait v0.1.82 [INFO] [stderr] Checking profiling v1.0.15 [INFO] [stderr] Compiling clap_derive v4.5.13 [INFO] [stderr] Compiling serial_test_derive v3.1.1 [INFO] [stderr] Compiling ctor v0.2.8 [INFO] [stderr] Checking futures-util v0.3.30 [INFO] [stderr] Checking tokio v1.40.0 [INFO] [stderr] Checking zerocopy v0.7.35 [INFO] [stderr] Checking x11rb v0.13.1 [INFO] [stderr] Checking pin-project v1.1.5 [INFO] [stderr] Checking ppv-lite86 v0.2.20 [INFO] [stderr] Checking mockall v0.11.4 [INFO] [stderr] Compiling darling_macro v0.20.10 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Compiling darling v0.20.10 [INFO] [stderr] Compiling dsl_auto_type v0.1.2 [INFO] [stderr] Checking clap v4.5.17 [INFO] [stderr] Compiling diesel_derives v2.2.3 [INFO] [stderr] Checking tungstenite v0.21.0 [INFO] [stderr] Checking tungstenite v0.19.0 [INFO] [stderr] Checking digest_auth v0.3.1 [INFO] [stderr] Checking twox-hash v1.6.3 [INFO] [stderr] Checking uuid v1.10.0 [INFO] [stderr] Checking http-body-util v0.1.2 [INFO] [stderr] Checking futures-executor v0.3.30 [INFO] [stderr] Checking futures v0.3.30 [INFO] [stderr] Checking serial_test v3.1.1 [INFO] [stderr] Checking tokio-util v0.7.12 [INFO] [stderr] Checking tower v0.4.13 [INFO] [stderr] Checking tokio-native-tls v0.3.1 [INFO] [stderr] Checking tokio-tungstenite v0.21.0 [INFO] [stderr] Checking tokio-stream v0.1.16 [INFO] [stderr] Checking tokio-tungstenite v0.19.0 [INFO] [stderr] Checking h2 v0.4.6 [INFO] [stderr] Checking h2 v0.3.26 [INFO] [stderr] Checking ravif v0.11.10 [INFO] [stderr] Checking image v0.25.2 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking serde_spanned v0.6.7 [INFO] [stderr] Checking toml_datetime v0.6.8 [INFO] [stderr] Checking chrono v0.4.38 [INFO] [stderr] Checking serde-xml-rs v0.6.0 [INFO] [stderr] Checking toml_edit v0.22.20 [INFO] [stderr] Checking diesel v2.2.4 [INFO] [stderr] Compiling neli-proc-macros v0.1.3 [INFO] [stderr] Checking assert-json-diff v2.0.2 [INFO] [stderr] Checking mockito v0.31.1 [INFO] [stderr] Checking neli v0.6.4 [INFO] [stderr] Checking toml v0.8.19 [INFO] [stderr] Checking clipboard-rs v0.2.1 [INFO] [stderr] Checking arboard v3.4.1 [INFO] [stderr] Checking migrations_internals v2.2.0 [INFO] [stderr] Checking local-ip-address v0.6.3 [INFO] [stderr] Compiling migrations_macros v2.2.0 [INFO] [stderr] Checking hyper v1.4.1 [INFO] [stderr] Checking hyper v0.14.30 [INFO] [stderr] Checking hyper-util v0.1.7 [INFO] [stderr] Checking hyper-tls v0.6.0 [INFO] [stderr] Checking reqwest v0.12.7 [INFO] [stderr] Checking reqwest_dav v0.1.13 [INFO] [stderr] Checking warp v0.3.7 [INFO] [stderr] Checking diesel_migrations v2.2.0 [INFO] [stderr] Checking uniclipboard v0.1.2-beta.3 (/opt/rustwide/workdir) [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/connection.rs:621:5 [INFO] [stdout] | [INFO] [stdout] 621 | / /// to the identifier of a device. [INFO] [stdout] ... | [INFO] [stdout] 630 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 634 | pub async fn remove_connection(&self, id: MessageSource) { [INFO] [stdout] | ------------------------------ the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the doc comment should not document function `remove_connection` then comment it out [INFO] [stdout] | [INFO] [stdout] 616 ~ // /// The `disconnect` function in Rust asynchronously disconnects a device based on its ID. [INFO] [stdout] 617 ~ // /// [INFO] [stdout] 618 ~ // /// Arguments: [INFO] [stdout] 619 ~ // /// [INFO] [stdout] 620 ~ // /// * `id`: The `id` parameter in the `disconnect` function is of type `DeviceId`, which is a reference [INFO] [stdout] 621 ~ // /// to the identifier of a device. [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `used_linker` [INFO] [stdout] --> src/device.rs:355:5 [INFO] [stdout] | [INFO] [stdout] 355 | #[ctor::ctor] [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: expected values for `feature` are: `hardware_tests`, `integration_tests`, `network_tests`, `testing`, and `vendored_openssl` [INFO] [stdout] = note: using a cfg inside a attribute macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `ctor::ctor` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the attribute macro `ctor::ctor` may come from an old version of the `ctor` crate, try updating your dependency with `cargo update -p ctor` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: `#[warn(unexpected_cfgs)]` on by default [INFO] [stdout] = note: this warning originates in the attribute macro `ctor::ctor` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `used_linker` [INFO] [stdout] --> src/uni_clipboard.rs:378:5 [INFO] [stdout] | [INFO] [stdout] 378 | #[ctor::ctor] [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: expected values for `feature` are: `hardware_tests`, `integration_tests`, `network_tests`, `testing`, and `vendored_openssl` [INFO] [stdout] = note: using a cfg inside a attribute macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `ctor::ctor` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the attribute macro `ctor::ctor` may come from an old version of the `ctor` crate, try updating your dependency with `cargo update -p ctor` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the attribute macro `ctor::ctor` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/connection.rs:621:5 [INFO] [stdout] | [INFO] [stdout] 621 | / /// to the identifier of a device. [INFO] [stdout] ... | [INFO] [stdout] 630 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 634 | pub async fn remove_connection(&self, id: MessageSource) { [INFO] [stdout] | ------------------------------ the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the doc comment should not document function `remove_connection` then comment it out [INFO] [stdout] | [INFO] [stdout] 616 ~ // /// The `disconnect` function in Rust asynchronously disconnects a device based on its ID. [INFO] [stdout] 617 ~ // /// [INFO] [stdout] 618 ~ // /// Arguments: [INFO] [stdout] 619 ~ // /// [INFO] [stdout] 620 ~ // /// * `id`: The `id` parameter in the `disconnect` function is of type `DeviceId`, which is a reference [INFO] [stdout] 621 ~ // /// to the identifier of a device. [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `#[ignore]` attribute cannot be used on inherent methods [INFO] [stdout] --> src/uni_clipboard.rs:51:52 [INFO] [stdout] | [INFO] [stdout] 51 | #[cfg_attr(not(feature = "integration_tests"), ignore)] [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! [INFO] [stdout] = help: `#[ignore]` can only be applied to functions [INFO] [stdout] = note: `#[warn(unused_attributes)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `#[ignore]` attribute cannot be used on inherent methods [INFO] [stdout] --> src/uni_clipboard.rs:56:52 [INFO] [stdout] | [INFO] [stdout] 56 | #[cfg_attr(not(feature = "integration_tests"), ignore)] [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! [INFO] [stdout] = help: `#[ignore]` can only be applied to functions [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `#[ignore]` attribute cannot be used on inherent methods [INFO] [stdout] --> src/uni_clipboard.rs:51:52 [INFO] [stdout] | [INFO] [stdout] 51 | #[cfg_attr(not(feature = "integration_tests"), ignore)] [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! [INFO] [stdout] = help: `#[ignore]` can only be applied to functions [INFO] [stdout] = note: `#[warn(unused_attributes)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `#[ignore]` attribute cannot be used on inherent methods [INFO] [stdout] --> src/uni_clipboard.rs:56:52 [INFO] [stdout] | [INFO] [stdout] 56 | #[cfg_attr(not(feature = "integration_tests"), ignore)] [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! [INFO] [stdout] = help: `#[ignore]` can only be applied to functions [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/clipboard/mod.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod clipboard; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_vec` [INFO] [stdout] --> src/clipboard/clipboard.rs:118:74 [INFO] [stdout] | [INFO] [stdout] 118 | let image_data = RustImageData::from_bytes(&image.content.to_vec()) [INFO] [stdout] | ^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/clipboard/local.rs:118:17 [INFO] [stdout] | [INFO] [stdout] 118 | / if now.duration_since(last_write) < self_clone.write_cooldown { [INFO] [stdout] 119 | | if self_clone.is_self_write.load(Ordering::SeqCst) { [INFO] [stdout] 120 | | info!("Skip clipboard change event because of self write"); [INFO] [stdout] 121 | | self_clone.is_self_write.store(false, Ordering::SeqCst); [INFO] [stdout] ... | [INFO] [stdout] 124 | | } [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] 118 ~ if now.duration_since(last_write) < self_clone.write_cooldown [INFO] [stdout] 119 ~ && self_clone.is_self_write.load(Ordering::SeqCst) { [INFO] [stdout] 120 | info!("Skip clipboard change event because of self write"); [INFO] [stdout] 121 | self_clone.is_self_write.store(false, Ordering::SeqCst); [INFO] [stdout] 122 | continue; [INFO] [stdout] 123 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/config.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / pub fn default() -> Self { [INFO] [stdout] 37 | | Self { [INFO] [stdout] 38 | | device_id: generate_device_id(), [INFO] [stdout] 39 | | device_name: Some("未命名设备".to_string()), [INFO] [stdout] ... | [INFO] [stdout] 58 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/config.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | if let Some(config_str) = fs::read_to_string(&_config_path).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(config_str)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 95 - if let Some(config_str) = fs::read_to_string(&_config_path).ok() { [INFO] [stdout] 95 + if let Ok(config_str) = fs::read_to_string(&_config_path) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern takes a reference on something that is being dereferenced [INFO] [stdout] --> src/connection.rs:102:27 [INFO] [stdout] | [INFO] [stdout] 102 | .filter(|(&ref client_id, _)| { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&ref` part [INFO] [stdout] | [INFO] [stdout] 102 - .filter(|(&ref client_id, _)| { [INFO] [stdout] 102 + .filter(|(client_id, _)| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/connection.rs:137:18 [INFO] [stdout] | [INFO] [stdout] 137 | connections: Arc< [INFO] [stdout] | __________________^ [INFO] [stdout] 138 | | RwLock< [INFO] [stdout] 139 | | HashMap< [INFO] [stdout] 140 | | DeviceId, [INFO] [stdout] ... | [INFO] [stdout] 148 | | >, [INFO] [stdout] 149 | | >, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ConnectionManager` [INFO] [stdout] --> src/connection.rs:357:5 [INFO] [stdout] | [INFO] [stdout] 357 | / pub fn new() -> Self { [INFO] [stdout] 358 | | let (clipboard_message_sync_sender, _) = broadcast::channel(100); [INFO] [stdout] 359 | | Self { [INFO] [stdout] 360 | | incoming: IncomingConnectionManager::new(), [INFO] [stdout] ... | [INFO] [stdout] 367 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 356 + impl Default for ConnectionManager { [INFO] [stdout] 357 + fn default() -> Self { [INFO] [stdout] 358 + Self::new() [INFO] [stdout] 359 + } [INFO] [stdout] 360 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/connection.rs:439:13 [INFO] [stdout] | [INFO] [stdout] 439 | let config = CONFIG [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/connection.rs:457:22 [INFO] [stdout] | [INFO] [stdout] 457 | .await [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 494 | let results = join_all(connection_futures).await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 516 | *self.listen_new_devices_handle.write().await = Some(self.listen_new_devices().await); [INFO] [stdout] | ^^^^^ ^^^^^ [INFO] [stdout] 517 | // 尝试连接离线的设备 [INFO] [stdout] 518 | *self.try_connect_offline_devices_handle.write().await = [INFO] [stdout] | ^^^^^ [INFO] [stdout] 519 | Some(self.try_connect_offline_devices().await); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] = note: `#[warn(clippy::await_holding_lock)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/connection.rs:443:32 [INFO] [stdout] | [INFO] [stdout] 443 | let peer_device_port = config.peer_device_port.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `config.peer_device_port` [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: doc list item without indentation [INFO] [stdout] --> src/connection.rs:621:9 [INFO] [stdout] | [INFO] [stdout] 621 | /// to the identifier of a device. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] = note: `#[warn(clippy::doc_lazy_continuation)]` on by default [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 621 | /// to the identifier of a device. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/connection.rs:631:9 [INFO] [stdout] | [INFO] [stdout] 631 | /// 断开指定设备并移除连接 [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 631 | /// 断开指定设备并移除连接 [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/db/mod.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod db; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/device.rs:81:67 [INFO] [stdout] | [INFO] [stdout] 81 | pub static GLOBAL_DEVICE_MANAGER: Lazy = Lazy::new(|| DeviceManager::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DeviceManager::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/device.rs:130:13 [INFO] [stdout] | [INFO] [stdout] 130 | self.port.clone().unwrap_or_default(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.port` [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 `Option` which implements the `Copy` trait [INFO] [stdout] --> src/device.rs:131:13 [INFO] [stdout] | [INFO] [stdout] 131 | self.server_port.clone().unwrap_or_default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.server_port` [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 `DeviceStatus` which implements the `Copy` trait [INFO] [stdout] --> src/device.rs:144:21 [INFO] [stdout] | [INFO] [stdout] 144 | status: device.status.clone() as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `device.status` [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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/device.rs:146:25 [INFO] [stdout] | [INFO] [stdout] 146 | updated_at: device.updated_at.unwrap_or(0) as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `device.updated_at.unwrap_or(0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `DeviceManager` [INFO] [stdout] --> src/device.rs:182:5 [INFO] [stdout] | [INFO] [stdout] 182 | / pub fn new() -> Self { [INFO] [stdout] 183 | | Self {} [INFO] [stdout] 184 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 181 + impl Default for DeviceManager { [INFO] [stdout] 182 + fn default() -> Self { [INFO] [stdout] 183 + Self::new() [INFO] [stdout] 184 + } [INFO] [stdout] 185 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/device.rs:231:34 [INFO] [stdout] | [INFO] [stdout] 231 | pub fn merge(&self, devices: &Vec) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 231 - pub fn merge(&self, devices: &Vec) -> Result<()> { [INFO] [stdout] 231 + pub fn merge(&self, devices: &[Device]) -> Result<()> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/device.rs:242:18 [INFO] [stdout] | [INFO] [stdout] 242 | .map(|d| DbDevice::from(d)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DbDevice::from` [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: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/device.rs:305:9 [INFO] [stdout] | [INFO] [stdout] 305 | Ok(dao::device::is_exist(&mut conn, device_id)?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 305 - Ok(dao::device::is_exist(&mut conn, device_id)?) [INFO] [stdout] 305 + dao::device::is_exist(&mut conn, device_id) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip(..).next()` on an iterator [INFO] [stdout] --> src/file_metadata.rs:60:23 [INFO] [stdout] | [INFO] [stdout] 60 | url.split('/') [INFO] [stdout] | _______________________^ [INFO] [stdout] 61 | | .skip(3) // 跳过 "https:" 和两个空字符串 [INFO] [stdout] 62 | | .next() [INFO] [stdout] | |___________________^ help: use `nth` instead: `.nth(3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next [INFO] [stdout] = note: `#[warn(clippy::iter_skip_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/key_mouse_monitor.rs:20:21 [INFO] [stdout] | [INFO] [stdout] 20 | state_receiver: Arc)>>>, [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: method `eq` can be confused for the standard trait method `std::cmp::PartialEq::eq` [INFO] [stdout] --> src/message.rs:188:5 [INFO] [stdout] | [INFO] [stdout] 188 | / pub fn eq(&self, other: &Payload) -> bool { [INFO] [stdout] 189 | | self.get_key() == other.get_key() [INFO] [stdout] 190 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::cmp::PartialEq` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/network/webdav.rs:82:9 [INFO] [stdout] | [INFO] [stdout] 82 | let path: String; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `path` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 82 ~ [INFO] [stdout] 83 ~ let path: String = if dir == "/" { [INFO] [stdout] 84 ~ format!("/{}", filename) [INFO] [stdout] 85 | } else { [INFO] [stdout] 86 ~ format!("{}/{}", dir, filename) [INFO] [stdout] 87 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/network/webdav.rs:89:56 [INFO] [stdout] | [INFO] [stdout] 89 | let encrypted_payload = self.encryptor.encrypt(&json_payload.as_bytes())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json_payload.as_bytes()` [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/network/webdav.rs:190:49 [INFO] [stdout] | [INFO] [stdout] 190 | let meta = FileMetadata::from_list_file(&list_file, &self.client.host); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `list_file` [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/network/webdav.rs:220:49 [INFO] [stdout] | [INFO] [stdout] 220 | let meta = FileMetadata::from_list_file(&list_file, &self.client.host); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `list_file` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/network/websocket.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | writer: Arc< [INFO] [stdout] | _____________^ [INFO] [stdout] 34 | | Option< [INFO] [stdout] 35 | | Mutex< [INFO] [stdout] 36 | | futures_util::stream::SplitSink< [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#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/network/websocket.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | reader: Arc< [INFO] [stdout] | _____________^ [INFO] [stdout] 45 | | Option< [INFO] [stdout] 46 | | Mutex>>>, [INFO] [stdout] 47 | | >, [INFO] [stdout] 48 | | >, [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/network/websocket.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | / match message { [INFO] [stdout] 190 | | Message::Text(text) => { [INFO] [stdout] 191 | | let web_socket_message: WebSocketMessage = serde_json::from_str(&text)?; [INFO] [stdout] 192 | | if let WebSocketMessage::ClipboardSync(data) = web_socket_message { [INFO] [stdout] ... | [INFO] [stdout] 196 | | _ => {} [INFO] [stdout] 197 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 189 ~ if let Message::Text(text) = message { [INFO] [stdout] 190 + let web_socket_message: WebSocketMessage = serde_json::from_str(&text)?; [INFO] [stdout] 191 + if let WebSocketMessage::ClipboardSync(data) = web_socket_message { [INFO] [stdout] 192 + return Ok(Some(data)); [INFO] [stdout] 193 + } [INFO] [stdout] 194 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/network/websocket.rs:337:41 [INFO] [stdout] | [INFO] [stdout] 337 | devices: devices.iter().map(|d| DeviceSyncInfo::from(d)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DeviceSyncInfo::from` [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: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/network/websocket.rs:356:17 [INFO] [stdout] | [INFO] [stdout] 356 | / if let Message::Pong(msg) = msg { [INFO] [stdout] 357 | | trace!("Ping pong result: {:?}", msg); [INFO] [stdout] 358 | | return msg == rand_bytes_clone; [INFO] [stdout] 359 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/network/websocket.rs:355:23 [INFO] [stdout] | [INFO] [stdout] 355 | if let Ok(msg) = rx.recv().await { [INFO] [stdout] | ^^^ replace this binding [INFO] [stdout] 356 | if let Message::Pong(msg) = msg { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/remote_sync/webdav_sync.rs:30:25 [INFO] [stdout] | [INFO] [stdout] 30 | let base_path = format!("/uniclipboard"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/uniclipboard".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `RemoteSyncManager` [INFO] [stdout] --> src/remote_sync/manager.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | / pub fn new() -> Self { [INFO] [stdout] 15 | | RemoteSyncManager { [INFO] [stdout] 16 | | sync_handler: Arc::new(RwLock::new(None)), [INFO] [stdout] 17 | | } [INFO] [stdout] 18 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 13 + impl Default for RemoteSyncManager { [INFO] [stdout] 14 + fn default() -> Self { [INFO] [stdout] 15 + Self::new() [INFO] [stdout] 16 + } [INFO] [stdout] 17 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `UniClipboardBuilder` [INFO] [stdout] --> src/uni_clipboard.rs:295:5 [INFO] [stdout] | [INFO] [stdout] 295 | / pub fn new() -> Self { [INFO] [stdout] 296 | | Self { [INFO] [stdout] 297 | | webserver: None, [INFO] [stdout] 298 | | clipboard: None, [INFO] [stdout] ... | [INFO] [stdout] 303 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 294 + impl Default for UniClipboardBuilder { [INFO] [stdout] 295 + fn default() -> Self { [INFO] [stdout] 296 + Self::new() [INFO] [stdout] 297 + } [INFO] [stdout] 298 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `if let` [INFO] [stdout] --> src/web/handlers/websocket_message.rs:38:21 [INFO] [stdout] | [INFO] [stdout] 38 | / match message { [INFO] [stdout] 39 | | TungsteniteMessage::Text(text) => { [INFO] [stdout] 40 | | self_clone [INFO] [stdout] 41 | | .handle_message( [INFO] [stdout] ... | [INFO] [stdout] 47 | | _ => {} [INFO] [stdout] 48 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/web/handlers/websocket_message.rs:37:39 [INFO] [stdout] | [INFO] [stdout] 37 | if let Ok((device_id, message)) = message { [INFO] [stdout] | ^^^^^^^ replace this binding [INFO] [stdout] 38 | match message { [INFO] [stdout] 39 | TungsteniteMessage::Text(text) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/web/handlers/websocket_message.rs:38:21 [INFO] [stdout] | [INFO] [stdout] 38 | / match message { [INFO] [stdout] 39 | | TungsteniteMessage::Text(text) => { [INFO] [stdout] 40 | | self_clone [INFO] [stdout] 41 | | .handle_message( [INFO] [stdout] ... | [INFO] [stdout] 47 | | _ => {} [INFO] [stdout] 48 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 38 ~ if let TungsteniteMessage::Text(text) = message { [INFO] [stdout] 39 + self_clone [INFO] [stdout] 40 + .handle_message( [INFO] [stdout] 41 + WarpMessage::text(text), [INFO] [stdout] 42 + MessageSource::DeviceId(device_id), [INFO] [stdout] 43 + ) [INFO] [stdout] 44 + .await; [INFO] [stdout] 45 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/web/handlers/message_handler.rs:51:21 [INFO] [stdout] | [INFO] [stdout] 51 | d.server_port.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `d.server_port` [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 `Option` which implements the `Copy` trait [INFO] [stdout] --> src/web/handlers/message_handler.rs:52:21 [INFO] [stdout] | [INFO] [stdout] 52 | d.server_port.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `d.server_port` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/web/handlers/message_handler.rs:98:32 [INFO] [stdout] | [INFO] [stdout] 98 | devices.iter().map(|d| DeviceSyncInfo::from(d)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DeviceSyncInfo::from` [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: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/web/handlers/client.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | / reader.write().await.next().await.map(|msg| match msg { [INFO] [stdout] 133 | | Ok(msg) => { [INFO] [stdout] 134 | | let _ = message_tx.send(WebSocketMessage::Message(msg)); [INFO] [stdout] ... | [INFO] [stdout] 139 | | }); [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] 132 - reader.write().await.next().await.map(|msg| match msg { [INFO] [stdout] 133 - Ok(msg) => { [INFO] [stdout] 134 - let _ = message_tx.send(WebSocketMessage::Message(msg)); [INFO] [stdout] 135 - } [INFO] [stdout] 136 - Err(e) => { [INFO] [stdout] 137 - error!("Error receiving message from client: {}", e); [INFO] [stdout] 138 - } [INFO] [stdout] 139 - }); [INFO] [stdout] 132 + if let Some(msg) = reader.write().await.next().await { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/clipboard/mod.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod clipboard; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_vec` [INFO] [stdout] --> src/clipboard/clipboard.rs:118:74 [INFO] [stdout] | [INFO] [stdout] 118 | let image_data = RustImageData::from_bytes(&image.content.to_vec()) [INFO] [stdout] | ^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/clipboard/local.rs:118:17 [INFO] [stdout] | [INFO] [stdout] 118 | / if now.duration_since(last_write) < self_clone.write_cooldown { [INFO] [stdout] 119 | | if self_clone.is_self_write.load(Ordering::SeqCst) { [INFO] [stdout] 120 | | info!("Skip clipboard change event because of self write"); [INFO] [stdout] 121 | | self_clone.is_self_write.store(false, Ordering::SeqCst); [INFO] [stdout] ... | [INFO] [stdout] 124 | | } [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] 118 ~ if now.duration_since(last_write) < self_clone.write_cooldown [INFO] [stdout] 119 ~ && self_clone.is_self_write.load(Ordering::SeqCst) { [INFO] [stdout] 120 | info!("Skip clipboard change event because of self write"); [INFO] [stdout] 121 | self_clone.is_self_write.store(false, Ordering::SeqCst); [INFO] [stdout] 122 | continue; [INFO] [stdout] 123 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/config.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / pub fn default() -> Self { [INFO] [stdout] 37 | | Self { [INFO] [stdout] 38 | | device_id: generate_device_id(), [INFO] [stdout] 39 | | device_name: Some("未命名设备".to_string()), [INFO] [stdout] ... | [INFO] [stdout] 58 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/config.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | if let Some(config_str) = fs::read_to_string(&_config_path).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(config_str)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 95 - if let Some(config_str) = fs::read_to_string(&_config_path).ok() { [INFO] [stdout] 95 + if let Ok(config_str) = fs::read_to_string(&_config_path) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::path::PathBuf` [INFO] [stdout] --> src/config.rs:183:13 [INFO] [stdout] | [INFO] [stdout] 183 | / PathBuf::from( [INFO] [stdout] 184 | | dirs::config_dir() [INFO] [stdout] 185 | | .unwrap() [INFO] [stdout] 186 | | .join("uniclipboard") [INFO] [stdout] 187 | | .join("config.toml") [INFO] [stdout] 188 | | ) [INFO] [stdout] | |_____________^ [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] help: consider removing `PathBuf::from()` [INFO] [stdout] | [INFO] [stdout] 183 ~ dirs::config_dir() [INFO] [stdout] 184 + .unwrap() [INFO] [stdout] 185 + .join("uniclipboard") [INFO] [stdout] 186 + .join("config.toml") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern takes a reference on something that is being dereferenced [INFO] [stdout] --> src/connection.rs:102:27 [INFO] [stdout] | [INFO] [stdout] 102 | .filter(|(&ref client_id, _)| { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&ref` part [INFO] [stdout] | [INFO] [stdout] 102 - .filter(|(&ref client_id, _)| { [INFO] [stdout] 102 + .filter(|(client_id, _)| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/connection.rs:137:18 [INFO] [stdout] | [INFO] [stdout] 137 | connections: Arc< [INFO] [stdout] | __________________^ [INFO] [stdout] 138 | | RwLock< [INFO] [stdout] 139 | | HashMap< [INFO] [stdout] 140 | | DeviceId, [INFO] [stdout] ... | [INFO] [stdout] 148 | | >, [INFO] [stdout] 149 | | >, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ConnectionManager` [INFO] [stdout] --> src/connection.rs:357:5 [INFO] [stdout] | [INFO] [stdout] 357 | / pub fn new() -> Self { [INFO] [stdout] 358 | | let (clipboard_message_sync_sender, _) = broadcast::channel(100); [INFO] [stdout] 359 | | Self { [INFO] [stdout] 360 | | incoming: IncomingConnectionManager::new(), [INFO] [stdout] ... | [INFO] [stdout] 367 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 356 + impl Default for ConnectionManager { [INFO] [stdout] 357 + fn default() -> Self { [INFO] [stdout] 358 + Self::new() [INFO] [stdout] 359 + } [INFO] [stdout] 360 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/connection.rs:439:13 [INFO] [stdout] | [INFO] [stdout] 439 | let config = CONFIG [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/connection.rs:457:22 [INFO] [stdout] | [INFO] [stdout] 457 | .await [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 494 | let results = join_all(connection_futures).await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 516 | *self.listen_new_devices_handle.write().await = Some(self.listen_new_devices().await); [INFO] [stdout] | ^^^^^ ^^^^^ [INFO] [stdout] 517 | // 尝试连接离线的设备 [INFO] [stdout] 518 | *self.try_connect_offline_devices_handle.write().await = [INFO] [stdout] | ^^^^^ [INFO] [stdout] 519 | Some(self.try_connect_offline_devices().await); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] = note: `#[warn(clippy::await_holding_lock)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/connection.rs:443:32 [INFO] [stdout] | [INFO] [stdout] 443 | let peer_device_port = config.peer_device_port.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `config.peer_device_port` [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: doc list item without indentation [INFO] [stdout] --> src/connection.rs:621:9 [INFO] [stdout] | [INFO] [stdout] 621 | /// to the identifier of a device. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] = note: `#[warn(clippy::doc_lazy_continuation)]` on by default [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 621 | /// to the identifier of a device. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/connection.rs:631:9 [INFO] [stdout] | [INFO] [stdout] 631 | /// 断开指定设备并移除连接 [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 631 | /// 断开指定设备并移除连接 [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/db/mod.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod db; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/device.rs:81:67 [INFO] [stdout] | [INFO] [stdout] 81 | pub static GLOBAL_DEVICE_MANAGER: Lazy = Lazy::new(|| DeviceManager::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DeviceManager::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/device.rs:130:13 [INFO] [stdout] | [INFO] [stdout] 130 | self.port.clone().unwrap_or_default(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.port` [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 `Option` which implements the `Copy` trait [INFO] [stdout] --> src/device.rs:131:13 [INFO] [stdout] | [INFO] [stdout] 131 | self.server_port.clone().unwrap_or_default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.server_port` [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 `DeviceStatus` which implements the `Copy` trait [INFO] [stdout] --> src/device.rs:144:21 [INFO] [stdout] | [INFO] [stdout] 144 | status: device.status.clone() as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `device.status` [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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/device.rs:146:25 [INFO] [stdout] | [INFO] [stdout] 146 | updated_at: device.updated_at.unwrap_or(0) as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `device.updated_at.unwrap_or(0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `DeviceManager` [INFO] [stdout] --> src/device.rs:182:5 [INFO] [stdout] | [INFO] [stdout] 182 | / pub fn new() -> Self { [INFO] [stdout] 183 | | Self {} [INFO] [stdout] 184 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 181 + impl Default for DeviceManager { [INFO] [stdout] 182 + fn default() -> Self { [INFO] [stdout] 183 + Self::new() [INFO] [stdout] 184 + } [INFO] [stdout] 185 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/device.rs:231:34 [INFO] [stdout] | [INFO] [stdout] 231 | pub fn merge(&self, devices: &Vec) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 231 - pub fn merge(&self, devices: &Vec) -> Result<()> { [INFO] [stdout] 231 + pub fn merge(&self, devices: &[Device]) -> Result<()> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/device.rs:242:18 [INFO] [stdout] | [INFO] [stdout] 242 | .map(|d| DbDevice::from(d)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DbDevice::from` [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: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/device.rs:305:9 [INFO] [stdout] | [INFO] [stdout] 305 | Ok(dao::device::is_exist(&mut conn, device_id)?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 305 - Ok(dao::device::is_exist(&mut conn, device_id)?) [INFO] [stdout] 305 + dao::device::is_exist(&mut conn, device_id) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/device.rs:419:9 [INFO] [stdout] | [INFO] [stdout] 419 | assert_eq!(manager.has("test").unwrap(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 419 - assert_eq!(manager.has("test").unwrap(), true); [INFO] [stdout] 419 + assert!(manager.has("test").unwrap()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/device.rs:420:9 [INFO] [stdout] | [INFO] [stdout] 420 | assert_eq!(manager.has("test1").unwrap(), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 420 - assert_eq!(manager.has("test1").unwrap(), false); [INFO] [stdout] 420 + assert!(!manager.has("test1").unwrap()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/device.rs:485:17 [INFO] [stdout] | [INFO] [stdout] 485 | assert_eq!(d.self_device, true, "Self device flag not set correctly"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 485 - assert_eq!(d.self_device, true, "Self device flag not set correctly"); [INFO] [stdout] 485 + assert!(d.self_device, "Self device flag not set correctly"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip(..).next()` on an iterator [INFO] [stdout] --> src/file_metadata.rs:60:23 [INFO] [stdout] | [INFO] [stdout] 60 | url.split('/') [INFO] [stdout] | _______________________^ [INFO] [stdout] 61 | | .skip(3) // 跳过 "https:" 和两个空字符串 [INFO] [stdout] 62 | | .next() [INFO] [stdout] | |___________________^ help: use `nth` instead: `.nth(3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next [INFO] [stdout] = note: `#[warn(clippy::iter_skip_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/key_mouse_monitor.rs:20:21 [INFO] [stdout] | [INFO] [stdout] 20 | state_receiver: Arc)>>>, [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: method `eq` can be confused for the standard trait method `std::cmp::PartialEq::eq` [INFO] [stdout] --> src/message.rs:188:5 [INFO] [stdout] | [INFO] [stdout] 188 | / pub fn eq(&self, other: &Payload) -> bool { [INFO] [stdout] 189 | | self.get_key() == other.get_key() [INFO] [stdout] 190 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::cmp::PartialEq` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/network/webdav.rs:82:9 [INFO] [stdout] | [INFO] [stdout] 82 | let path: String; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `path` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 82 ~ [INFO] [stdout] 83 ~ let path: String = if dir == "/" { [INFO] [stdout] 84 ~ format!("/{}", filename) [INFO] [stdout] 85 | } else { [INFO] [stdout] 86 ~ format!("{}/{}", dir, filename) [INFO] [stdout] 87 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/network/webdav.rs:89:56 [INFO] [stdout] | [INFO] [stdout] 89 | let encrypted_payload = self.encryptor.encrypt(&json_payload.as_bytes())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json_payload.as_bytes()` [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/network/webdav.rs:190:49 [INFO] [stdout] | [INFO] [stdout] 190 | let meta = FileMetadata::from_list_file(&list_file, &self.client.host); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `list_file` [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/network/webdav.rs:220:49 [INFO] [stdout] | [INFO] [stdout] 220 | let meta = FileMetadata::from_list_file(&list_file, &self.client.host); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `list_file` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/network/websocket.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | writer: Arc< [INFO] [stdout] | _____________^ [INFO] [stdout] 34 | | Option< [INFO] [stdout] 35 | | Mutex< [INFO] [stdout] 36 | | futures_util::stream::SplitSink< [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#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/network/websocket.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | reader: Arc< [INFO] [stdout] | _____________^ [INFO] [stdout] 45 | | Option< [INFO] [stdout] 46 | | Mutex>>>, [INFO] [stdout] 47 | | >, [INFO] [stdout] 48 | | >, [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/network/websocket.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | / match message { [INFO] [stdout] 190 | | Message::Text(text) => { [INFO] [stdout] 191 | | let web_socket_message: WebSocketMessage = serde_json::from_str(&text)?; [INFO] [stdout] 192 | | if let WebSocketMessage::ClipboardSync(data) = web_socket_message { [INFO] [stdout] ... | [INFO] [stdout] 196 | | _ => {} [INFO] [stdout] 197 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 189 ~ if let Message::Text(text) = message { [INFO] [stdout] 190 + let web_socket_message: WebSocketMessage = serde_json::from_str(&text)?; [INFO] [stdout] 191 + if let WebSocketMessage::ClipboardSync(data) = web_socket_message { [INFO] [stdout] 192 + return Ok(Some(data)); [INFO] [stdout] 193 + } [INFO] [stdout] 194 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/network/websocket.rs:337:41 [INFO] [stdout] | [INFO] [stdout] 337 | devices: devices.iter().map(|d| DeviceSyncInfo::from(d)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DeviceSyncInfo::from` [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: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/network/websocket.rs:356:17 [INFO] [stdout] | [INFO] [stdout] 356 | / if let Message::Pong(msg) = msg { [INFO] [stdout] 357 | | trace!("Ping pong result: {:?}", msg); [INFO] [stdout] 358 | | return msg == rand_bytes_clone; [INFO] [stdout] 359 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/network/websocket.rs:355:23 [INFO] [stdout] | [INFO] [stdout] 355 | if let Ok(msg) = rx.recv().await { [INFO] [stdout] | ^^^ replace this binding [INFO] [stdout] 356 | if let Message::Pong(msg) = msg { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/remote_sync/webdav_sync.rs:30:25 [INFO] [stdout] | [INFO] [stdout] 30 | let base_path = format!("/uniclipboard"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/uniclipboard".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `used_linker` [INFO] [stdout] --> tests/uni_clipboard_tests.rs:32:5 [INFO] [stdout] | [INFO] [stdout] 32 | #[ctor::ctor] [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: expected values for `feature` are: `hardware_tests`, `integration_tests`, `network_tests`, `testing`, and `vendored_openssl` [INFO] [stdout] = note: using a cfg inside a attribute macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `ctor::ctor` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the attribute macro `ctor::ctor` may come from an old version of the `ctor` crate, try updating your dependency with `cargo update -p ctor` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: `#[warn(unexpected_cfgs)]` on by default [INFO] [stdout] = note: this warning originates in the attribute macro `ctor::ctor` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> tests/message_tests.rs:3:1 [INFO] [stdout] | [INFO] [stdout] 3 | use serde_json; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `used_linker` [INFO] [stdout] --> tests/web_api_tests.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | #[ctor::ctor] [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: expected values for `feature` are: `hardware_tests`, `integration_tests`, `network_tests`, `testing`, and `vendored_openssl` [INFO] [stdout] = note: using a cfg inside a attribute macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `ctor::ctor` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the attribute macro `ctor::ctor` may come from an old version of the `ctor` crate, try updating your dependency with `cargo update -p ctor` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: `#[warn(unexpected_cfgs)]` on by default [INFO] [stdout] = note: this warning originates in the attribute macro `ctor::ctor` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `used_linker` [INFO] [stdout] --> tests/websocket_message_handler_tests.rs:31:5 [INFO] [stdout] | [INFO] [stdout] 31 | #[ctor::ctor] [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: expected values for `feature` are: `hardware_tests`, `integration_tests`, `network_tests`, `testing`, and `vendored_openssl` [INFO] [stdout] = note: using a cfg inside a attribute macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `ctor::ctor` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the attribute macro `ctor::ctor` may come from an old version of the `ctor` crate, try updating your dependency with `cargo update -p ctor` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: `#[warn(unexpected_cfgs)]` on by default [INFO] [stdout] = note: this warning originates in the attribute macro `ctor::ctor` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `RemoteSyncManager` [INFO] [stdout] --> src/remote_sync/manager.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | / pub fn new() -> Self { [INFO] [stdout] 15 | | RemoteSyncManager { [INFO] [stdout] 16 | | sync_handler: Arc::new(RwLock::new(None)), [INFO] [stdout] 17 | | } [INFO] [stdout] 18 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 13 + impl Default for RemoteSyncManager { [INFO] [stdout] 14 + fn default() -> Self { [INFO] [stdout] 15 + Self::new() [INFO] [stdout] 16 + } [INFO] [stdout] 17 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> tests/key_mouse_monitor_tests.rs:73:5 [INFO] [stdout] | [INFO] [stdout] 73 | assert_eq!(*monitor.is_running.lock().await, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 73 - assert_eq!(*monitor.is_running.lock().await, false); [INFO] [stdout] 73 + assert!(!(*monitor.is_running.lock().await)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> tests/key_mouse_monitor_tests.rs:75:5 [INFO] [stdout] | [INFO] [stdout] 75 | assert_eq!(*monitor.is_running.lock().await, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 75 - assert_eq!(*monitor.is_running.lock().await, true); [INFO] [stdout] 75 + assert!(*monitor.is_running.lock().await); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> tests/key_mouse_monitor_tests.rs:103:5 [INFO] [stdout] | [INFO] [stdout] 103 | assert_eq!(*monitor.is_running.lock().await, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 103 - assert_eq!(*monitor.is_running.lock().await, false); [INFO] [stdout] 103 + assert!(!(*monitor.is_running.lock().await)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> tests/key_mouse_monitor_tests.rs:105:5 [INFO] [stdout] | [INFO] [stdout] 105 | assert_eq!(*monitor.is_running.lock().await, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 105 - assert_eq!(*monitor.is_running.lock().await, true); [INFO] [stdout] 105 + assert!(*monitor.is_running.lock().await); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `websocket_sync` is never read [INFO] [stdout] --> tests/websocket_message_handler_tests.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 47 | struct WebServerWrapper { [INFO] [stdout] | ---------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 52 | websocket_sync: Arc, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `UniClipboardBuilder` [INFO] [stdout] --> src/uni_clipboard.rs:295:5 [INFO] [stdout] | [INFO] [stdout] 295 | / pub fn new() -> Self { [INFO] [stdout] 296 | | Self { [INFO] [stdout] 297 | | webserver: None, [INFO] [stdout] 298 | | clipboard: None, [INFO] [stdout] ... | [INFO] [stdout] 303 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 294 + impl Default for UniClipboardBuilder { [INFO] [stdout] 295 + fn default() -> Self { [INFO] [stdout] 296 + Self::new() [INFO] [stdout] 297 + } [INFO] [stdout] 298 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> tests/websocket_message_handler_tests.rs:129:49 [INFO] [stdout] | [INFO] [stdout] 129 | devices: devices.iter().map(|d| DeviceSyncInfo::from(d)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DeviceSyncInfo::from` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> tests/websocket_message_handler_tests.rs:142:36 [INFO] [stdout] | [INFO] [stdout] 142 | Ok(message) => match message { [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 143 | | Message::Text(text) => { [INFO] [stdout] 144 | | let msg: WebSocketMessage = serde_json::from_str(&text).unwrap(); [INFO] [stdout] 145 | | if let WebSocketMessage::DeviceListSync(data) = msg { [INFO] [stdout] ... | [INFO] [stdout] 151 | | _ => {} [INFO] [stdout] 152 | | }, [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] 142 ~ Ok(message) => if let Message::Text(text) = message { [INFO] [stdout] 143 + let msg: WebSocketMessage = serde_json::from_str(&text).unwrap(); [INFO] [stdout] 144 + if let WebSocketMessage::DeviceListSync(data) = msg { [INFO] [stdout] 145 + received_correct_message = true; [INFO] [stdout] 146 ~ println!("收到 DeviceListSync 消息: {}", data.devices.len()); [INFO] [stdout] 147 + break; [INFO] [stdout] 148 + } [INFO] [stdout] 149 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `true` [INFO] [stdout] --> tests/websocket_message_handler_tests.rs:240:25 [INFO] [stdout] | [INFO] [stdout] 240 | assert!(true); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove the assertion [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] = note: `#[warn(clippy::assertions_on_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `false` [INFO] [stdout] --> tests/websocket_message_handler_tests.rs:244:25 [INFO] [stdout] | [INFO] [stdout] 244 | assert!(false); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> tests/websocket_message_handler_tests.rs:115:23 [INFO] [stdout] | [INFO] [stdout] 115 | let devices = vec![Device::new("1".to_string(), None, None, Some(8333))]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[Device::new("1".to_string(), None, None, Some(8333))]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `if let` [INFO] [stdout] --> src/web/handlers/websocket_message.rs:38:21 [INFO] [stdout] | [INFO] [stdout] 38 | / match message { [INFO] [stdout] 39 | | TungsteniteMessage::Text(text) => { [INFO] [stdout] 40 | | self_clone [INFO] [stdout] 41 | | .handle_message( [INFO] [stdout] ... | [INFO] [stdout] 47 | | _ => {} [INFO] [stdout] 48 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/web/handlers/websocket_message.rs:37:39 [INFO] [stdout] | [INFO] [stdout] 37 | if let Ok((device_id, message)) = message { [INFO] [stdout] | ^^^^^^^ replace this binding [INFO] [stdout] 38 | match message { [INFO] [stdout] 39 | TungsteniteMessage::Text(text) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/web/handlers/websocket_message.rs:38:21 [INFO] [stdout] | [INFO] [stdout] 38 | / match message { [INFO] [stdout] 39 | | TungsteniteMessage::Text(text) => { [INFO] [stdout] 40 | | self_clone [INFO] [stdout] 41 | | .handle_message( [INFO] [stdout] ... | [INFO] [stdout] 47 | | _ => {} [INFO] [stdout] 48 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 38 ~ if let TungsteniteMessage::Text(text) = message { [INFO] [stdout] 39 + self_clone [INFO] [stdout] 40 + .handle_message( [INFO] [stdout] 41 + WarpMessage::text(text), [INFO] [stdout] 42 + MessageSource::DeviceId(device_id), [INFO] [stdout] 43 + ) [INFO] [stdout] 44 + .await; [INFO] [stdout] 45 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/web/handlers/message_handler.rs:51:21 [INFO] [stdout] | [INFO] [stdout] 51 | d.server_port.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `d.server_port` [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 `Option` which implements the `Copy` trait [INFO] [stdout] --> src/web/handlers/message_handler.rs:52:21 [INFO] [stdout] | [INFO] [stdout] 52 | d.server_port.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `d.server_port` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/web/handlers/message_handler.rs:98:32 [INFO] [stdout] | [INFO] [stdout] 98 | devices.iter().map(|d| DeviceSyncInfo::from(d)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DeviceSyncInfo::from` [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: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/web/handlers/client.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | / reader.write().await.next().await.map(|msg| match msg { [INFO] [stdout] 133 | | Ok(msg) => { [INFO] [stdout] 134 | | let _ = message_tx.send(WebSocketMessage::Message(msg)); [INFO] [stdout] ... | [INFO] [stdout] 139 | | }); [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] 132 - reader.write().await.next().await.map(|msg| match msg { [INFO] [stdout] 133 - Ok(msg) => { [INFO] [stdout] 134 - let _ = message_tx.send(WebSocketMessage::Message(msg)); [INFO] [stdout] 135 - } [INFO] [stdout] 136 - Err(e) => { [INFO] [stdout] 137 - error!("Error receiving message from client: {}", e); [INFO] [stdout] 138 - } [INFO] [stdout] 139 - }); [INFO] [stdout] 132 + if let Some(msg) = reader.write().await.next().await { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/device.rs:384:41 [INFO] [stdout] | [INFO] [stdout] 384 | if let Some(db_name) = unsafe { DB_NAME.as_ref() } { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/connection.rs:621:5 [INFO] [stdout] | [INFO] [stdout] 621 | / /// to the identifier of a device. [INFO] [stdout] ... | [INFO] [stdout] 630 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 634 | pub async fn remove_connection(&self, id: MessageSource) { [INFO] [stdout] | ------------------------------ the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the doc comment should not document function `remove_connection` then comment it out [INFO] [stdout] | [INFO] [stdout] 616 ~ // /// The `disconnect` function in Rust asynchronously disconnects a device based on its ID. [INFO] [stdout] 617 ~ // /// [INFO] [stdout] 618 ~ // /// Arguments: [INFO] [stdout] 619 ~ // /// [INFO] [stdout] 620 ~ // /// * `id`: The `id` parameter in the `disconnect` function is of type `DeviceId`, which is a reference [INFO] [stdout] 621 ~ // /// to the identifier of a device. [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `used_linker` [INFO] [stdout] --> src/device.rs:355:5 [INFO] [stdout] | [INFO] [stdout] 355 | #[ctor::ctor] [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: expected values for `feature` are: `hardware_tests`, `integration_tests`, `network_tests`, `testing`, and `vendored_openssl` [INFO] [stdout] = note: using a cfg inside a attribute macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `ctor::ctor` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the attribute macro `ctor::ctor` may come from an old version of the `ctor` crate, try updating your dependency with `cargo update -p ctor` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: `#[warn(unexpected_cfgs)]` on by default [INFO] [stdout] = note: this warning originates in the attribute macro `ctor::ctor` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `used_linker` [INFO] [stdout] --> src/uni_clipboard.rs:378:5 [INFO] [stdout] | [INFO] [stdout] 378 | #[ctor::ctor] [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: expected values for `feature` are: `hardware_tests`, `integration_tests`, `network_tests`, `testing`, and `vendored_openssl` [INFO] [stdout] = note: using a cfg inside a attribute macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `ctor::ctor` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the attribute macro `ctor::ctor` may come from an old version of the `ctor` crate, try updating your dependency with `cargo update -p ctor` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the attribute macro `ctor::ctor` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/message.rs:6:1 [INFO] [stdout] | [INFO] [stdout] 6 | use serde_json; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/connection.rs:621:5 [INFO] [stdout] | [INFO] [stdout] 621 | / /// to the identifier of a device. [INFO] [stdout] ... | [INFO] [stdout] 630 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 634 | pub async fn remove_connection(&self, id: MessageSource) { [INFO] [stdout] | ------------------------------ the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the doc comment should not document function `remove_connection` then comment it out [INFO] [stdout] | [INFO] [stdout] 616 ~ // /// The `disconnect` function in Rust asynchronously disconnects a device based on its ID. [INFO] [stdout] 617 ~ // /// [INFO] [stdout] 618 ~ // /// Arguments: [INFO] [stdout] 619 ~ // /// [INFO] [stdout] 620 ~ // /// * `id`: The `id` parameter in the `disconnect` function is of type `DeviceId`, which is a reference [INFO] [stdout] 621 ~ // /// to the identifier of a device. [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/message.rs:6:1 [INFO] [stdout] | [INFO] [stdout] 6 | use serde_json; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `#[ignore]` attribute cannot be used on inherent methods [INFO] [stdout] --> src/uni_clipboard.rs:51:52 [INFO] [stdout] | [INFO] [stdout] 51 | #[cfg_attr(not(feature = "integration_tests"), ignore)] [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! [INFO] [stdout] = help: `#[ignore]` can only be applied to functions [INFO] [stdout] = note: `#[warn(unused_attributes)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `#[ignore]` attribute cannot be used on inherent methods [INFO] [stdout] --> src/uni_clipboard.rs:56:52 [INFO] [stdout] | [INFO] [stdout] 56 | #[cfg_attr(not(feature = "integration_tests"), ignore)] [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! [INFO] [stdout] = help: `#[ignore]` can only be applied to functions [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `#[ignore]` attribute cannot be used on inherent methods [INFO] [stdout] --> src/uni_clipboard.rs:51:52 [INFO] [stdout] | [INFO] [stdout] 51 | #[cfg_attr(not(feature = "integration_tests"), ignore)] [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! [INFO] [stdout] = help: `#[ignore]` can only be applied to functions [INFO] [stdout] = note: `#[warn(unused_attributes)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `#[ignore]` attribute cannot be used on inherent methods [INFO] [stdout] --> src/uni_clipboard.rs:56:52 [INFO] [stdout] | [INFO] [stdout] 56 | #[cfg_attr(not(feature = "integration_tests"), ignore)] [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! [INFO] [stdout] = help: `#[ignore]` can only be applied to functions [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `DatabaseError` is never constructed [INFO] [stdout] --> src/errors.rs:13:12 [INFO] [stdout] | [INFO] [stdout] 13 | pub struct DatabaseError(pub String); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `to_json` is never used [INFO] [stdout] --> src/message.rs:328:12 [INFO] [stdout] | [INFO] [stdout] 323 | impl WebSocketMessage { [INFO] [stdout] | --------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 328 | pub fn to_json(&self) -> Result { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `receive_raw` is never used [INFO] [stdout] --> src/network/websocket.rs:226:18 [INFO] [stdout] | [INFO] [stdout] 55 | impl WebSocketClient { [INFO] [stdout] | -------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 226 | pub async fn receive_raw(&self) -> Result { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get_clipboard` and `get_remote_sync` are never used [INFO] [stdout] --> src/uni_clipboard.rs:52:12 [INFO] [stdout] | [INFO] [stdout] 31 | impl UniClipboard { [INFO] [stdout] | ----------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 52 | pub fn get_clipboard(&self) -> Arc { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 57 | pub fn get_remote_sync(&self) -> Arc { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/clipboard/mod.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod clipboard; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_vec` [INFO] [stdout] --> src/clipboard/clipboard.rs:118:74 [INFO] [stdout] | [INFO] [stdout] 118 | let image_data = RustImageData::from_bytes(&image.content.to_vec()) [INFO] [stdout] | ^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/clipboard/local.rs:118:17 [INFO] [stdout] | [INFO] [stdout] 118 | / if now.duration_since(last_write) < self_clone.write_cooldown { [INFO] [stdout] 119 | | if self_clone.is_self_write.load(Ordering::SeqCst) { [INFO] [stdout] 120 | | info!("Skip clipboard change event because of self write"); [INFO] [stdout] 121 | | self_clone.is_self_write.store(false, Ordering::SeqCst); [INFO] [stdout] ... | [INFO] [stdout] 124 | | } [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] 118 ~ if now.duration_since(last_write) < self_clone.write_cooldown [INFO] [stdout] 119 ~ && self_clone.is_self_write.load(Ordering::SeqCst) { [INFO] [stdout] 120 | info!("Skip clipboard change event because of self write"); [INFO] [stdout] 121 | self_clone.is_self_write.store(false, Ordering::SeqCst); [INFO] [stdout] 122 | continue; [INFO] [stdout] 123 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/config.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | if let Some(config_str) = fs::read_to_string(&_config_path).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(config_str)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 95 - if let Some(config_str) = fs::read_to_string(&_config_path).ok() { [INFO] [stdout] 95 + if let Ok(config_str) = fs::read_to_string(&_config_path) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern takes a reference on something that is being dereferenced [INFO] [stdout] --> src/connection.rs:102:27 [INFO] [stdout] | [INFO] [stdout] 102 | .filter(|(&ref client_id, _)| { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&ref` part [INFO] [stdout] | [INFO] [stdout] 102 - .filter(|(&ref client_id, _)| { [INFO] [stdout] 102 + .filter(|(client_id, _)| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/connection.rs:137:18 [INFO] [stdout] | [INFO] [stdout] 137 | connections: Arc< [INFO] [stdout] | __________________^ [INFO] [stdout] 138 | | RwLock< [INFO] [stdout] 139 | | HashMap< [INFO] [stdout] 140 | | DeviceId, [INFO] [stdout] ... | [INFO] [stdout] 148 | | >, [INFO] [stdout] 149 | | >, [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: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/connection.rs:439:13 [INFO] [stdout] | [INFO] [stdout] 439 | let config = CONFIG [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/connection.rs:457:22 [INFO] [stdout] | [INFO] [stdout] 457 | .await [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 494 | let results = join_all(connection_futures).await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 516 | *self.listen_new_devices_handle.write().await = Some(self.listen_new_devices().await); [INFO] [stdout] | ^^^^^ ^^^^^ [INFO] [stdout] 517 | // 尝试连接离线的设备 [INFO] [stdout] 518 | *self.try_connect_offline_devices_handle.write().await = [INFO] [stdout] | ^^^^^ [INFO] [stdout] 519 | Some(self.try_connect_offline_devices().await); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] = note: `#[warn(clippy::await_holding_lock)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/connection.rs:443:32 [INFO] [stdout] | [INFO] [stdout] 443 | let peer_device_port = config.peer_device_port.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `config.peer_device_port` [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: doc list item without indentation [INFO] [stdout] --> src/connection.rs:621:9 [INFO] [stdout] | [INFO] [stdout] 621 | /// to the identifier of a device. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] = note: `#[warn(clippy::doc_lazy_continuation)]` on by default [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 621 | /// to the identifier of a device. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/connection.rs:631:9 [INFO] [stdout] | [INFO] [stdout] 631 | /// 断开指定设备并移除连接 [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 631 | /// 断开指定设备并移除连接 [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/db/mod.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod db; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/device.rs:81:67 [INFO] [stdout] | [INFO] [stdout] 81 | pub static GLOBAL_DEVICE_MANAGER: Lazy = Lazy::new(|| DeviceManager::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DeviceManager::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/device.rs:130:13 [INFO] [stdout] | [INFO] [stdout] 130 | self.port.clone().unwrap_or_default(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.port` [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 `Option` which implements the `Copy` trait [INFO] [stdout] --> src/device.rs:131:13 [INFO] [stdout] | [INFO] [stdout] 131 | self.server_port.clone().unwrap_or_default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.server_port` [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 `DeviceStatus` which implements the `Copy` trait [INFO] [stdout] --> src/device.rs:144:21 [INFO] [stdout] | [INFO] [stdout] 144 | status: device.status.clone() as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `device.status` [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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/device.rs:146:25 [INFO] [stdout] | [INFO] [stdout] 146 | updated_at: device.updated_at.unwrap_or(0) as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `device.updated_at.unwrap_or(0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/device.rs:231:34 [INFO] [stdout] | [INFO] [stdout] 231 | pub fn merge(&self, devices: &Vec) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 231 - pub fn merge(&self, devices: &Vec) -> Result<()> { [INFO] [stdout] 231 + pub fn merge(&self, devices: &[Device]) -> Result<()> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/device.rs:242:18 [INFO] [stdout] | [INFO] [stdout] 242 | .map(|d| DbDevice::from(d)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DbDevice::from` [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: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/device.rs:305:9 [INFO] [stdout] | [INFO] [stdout] 305 | Ok(dao::device::is_exist(&mut conn, device_id)?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 305 - Ok(dao::device::is_exist(&mut conn, device_id)?) [INFO] [stdout] 305 + dao::device::is_exist(&mut conn, device_id) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip(..).next()` on an iterator [INFO] [stdout] --> src/file_metadata.rs:60:23 [INFO] [stdout] | [INFO] [stdout] 60 | url.split('/') [INFO] [stdout] | _______________________^ [INFO] [stdout] 61 | | .skip(3) // 跳过 "https:" 和两个空字符串 [INFO] [stdout] 62 | | .next() [INFO] [stdout] | |___________________^ help: use `nth` instead: `.nth(3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next [INFO] [stdout] = note: `#[warn(clippy::iter_skip_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/key_mouse_monitor.rs:20:21 [INFO] [stdout] | [INFO] [stdout] 20 | state_receiver: Arc)>>>, [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: unneeded late initialization [INFO] [stdout] --> src/network/webdav.rs:82:9 [INFO] [stdout] | [INFO] [stdout] 82 | let path: String; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `path` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 82 ~ [INFO] [stdout] 83 ~ let path: String = if dir == "/" { [INFO] [stdout] 84 ~ format!("/{}", filename) [INFO] [stdout] 85 | } else { [INFO] [stdout] 86 ~ format!("{}/{}", dir, filename) [INFO] [stdout] 87 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/network/webdav.rs:89:56 [INFO] [stdout] | [INFO] [stdout] 89 | let encrypted_payload = self.encryptor.encrypt(&json_payload.as_bytes())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json_payload.as_bytes()` [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/network/webdav.rs:190:49 [INFO] [stdout] | [INFO] [stdout] 190 | let meta = FileMetadata::from_list_file(&list_file, &self.client.host); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `list_file` [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/network/webdav.rs:220:49 [INFO] [stdout] | [INFO] [stdout] 220 | let meta = FileMetadata::from_list_file(&list_file, &self.client.host); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `list_file` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/network/websocket.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | writer: Arc< [INFO] [stdout] | _____________^ [INFO] [stdout] 34 | | Option< [INFO] [stdout] 35 | | Mutex< [INFO] [stdout] 36 | | futures_util::stream::SplitSink< [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#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/network/websocket.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | reader: Arc< [INFO] [stdout] | _____________^ [INFO] [stdout] 45 | | Option< [INFO] [stdout] 46 | | Mutex>>>, [INFO] [stdout] 47 | | >, [INFO] [stdout] 48 | | >, [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/network/websocket.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | / match message { [INFO] [stdout] 190 | | Message::Text(text) => { [INFO] [stdout] 191 | | let web_socket_message: WebSocketMessage = serde_json::from_str(&text)?; [INFO] [stdout] 192 | | if let WebSocketMessage::ClipboardSync(data) = web_socket_message { [INFO] [stdout] ... | [INFO] [stdout] 196 | | _ => {} [INFO] [stdout] 197 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 189 ~ if let Message::Text(text) = message { [INFO] [stdout] 190 + let web_socket_message: WebSocketMessage = serde_json::from_str(&text)?; [INFO] [stdout] 191 + if let WebSocketMessage::ClipboardSync(data) = web_socket_message { [INFO] [stdout] 192 + return Ok(Some(data)); [INFO] [stdout] 193 + } [INFO] [stdout] 194 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/network/websocket.rs:337:41 [INFO] [stdout] | [INFO] [stdout] 337 | devices: devices.iter().map(|d| DeviceSyncInfo::from(d)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DeviceSyncInfo::from` [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: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/network/websocket.rs:356:17 [INFO] [stdout] | [INFO] [stdout] 356 | / if let Message::Pong(msg) = msg { [INFO] [stdout] 357 | | trace!("Ping pong result: {:?}", msg); [INFO] [stdout] 358 | | return msg == rand_bytes_clone; [INFO] [stdout] 359 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/network/websocket.rs:355:23 [INFO] [stdout] | [INFO] [stdout] 355 | if let Ok(msg) = rx.recv().await { [INFO] [stdout] | ^^^ replace this binding [INFO] [stdout] 356 | if let Message::Pong(msg) = msg { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/remote_sync/webdav_sync.rs:30:25 [INFO] [stdout] | [INFO] [stdout] 30 | let base_path = format!("/uniclipboard"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/uniclipboard".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `if let` [INFO] [stdout] --> src/web/handlers/websocket_message.rs:38:21 [INFO] [stdout] | [INFO] [stdout] 38 | / match message { [INFO] [stdout] 39 | | TungsteniteMessage::Text(text) => { [INFO] [stdout] 40 | | self_clone [INFO] [stdout] 41 | | .handle_message( [INFO] [stdout] ... | [INFO] [stdout] 47 | | _ => {} [INFO] [stdout] 48 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/web/handlers/websocket_message.rs:37:39 [INFO] [stdout] | [INFO] [stdout] 37 | if let Ok((device_id, message)) = message { [INFO] [stdout] | ^^^^^^^ replace this binding [INFO] [stdout] 38 | match message { [INFO] [stdout] 39 | TungsteniteMessage::Text(text) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/web/handlers/websocket_message.rs:38:21 [INFO] [stdout] | [INFO] [stdout] 38 | / match message { [INFO] [stdout] 39 | | TungsteniteMessage::Text(text) => { [INFO] [stdout] 40 | | self_clone [INFO] [stdout] 41 | | .handle_message( [INFO] [stdout] ... | [INFO] [stdout] 47 | | _ => {} [INFO] [stdout] 48 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 38 ~ if let TungsteniteMessage::Text(text) = message { [INFO] [stdout] 39 + self_clone [INFO] [stdout] 40 + .handle_message( [INFO] [stdout] 41 + WarpMessage::text(text), [INFO] [stdout] 42 + MessageSource::DeviceId(device_id), [INFO] [stdout] 43 + ) [INFO] [stdout] 44 + .await; [INFO] [stdout] 45 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/web/handlers/message_handler.rs:51:21 [INFO] [stdout] | [INFO] [stdout] 51 | d.server_port.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `d.server_port` [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 `Option` which implements the `Copy` trait [INFO] [stdout] --> src/web/handlers/message_handler.rs:52:21 [INFO] [stdout] | [INFO] [stdout] 52 | d.server_port.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `d.server_port` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/web/handlers/message_handler.rs:98:32 [INFO] [stdout] | [INFO] [stdout] 98 | devices.iter().map(|d| DeviceSyncInfo::from(d)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DeviceSyncInfo::from` [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: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/web/handlers/client.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | / reader.write().await.next().await.map(|msg| match msg { [INFO] [stdout] 133 | | Ok(msg) => { [INFO] [stdout] 134 | | let _ = message_tx.send(WebSocketMessage::Message(msg)); [INFO] [stdout] ... | [INFO] [stdout] 139 | | }); [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] 132 - reader.write().await.next().await.map(|msg| match msg { [INFO] [stdout] 133 - Ok(msg) => { [INFO] [stdout] 134 - let _ = message_tx.send(WebSocketMessage::Message(msg)); [INFO] [stdout] 135 - } [INFO] [stdout] 136 - Err(e) => { [INFO] [stdout] 137 - error!("Error receiving message from client: {}", e); [INFO] [stdout] 138 - } [INFO] [stdout] 139 - }); [INFO] [stdout] 132 + if let Some(msg) = reader.write().await.next().await { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ClipboardContextWrapper` is never constructed [INFO] [stdout] --> src/clipboard/clipboard.rs:17:12 [INFO] [stdout] | [INFO] [stdout] 17 | pub struct ClipboardContextWrapper(ClipboardContext); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `DatabaseError` is never constructed [INFO] [stdout] --> src/errors.rs:13:12 [INFO] [stdout] | [INFO] [stdout] 13 | pub struct DatabaseError(pub String); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `to_json` is never used [INFO] [stdout] --> src/message.rs:328:12 [INFO] [stdout] | [INFO] [stdout] 323 | impl WebSocketMessage { [INFO] [stdout] | --------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 328 | pub fn to_json(&self) -> Result { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `receive_raw` is never used [INFO] [stdout] --> src/network/websocket.rs:226:18 [INFO] [stdout] | [INFO] [stdout] 55 | impl WebSocketClient { [INFO] [stdout] | -------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 226 | pub async fn receive_raw(&self) -> Result { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get_clipboard` and `get_remote_sync` are never used [INFO] [stdout] --> src/uni_clipboard.rs:52:12 [INFO] [stdout] | [INFO] [stdout] 31 | impl UniClipboard { [INFO] [stdout] | ----------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 52 | pub fn get_clipboard(&self) -> Arc { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 57 | pub fn get_remote_sync(&self) -> Arc { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/clipboard/mod.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod clipboard; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_vec` [INFO] [stdout] --> src/clipboard/clipboard.rs:118:74 [INFO] [stdout] | [INFO] [stdout] 118 | let image_data = RustImageData::from_bytes(&image.content.to_vec()) [INFO] [stdout] | ^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/clipboard/local.rs:118:17 [INFO] [stdout] | [INFO] [stdout] 118 | / if now.duration_since(last_write) < self_clone.write_cooldown { [INFO] [stdout] 119 | | if self_clone.is_self_write.load(Ordering::SeqCst) { [INFO] [stdout] 120 | | info!("Skip clipboard change event because of self write"); [INFO] [stdout] 121 | | self_clone.is_self_write.store(false, Ordering::SeqCst); [INFO] [stdout] ... | [INFO] [stdout] 124 | | } [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] 118 ~ if now.duration_since(last_write) < self_clone.write_cooldown [INFO] [stdout] 119 ~ && self_clone.is_self_write.load(Ordering::SeqCst) { [INFO] [stdout] 120 | info!("Skip clipboard change event because of self write"); [INFO] [stdout] 121 | self_clone.is_self_write.store(false, Ordering::SeqCst); [INFO] [stdout] 122 | continue; [INFO] [stdout] 123 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/config.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | if let Some(config_str) = fs::read_to_string(&_config_path).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(config_str)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 95 - if let Some(config_str) = fs::read_to_string(&_config_path).ok() { [INFO] [stdout] 95 + if let Ok(config_str) = fs::read_to_string(&_config_path) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::path::PathBuf` [INFO] [stdout] --> src/config.rs:183:13 [INFO] [stdout] | [INFO] [stdout] 183 | / PathBuf::from( [INFO] [stdout] 184 | | dirs::config_dir() [INFO] [stdout] 185 | | .unwrap() [INFO] [stdout] 186 | | .join("uniclipboard") [INFO] [stdout] 187 | | .join("config.toml") [INFO] [stdout] 188 | | ) [INFO] [stdout] | |_____________^ [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] help: consider removing `PathBuf::from()` [INFO] [stdout] | [INFO] [stdout] 183 ~ dirs::config_dir() [INFO] [stdout] 184 + .unwrap() [INFO] [stdout] 185 + .join("uniclipboard") [INFO] [stdout] 186 + .join("config.toml") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern takes a reference on something that is being dereferenced [INFO] [stdout] --> src/connection.rs:102:27 [INFO] [stdout] | [INFO] [stdout] 102 | .filter(|(&ref client_id, _)| { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&ref` part [INFO] [stdout] | [INFO] [stdout] 102 - .filter(|(&ref client_id, _)| { [INFO] [stdout] 102 + .filter(|(client_id, _)| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/connection.rs:137:18 [INFO] [stdout] | [INFO] [stdout] 137 | connections: Arc< [INFO] [stdout] | __________________^ [INFO] [stdout] 138 | | RwLock< [INFO] [stdout] 139 | | HashMap< [INFO] [stdout] 140 | | DeviceId, [INFO] [stdout] ... | [INFO] [stdout] 148 | | >, [INFO] [stdout] 149 | | >, [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: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/connection.rs:439:13 [INFO] [stdout] | [INFO] [stdout] 439 | let config = CONFIG [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/connection.rs:457:22 [INFO] [stdout] | [INFO] [stdout] 457 | .await [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 494 | let results = join_all(connection_futures).await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 516 | *self.listen_new_devices_handle.write().await = Some(self.listen_new_devices().await); [INFO] [stdout] | ^^^^^ ^^^^^ [INFO] [stdout] 517 | // 尝试连接离线的设备 [INFO] [stdout] 518 | *self.try_connect_offline_devices_handle.write().await = [INFO] [stdout] | ^^^^^ [INFO] [stdout] 519 | Some(self.try_connect_offline_devices().await); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] = note: `#[warn(clippy::await_holding_lock)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/connection.rs:443:32 [INFO] [stdout] | [INFO] [stdout] 443 | let peer_device_port = config.peer_device_port.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `config.peer_device_port` [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: doc list item without indentation [INFO] [stdout] --> src/connection.rs:621:9 [INFO] [stdout] | [INFO] [stdout] 621 | /// to the identifier of a device. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] = note: `#[warn(clippy::doc_lazy_continuation)]` on by default [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 621 | /// to the identifier of a device. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/connection.rs:631:9 [INFO] [stdout] | [INFO] [stdout] 631 | /// 断开指定设备并移除连接 [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 631 | /// 断开指定设备并移除连接 [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/db/mod.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod db; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/device.rs:81:67 [INFO] [stdout] | [INFO] [stdout] 81 | pub static GLOBAL_DEVICE_MANAGER: Lazy = Lazy::new(|| DeviceManager::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DeviceManager::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/device.rs:130:13 [INFO] [stdout] | [INFO] [stdout] 130 | self.port.clone().unwrap_or_default(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.port` [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 `Option` which implements the `Copy` trait [INFO] [stdout] --> src/device.rs:131:13 [INFO] [stdout] | [INFO] [stdout] 131 | self.server_port.clone().unwrap_or_default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.server_port` [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 `DeviceStatus` which implements the `Copy` trait [INFO] [stdout] --> src/device.rs:144:21 [INFO] [stdout] | [INFO] [stdout] 144 | status: device.status.clone() as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `device.status` [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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/device.rs:146:25 [INFO] [stdout] | [INFO] [stdout] 146 | updated_at: device.updated_at.unwrap_or(0) as i32, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `device.updated_at.unwrap_or(0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/device.rs:231:34 [INFO] [stdout] | [INFO] [stdout] 231 | pub fn merge(&self, devices: &Vec) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 231 - pub fn merge(&self, devices: &Vec) -> Result<()> { [INFO] [stdout] 231 + pub fn merge(&self, devices: &[Device]) -> Result<()> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/device.rs:242:18 [INFO] [stdout] | [INFO] [stdout] 242 | .map(|d| DbDevice::from(d)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DbDevice::from` [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: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/device.rs:305:9 [INFO] [stdout] | [INFO] [stdout] 305 | Ok(dao::device::is_exist(&mut conn, device_id)?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 305 - Ok(dao::device::is_exist(&mut conn, device_id)?) [INFO] [stdout] 305 + dao::device::is_exist(&mut conn, device_id) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/device.rs:419:9 [INFO] [stdout] | [INFO] [stdout] 419 | assert_eq!(manager.has("test").unwrap(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 419 - assert_eq!(manager.has("test").unwrap(), true); [INFO] [stdout] 419 + assert!(manager.has("test").unwrap()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/device.rs:420:9 [INFO] [stdout] | [INFO] [stdout] 420 | assert_eq!(manager.has("test1").unwrap(), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 420 - assert_eq!(manager.has("test1").unwrap(), false); [INFO] [stdout] 420 + assert!(!manager.has("test1").unwrap()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/device.rs:485:17 [INFO] [stdout] | [INFO] [stdout] 485 | assert_eq!(d.self_device, true, "Self device flag not set correctly"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 485 - assert_eq!(d.self_device, true, "Self device flag not set correctly"); [INFO] [stdout] 485 + assert!(d.self_device, "Self device flag not set correctly"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip(..).next()` on an iterator [INFO] [stdout] --> src/file_metadata.rs:60:23 [INFO] [stdout] | [INFO] [stdout] 60 | url.split('/') [INFO] [stdout] | _______________________^ [INFO] [stdout] 61 | | .skip(3) // 跳过 "https:" 和两个空字符串 [INFO] [stdout] 62 | | .next() [INFO] [stdout] | |___________________^ help: use `nth` instead: `.nth(3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next [INFO] [stdout] = note: `#[warn(clippy::iter_skip_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/key_mouse_monitor.rs:20:21 [INFO] [stdout] | [INFO] [stdout] 20 | state_receiver: Arc)>>>, [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: unneeded late initialization [INFO] [stdout] --> src/network/webdav.rs:82:9 [INFO] [stdout] | [INFO] [stdout] 82 | let path: String; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `path` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 82 ~ [INFO] [stdout] 83 ~ let path: String = if dir == "/" { [INFO] [stdout] 84 ~ format!("/{}", filename) [INFO] [stdout] 85 | } else { [INFO] [stdout] 86 ~ format!("{}/{}", dir, filename) [INFO] [stdout] 87 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/network/webdav.rs:89:56 [INFO] [stdout] | [INFO] [stdout] 89 | let encrypted_payload = self.encryptor.encrypt(&json_payload.as_bytes())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json_payload.as_bytes()` [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/network/webdav.rs:190:49 [INFO] [stdout] | [INFO] [stdout] 190 | let meta = FileMetadata::from_list_file(&list_file, &self.client.host); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `list_file` [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/network/webdav.rs:220:49 [INFO] [stdout] | [INFO] [stdout] 220 | let meta = FileMetadata::from_list_file(&list_file, &self.client.host); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `list_file` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/network/websocket.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | writer: Arc< [INFO] [stdout] | _____________^ [INFO] [stdout] 34 | | Option< [INFO] [stdout] 35 | | Mutex< [INFO] [stdout] 36 | | futures_util::stream::SplitSink< [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#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/network/websocket.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | reader: Arc< [INFO] [stdout] | _____________^ [INFO] [stdout] 45 | | Option< [INFO] [stdout] 46 | | Mutex>>>, [INFO] [stdout] 47 | | >, [INFO] [stdout] 48 | | >, [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/network/websocket.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | / match message { [INFO] [stdout] 190 | | Message::Text(text) => { [INFO] [stdout] 191 | | let web_socket_message: WebSocketMessage = serde_json::from_str(&text)?; [INFO] [stdout] 192 | | if let WebSocketMessage::ClipboardSync(data) = web_socket_message { [INFO] [stdout] ... | [INFO] [stdout] 196 | | _ => {} [INFO] [stdout] 197 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 189 ~ if let Message::Text(text) = message { [INFO] [stdout] 190 + let web_socket_message: WebSocketMessage = serde_json::from_str(&text)?; [INFO] [stdout] 191 + if let WebSocketMessage::ClipboardSync(data) = web_socket_message { [INFO] [stdout] 192 + return Ok(Some(data)); [INFO] [stdout] 193 + } [INFO] [stdout] 194 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/network/websocket.rs:337:41 [INFO] [stdout] | [INFO] [stdout] 337 | devices: devices.iter().map(|d| DeviceSyncInfo::from(d)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DeviceSyncInfo::from` [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: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/network/websocket.rs:356:17 [INFO] [stdout] | [INFO] [stdout] 356 | / if let Message::Pong(msg) = msg { [INFO] [stdout] 357 | | trace!("Ping pong result: {:?}", msg); [INFO] [stdout] 358 | | return msg == rand_bytes_clone; [INFO] [stdout] 359 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/network/websocket.rs:355:23 [INFO] [stdout] | [INFO] [stdout] 355 | if let Ok(msg) = rx.recv().await { [INFO] [stdout] | ^^^ replace this binding [INFO] [stdout] 356 | if let Message::Pong(msg) = msg { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/remote_sync/webdav_sync.rs:30:25 [INFO] [stdout] | [INFO] [stdout] 30 | let base_path = format!("/uniclipboard"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"/uniclipboard".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `if let` [INFO] [stdout] --> src/web/handlers/websocket_message.rs:38:21 [INFO] [stdout] | [INFO] [stdout] 38 | / match message { [INFO] [stdout] 39 | | TungsteniteMessage::Text(text) => { [INFO] [stdout] 40 | | self_clone [INFO] [stdout] 41 | | .handle_message( [INFO] [stdout] ... | [INFO] [stdout] 47 | | _ => {} [INFO] [stdout] 48 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/web/handlers/websocket_message.rs:37:39 [INFO] [stdout] | [INFO] [stdout] 37 | if let Ok((device_id, message)) = message { [INFO] [stdout] | ^^^^^^^ replace this binding [INFO] [stdout] 38 | match message { [INFO] [stdout] 39 | TungsteniteMessage::Text(text) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/web/handlers/websocket_message.rs:38:21 [INFO] [stdout] | [INFO] [stdout] 38 | / match message { [INFO] [stdout] 39 | | TungsteniteMessage::Text(text) => { [INFO] [stdout] 40 | | self_clone [INFO] [stdout] 41 | | .handle_message( [INFO] [stdout] ... | [INFO] [stdout] 47 | | _ => {} [INFO] [stdout] 48 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 38 ~ if let TungsteniteMessage::Text(text) = message { [INFO] [stdout] 39 + self_clone [INFO] [stdout] 40 + .handle_message( [INFO] [stdout] 41 + WarpMessage::text(text), [INFO] [stdout] 42 + MessageSource::DeviceId(device_id), [INFO] [stdout] 43 + ) [INFO] [stdout] 44 + .await; [INFO] [stdout] 45 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/web/handlers/message_handler.rs:51:21 [INFO] [stdout] | [INFO] [stdout] 51 | d.server_port.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `d.server_port` [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 `Option` which implements the `Copy` trait [INFO] [stdout] --> src/web/handlers/message_handler.rs:52:21 [INFO] [stdout] | [INFO] [stdout] 52 | d.server_port.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `d.server_port` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/web/handlers/message_handler.rs:98:32 [INFO] [stdout] | [INFO] [stdout] 98 | devices.iter().map(|d| DeviceSyncInfo::from(d)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DeviceSyncInfo::from` [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: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/web/handlers/client.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | / reader.write().await.next().await.map(|msg| match msg { [INFO] [stdout] 133 | | Ok(msg) => { [INFO] [stdout] 134 | | let _ = message_tx.send(WebSocketMessage::Message(msg)); [INFO] [stdout] ... | [INFO] [stdout] 139 | | }); [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] 132 - reader.write().await.next().await.map(|msg| match msg { [INFO] [stdout] 133 - Ok(msg) => { [INFO] [stdout] 134 - let _ = message_tx.send(WebSocketMessage::Message(msg)); [INFO] [stdout] 135 - } [INFO] [stdout] 136 - Err(e) => { [INFO] [stdout] 137 - error!("Error receiving message from client: {}", e); [INFO] [stdout] 138 - } [INFO] [stdout] 139 - }); [INFO] [stdout] 132 + if let Some(msg) = reader.write().await.next().await { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/device.rs:384:41 [INFO] [stdout] | [INFO] [stdout] 384 | if let Some(db_name) = unsafe { DB_NAME.as_ref() } { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2m 00s [INFO] running `Command { std: "docker" "inspect" "897889cb3953c6728991201813aa3d423c218f60290214447c5a792576cfef94", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "897889cb3953c6728991201813aa3d423c218f60290214447c5a792576cfef94", kill_on_drop: false }` [INFO] [stdout] 897889cb3953c6728991201813aa3d423c218f60290214447c5a792576cfef94