[INFO] fetching crate tauri-plugin-ble 0.1.2... [INFO] linting tauri-plugin-ble-0.1.2 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate tauri-plugin-ble 0.1.2 into /workspace/builds/worker-5-tc1/source [INFO] started tweaking crates.io crate tauri-plugin-ble 0.1.2 [INFO] finished tweaking crates.io crate tauri-plugin-ble 0.1.2 [INFO] tweaked toml for crates.io crate tauri-plugin-ble 0.1.2 written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate tauri-plugin-ble 0.1.2 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate crates.io crate tauri-plugin-ble 0.1.2 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded serde_spanned v0.6.8 [INFO] [stderr] Downloaded tauri-plugin v2.3.0 [INFO] [stderr] Downloaded gdk-pixbuf-sys v0.18.0 [INFO] [stderr] Downloaded phf_macros v0.10.0 [INFO] [stderr] Downloaded nodrop v0.1.14 [INFO] [stderr] Downloaded field-offset v0.3.6 [INFO] [stderr] Downloaded infer v0.19.0 [INFO] [stderr] Downloaded gtk3-macros v0.18.2 [INFO] [stderr] Downloaded gdkx11-sys v0.18.2 [INFO] [stderr] Downloaded redox_syscall v0.5.11 [INFO] [stderr] Downloaded phf_shared v0.10.0 [INFO] [stderr] Downloaded pango v0.18.3 [INFO] [stderr] Downloaded socket2 v0.5.9 [INFO] [stderr] Downloaded objc2-core-data v0.3.1 [INFO] [stderr] Downloaded toml_edit v0.20.7 [INFO] [stderr] Downloaded vswhom-sys v0.1.3 [INFO] [stderr] Downloaded dlopen2_derive v0.4.0 [INFO] [stderr] Downloaded gdkwayland-sys v0.18.2 [INFO] [stderr] Downloaded dpi v0.1.1 [INFO] [stderr] Downloaded num_enum_derive v0.7.3 [INFO] [stderr] Downloaded vswhom v0.1.0 [INFO] [stderr] Downloaded core-graphics v0.24.0 [INFO] [stderr] Downloaded siphasher v0.3.11 [INFO] [stderr] Downloaded winreg v0.52.0 [INFO] [stderr] Downloaded br-ble v0.2.0 [INFO] [stderr] Downloaded softbuffer v0.4.6 [INFO] [stderr] Downloaded hyper-util v0.1.11 [INFO] [stderr] Downloaded json v0.12.4 [INFO] [stderr] Downloaded io-uring v0.7.8 [INFO] [stderr] Downloaded objc2 v0.6.1 [INFO] [stderr] Downloaded x11 v2.21.0 [INFO] [stderr] Downloaded serialize-to-javascript v0.1.1 [INFO] [stderr] Downloaded gtk v0.18.2 [INFO] [stderr] Downloaded objc2-foundation v0.3.1 [INFO] [stderr] Downloaded toml_write v0.1.1 [INFO] [stderr] Downloaded keyboard-types v0.7.0 [INFO] [stderr] Downloaded objc2-ui-kit v0.3.1 [INFO] [stderr] Downloaded objc2-core-image v0.3.1 [INFO] [stderr] Downloaded objc2-quartz-core v0.3.1 [INFO] [stderr] Downloaded window-vibrancy v0.6.0 [INFO] [stderr] Downloaded tokio v1.46.1 [INFO] [stderr] Downloaded tauri-runtime-wry v2.7.1 [INFO] [stderr] Downloaded glib v0.18.5 [INFO] [stderr] Downloaded dispatch2 v0.3.0 [INFO] [stderr] Downloaded selectors v0.24.0 [INFO] [stderr] Downloaded objc2-cloud-kit v0.3.1 [INFO] [stderr] Downloaded phf_generator v0.10.0 [INFO] [stderr] Downloaded cairo-sys-rs v0.18.2 [INFO] [stderr] Downloaded cairo-rs v0.18.5 [INFO] [stderr] Downloaded gdk-sys v0.18.2 [INFO] [stderr] Downloaded gio-sys v0.18.1 [INFO] [stderr] Downloaded tao v0.34.0 [INFO] [stderr] Downloaded plist v1.7.1 [INFO] [stderr] Downloaded urlpattern v0.3.0 [INFO] [stderr] Downloaded webview2-com-macros v0.8.0 [INFO] [stderr] Downloaded camino v1.1.9 [INFO] [stderr] Downloaded tauri v2.6.2 [INFO] [stderr] Downloaded json-patch v3.0.1 [INFO] [stderr] Downloaded markup5ever v0.14.1 [INFO] [stderr] Downloaded matches v0.1.10 [INFO] [stderr] Downloaded erased-serde v0.4.6 [INFO] [stderr] Downloaded toml v0.8.22 [INFO] [stderr] Downloaded pango-sys v0.18.0 [INFO] [stderr] Downloaded gobject-sys v0.18.0 [INFO] [stderr] Downloaded webview2-com-sys v0.38.0 [INFO] [stderr] Downloaded libappindicator v0.9.0 [INFO] [stderr] Downloaded gdk v0.18.2 [INFO] [stderr] Downloaded objc2-core-graphics v0.3.1 [INFO] [stderr] Downloaded serde-untagged v0.1.7 [INFO] [stderr] Downloaded serialize-to-javascript-impl v0.1.1 [INFO] [stderr] Downloaded cargo_toml v0.22.1 [INFO] [stderr] Downloaded tauri-build v2.3.0 [INFO] [stderr] Downloaded tauri-codegen v2.3.0 [INFO] [stderr] Downloaded tauri-macros v2.3.1 [INFO] [stderr] Downloaded core-foundation v0.10.0 [INFO] [stderr] Downloaded dlopen2 v0.7.0 [INFO] [stderr] Downloaded tauri-runtime v2.7.0 [INFO] [stderr] Downloaded phf v0.10.1 [INFO] [stderr] Downloaded embed-resource v3.0.2 [INFO] [stderr] Downloaded tauri-winres v0.3.0 [INFO] [stderr] Downloaded schemars v0.8.22 [INFO] [stderr] Downloaded tauri-utils v2.5.0 [INFO] [stderr] Downloaded flate2 v1.1.1 [INFO] [stderr] Downloaded ico v0.4.0 [INFO] [stderr] Downloaded num_enum v0.7.3 [INFO] [stderr] Downloaded signal-hook-registry v1.4.5 [INFO] [stderr] Downloaded html5ever v0.29.1 [INFO] [stderr] Downloaded proc-macro-crate v2.0.0 [INFO] [stderr] Downloaded soup3-sys v0.5.0 [INFO] [stderr] Downloaded webview2-com v0.38.0 [INFO] [stderr] Downloaded ctor v0.2.9 [INFO] [stderr] Downloaded match_token v0.1.0 [INFO] [stderr] Downloaded rand_pcg v0.2.1 [INFO] [stderr] Downloaded phf_codegen v0.8.0 [INFO] [stderr] Downloaded serde_with_macros v3.12.0 [INFO] [stderr] Downloaded swift-rs v1.0.7 [INFO] [stderr] Downloaded unic-ucd-ident v0.9.0 [INFO] [stderr] Downloaded smallvec v1.15.0 [INFO] [stderr] Downloaded gdkx11 v0.18.2 [INFO] [stderr] Downloaded libappindicator-sys v0.9.0 [INFO] [stderr] Downloaded muda v0.17.0 [INFO] [stderr] Downloaded atk v0.18.2 [INFO] [stderr] Downloaded javascriptcore-rs v1.1.2 [INFO] [stderr] Downloaded gio v0.18.4 [INFO] [stderr] Downloaded glib-macros v0.18.5 [INFO] [stderr] Downloaded atk-sys v0.18.2 [INFO] [stderr] Downloaded webkit2gtk-sys v2.0.1 [INFO] [stderr] Downloaded objc2-app-kit v0.3.1 [INFO] [stderr] Downloaded block2 v0.6.1 [INFO] [stderr] Downloaded gdk-pixbuf v0.18.5 [INFO] [stderr] Downloaded phf_generator v0.8.0 [INFO] [stderr] Downloaded dyn-clone v1.0.19 [INFO] [stderr] Downloaded toml_datetime v0.6.9 [INFO] [stderr] Downloaded cargo_metadata v0.19.2 [INFO] [stderr] Downloaded jsonptr v0.6.3 [INFO] [stderr] Downloaded derive_more v0.99.19 [INFO] [stderr] Downloaded tao-macros v0.1.3 [INFO] [stderr] Downloaded cc v1.2.19 [INFO] [stderr] Downloaded serde_with v3.12.0 [INFO] [stderr] Downloaded toml_edit v0.22.26 [INFO] [stderr] Downloaded crc32fast v1.4.2 [INFO] [stderr] Downloaded bytemuck v1.22.0 [INFO] [stderr] Downloaded tray-icon v0.21.0 [INFO] [stderr] Downloaded gtk-sys v0.18.2 [INFO] [stderr] Downloaded glib-sys v0.18.1 [INFO] [stderr] Downloaded webkit2gtk v2.0.1 [INFO] [stderr] Downloaded quick-xml v0.32.0 [INFO] [stderr] Downloaded cfb v0.7.3 [INFO] [stderr] Downloaded cssparser v0.29.6 [INFO] [stderr] Downloaded phf v0.8.0 [INFO] [stderr] Downloaded servo_arc v0.2.0 [INFO] [stderr] Downloaded schemars_derive v0.8.22 [INFO] [stderr] Downloaded soup3 v0.5.0 [INFO] [stderr] Downloaded phf_shared v0.8.0 [INFO] [stderr] Downloaded kuchikiki v0.8.8-speedreader [INFO] [stderr] Downloaded javascriptcore-rs-sys v1.1.1 [INFO] [stderr] Downloaded objc2-exception-helper v0.1.1 [INFO] [stderr] Downloaded proc-macro-hack v0.5.20+deprecated [INFO] [stderr] Downloaded objc2-io-surface v0.3.1 [INFO] [stderr] Downloaded wry v0.52.1 [INFO] [stderr] Downloaded embed_plist v1.2.2 [INFO] [stderr] Downloaded objc2-web-kit v0.3.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] dcc1c413827de3efd9ae9e0bf540f028e67c320e7558f4a85eb8ea6be5e9d71c [INFO] running `Command { std: "docker" "start" "-a" "dcc1c413827de3efd9ae9e0bf540f028e67c320e7558f4a85eb8ea6be5e9d71c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "dcc1c413827de3efd9ae9e0bf540f028e67c320e7558f4a85eb8ea6be5e9d71c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "dcc1c413827de3efd9ae9e0bf540f028e67c320e7558f4a85eb8ea6be5e9d71c", kill_on_drop: false }` [INFO] [stdout] dcc1c413827de3efd9ae9e0bf540f028e67c320e7558f4a85eb8ea6be5e9d71c [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] bad859a64025da46b459ad4c82134011eda82d6129e11cc60f2814ff46b1b982 [INFO] running `Command { std: "docker" "start" "-a" "bad859a64025da46b459ad4c82134011eda82d6129e11cc60f2814ff46b1b982", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.95 [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Compiling libc v0.2.172 [INFO] [stderr] Compiling smallvec v1.15.0 [INFO] [stderr] Compiling toml_write v0.1.1 [INFO] [stderr] Compiling winnow v0.7.12 [INFO] [stderr] Compiling target-lexicon v0.12.16 [INFO] [stderr] Compiling version-compare v0.2.0 [INFO] [stderr] Compiling cfg-if v1.0.0 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Compiling zerocopy v0.8.24 [INFO] [stderr] Checking memchr v2.7.4 [INFO] [stderr] Compiling stable_deref_trait v1.2.0 [INFO] [stderr] Compiling siphasher v1.0.1 [INFO] [stderr] Compiling quote v1.0.40 [INFO] [stderr] Compiling cfg-expr v0.15.8 [INFO] [stderr] Compiling semver v1.0.26 [INFO] [stderr] Compiling phf_shared v0.11.3 [INFO] [stderr] Compiling syn v2.0.100 [INFO] [stderr] Compiling getrandom v0.2.15 [INFO] [stderr] Compiling winnow v0.5.40 [INFO] [stderr] Compiling getrandom v0.3.2 [INFO] [stderr] Compiling rand_core v0.6.4 [INFO] [stderr] Compiling proc-macro-error-attr v1.0.4 [INFO] [stderr] Compiling siphasher v0.3.11 [INFO] [stderr] Compiling proc-macro-error v1.0.4 [INFO] [stderr] Compiling getrandom v0.1.16 [INFO] [stderr] Compiling fnv v1.0.7 [INFO] [stderr] Checking futures-core v0.3.31 [INFO] [stderr] Compiling litemap v0.7.5 [INFO] [stderr] Compiling writeable v0.5.5 [INFO] [stderr] Compiling typeid v1.0.3 [INFO] [stderr] Compiling rand_core v0.5.1 [INFO] [stderr] Compiling ident_case v1.0.1 [INFO] [stderr] Compiling strsim v0.11.1 [INFO] [stderr] Compiling heck v0.4.1 [INFO] [stderr] Compiling ppv-lite86 v0.2.21 [INFO] [stderr] Checking futures-channel v0.3.31 [INFO] [stderr] Compiling icu_locid_transform_data v1.5.1 [INFO] [stderr] Compiling rand_pcg v0.2.1 [INFO] [stderr] Compiling phf_shared v0.8.0 [INFO] [stderr] Compiling icu_properties_data v1.5.1 [INFO] [stderr] Compiling proc-macro-hack v0.5.20+deprecated [INFO] [stderr] Compiling phf_shared v0.10.0 [INFO] [stderr] Compiling icu_normalizer_data v1.5.1 [INFO] [stderr] Compiling anyhow v1.0.98 [INFO] [stderr] Compiling write16 v1.0.0 [INFO] [stderr] Compiling scopeguard v1.2.0 [INFO] [stderr] Compiling rand_chacha v0.3.1 [INFO] [stderr] Compiling rand_chacha v0.2.2 [INFO] [stderr] Compiling utf16_iter v1.0.5 [INFO] [stderr] Compiling byteorder v1.5.0 [INFO] [stderr] Compiling rand v0.7.3 [INFO] [stderr] Compiling new_debug_unreachable v1.0.6 [INFO] [stderr] Compiling utf8_iter v1.0.4 [INFO] [stderr] Compiling serde_json v1.0.140 [INFO] [stderr] Compiling lock_api v0.4.12 [INFO] [stderr] Compiling rand v0.8.5 [INFO] [stderr] Compiling parking_lot_core v0.9.10 [INFO] [stderr] Compiling precomputed-hash v0.1.1 [INFO] [stderr] Compiling gio v0.18.4 [INFO] [stderr] Compiling mac v0.1.1 [INFO] [stderr] Compiling futf v0.1.5 [INFO] [stderr] Compiling parking_lot v0.12.3 [INFO] [stderr] Compiling log v0.4.27 [INFO] [stderr] Compiling dtoa v1.0.10 [INFO] [stderr] Compiling percent-encoding v2.3.1 [INFO] [stderr] Compiling utf-8 v0.7.6 [INFO] [stderr] Compiling bitflags v1.3.2 [INFO] [stderr] Compiling form_urlencoded v1.2.1 [INFO] [stderr] Compiling tendril v0.4.3 [INFO] [stderr] Compiling phf_generator v0.8.0 [INFO] [stderr] Compiling dtoa-short v0.3.5 [INFO] [stderr] Compiling aho-corasick v1.1.3 [INFO] [stderr] Compiling indexmap v1.9.3 [INFO] [stderr] Compiling camino v1.1.9 [INFO] [stderr] Compiling phf_codegen v0.8.0 [INFO] [stderr] Compiling phf_generator v0.11.3 [INFO] [stderr] Compiling phf_generator v0.10.0 [INFO] [stderr] Compiling selectors v0.24.0 [INFO] [stderr] Compiling string_cache_codegen v0.5.4 [INFO] [stderr] Compiling phf_codegen v0.11.3 [INFO] [stderr] Compiling regex-syntax v0.8.5 [INFO] [stderr] Compiling unic-common v0.9.0 [INFO] [stderr] Compiling nodrop v0.1.14 [INFO] [stderr] Compiling matches v0.1.10 [INFO] [stderr] Compiling convert_case v0.4.0 [INFO] [stderr] Compiling unic-char-range v0.9.0 [INFO] [stderr] Compiling alloc-no-stdlib v2.0.4 [INFO] [stderr] Compiling unic-char-property v0.9.0 [INFO] [stderr] Compiling servo_arc v0.2.0 [INFO] [stderr] Compiling alloc-stdlib v0.2.2 [INFO] [stderr] Compiling unic-ucd-version v0.9.0 [INFO] [stderr] Compiling markup5ever v0.14.1 [INFO] [stderr] Compiling fxhash v0.2.1 [INFO] [stderr] Compiling phf v0.8.0 [INFO] [stderr] Compiling schemars v0.8.22 [INFO] [stderr] Compiling hashbrown v0.12.3 [INFO] [stderr] Compiling brotli-decompressor v5.0.0 [INFO] [stderr] Compiling unic-ucd-ident v0.9.0 [INFO] [stderr] Compiling bytes v1.10.1 [INFO] [stderr] Compiling dyn-clone v1.0.19 [INFO] [stderr] Compiling same-file v1.0.6 [INFO] [stderr] Compiling walkdir v2.5.0 [INFO] [stderr] Compiling glob v0.3.2 [INFO] [stderr] Compiling synstructure v0.13.1 [INFO] [stderr] Compiling darling_core v0.20.11 [INFO] [stderr] Compiling serde_derive_internals v0.29.1 [INFO] [stderr] Compiling brotli v8.0.1 [INFO] [stderr] Compiling regex-automata v0.4.9 [INFO] [stderr] Compiling http v1.3.1 [INFO] [stderr] Compiling dunce v1.0.5 [INFO] [stderr] Compiling once_cell v1.21.3 [INFO] [stderr] Compiling typenum v1.18.0 [INFO] [stderr] Compiling gtk v0.18.2 [INFO] [stderr] Compiling generic-array v0.14.7 [INFO] [stderr] Compiling x11 v2.21.0 [INFO] [stderr] Compiling cssparser v0.29.6 [INFO] [stderr] Compiling phf_macros v0.10.0 [INFO] [stderr] Compiling simd-adler32 v0.3.7 [INFO] [stderr] Compiling cc v1.2.19 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.7.5 [INFO] [stderr] Compiling zerovec-derive v0.10.3 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling icu_provider_macros v1.5.0 [INFO] [stderr] Compiling zerofrom v0.1.6 [INFO] [stderr] Compiling yoke v0.7.5 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling thiserror-impl v2.0.12 [INFO] [stderr] Compiling phf_macros v0.11.3 [INFO] [stderr] Compiling zerovec v0.10.4 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Compiling darling_macro v0.20.11 [INFO] [stderr] Compiling phf v0.11.3 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Compiling phf v0.10.1 [INFO] [stderr] Compiling darling v0.20.11 [INFO] [stderr] Compiling serde_with_macros v3.12.0 [INFO] [stderr] Compiling cssparser-macros v0.6.1 [INFO] [stderr] Compiling ctor v0.2.9 [INFO] [stderr] Compiling derive_more v0.99.19 [INFO] [stderr] Compiling tinystr v0.7.6 [INFO] [stderr] Compiling icu_collections v1.5.0 [INFO] [stderr] Compiling icu_locid v1.5.0 [INFO] [stderr] Compiling match_token v0.1.0 [INFO] [stderr] Checking futures-executor v0.3.31 [INFO] [stderr] Compiling thiserror v2.0.12 [INFO] [stderr] Compiling regex v1.11.1 [INFO] [stderr] Compiling schemars_derive v0.8.22 [INFO] [stderr] Compiling icu_provider v1.5.0 [INFO] [stderr] Checking hashbrown v0.15.2 [INFO] [stderr] Compiling icu_locid_transform v1.5.0 [INFO] [stderr] Compiling crossbeam-utils v0.8.21 [INFO] [stderr] Compiling option-ext v0.2.0 [INFO] [stderr] Compiling time-core v0.1.4 [INFO] [stderr] Compiling adler2 v2.0.0 [INFO] [stderr] Checking icu_properties v1.5.1 [INFO] [stderr] Compiling num-conv v0.1.0 [INFO] [stderr] Compiling time-macros v0.2.22 [INFO] [stderr] Compiling miniz_oxide v0.8.8 [INFO] [stderr] Checking deranged v0.4.0 [INFO] [stderr] Checking bitflags v2.9.0 [INFO] [stderr] Checking uuid v1.16.0 [INFO] [stderr] Checking serde_spanned v0.6.8 [INFO] [stderr] Checking toml_datetime v0.6.9 [INFO] [stderr] Checking dpi v0.1.1 [INFO] [stderr] Compiling dirs-sys v0.5.0 [INFO] [stderr] Checking indexmap v2.9.0 [INFO] [stderr] Compiling toml_edit v0.22.26 [INFO] [stderr] Compiling toml_edit v0.20.7 [INFO] [stderr] Compiling rustc_version v0.4.1 [INFO] [stderr] Compiling string_cache v0.8.9 [INFO] [stderr] Compiling cfb v0.7.3 [INFO] [stderr] Compiling erased-serde v0.4.6 [INFO] [stderr] Compiling icu_normalizer v1.5.0 [INFO] [stderr] Compiling html5ever v0.29.1 [INFO] [stderr] Compiling jsonptr v0.6.3 [INFO] [stderr] Compiling cargo-platform v0.1.9 [INFO] [stderr] Compiling serde-untagged v0.1.7 [INFO] [stderr] Compiling infer v0.19.0 [INFO] [stderr] Compiling cargo_metadata v0.19.2 [INFO] [stderr] Compiling json-patch v3.0.1 [INFO] [stderr] Compiling field-offset v0.3.6 [INFO] [stderr] Compiling idna_adapter v1.2.0 [INFO] [stderr] Compiling toml_edit v0.19.15 [INFO] [stderr] Compiling idna v1.0.3 [INFO] [stderr] Compiling proc-macro-crate v2.0.0 [INFO] [stderr] Compiling url v2.5.4 [INFO] [stderr] Compiling toml v0.8.22 [INFO] [stderr] Compiling kuchikiki v0.8.8-speedreader [INFO] [stderr] Compiling serde_with v3.12.0 [INFO] [stderr] Compiling system-deps v6.2.2 [INFO] [stderr] Compiling urlpattern v0.3.0 [INFO] [stderr] Compiling glib-macros v0.18.5 [INFO] [stderr] Compiling glib-sys v0.18.1 [INFO] [stderr] Compiling gobject-sys v0.18.0 [INFO] [stderr] Compiling gio-sys v0.18.1 [INFO] [stderr] Compiling gdk-sys v0.18.2 [INFO] [stderr] Compiling cairo-sys-rs v0.18.2 [INFO] [stderr] Compiling pango-sys v0.18.0 [INFO] [stderr] Compiling gdk-pixbuf-sys v0.18.0 [INFO] [stderr] Compiling atk-sys v0.18.2 [INFO] [stderr] Compiling gtk-sys v0.18.2 [INFO] [stderr] Compiling proc-macro-crate v1.3.1 [INFO] [stderr] Compiling javascriptcore-rs-sys v1.1.1 [INFO] [stderr] Compiling soup3-sys v0.5.0 [INFO] [stderr] Compiling tauri-utils v2.5.0 [INFO] [stderr] Compiling webkit2gtk-sys v2.0.1 [INFO] [stderr] Compiling gdkx11-sys v0.18.2 [INFO] [stderr] Compiling embed-resource v3.0.2 [INFO] [stderr] Compiling cookie v0.18.1 [INFO] [stderr] Compiling gtk3-macros v0.18.2 [INFO] [stderr] Compiling crc32fast v1.4.2 [INFO] [stderr] Compiling x11-dl v2.21.0 [INFO] [stderr] Checking time v0.3.41 [INFO] [stderr] Compiling flate2 v1.1.1 [INFO] [stderr] Checking glib v0.18.5 [INFO] [stderr] Compiling tauri-winres v0.3.0 [INFO] [stderr] Compiling cargo_toml v0.22.1 [INFO] [stderr] Compiling dirs v6.0.0 [INFO] [stderr] Compiling crypto-common v0.1.6 [INFO] [stderr] Compiling block-buffer v0.10.4 [INFO] [stderr] Compiling fdeflate v0.3.7 [INFO] [stderr] Checking raw-window-handle v0.6.2 [INFO] [stderr] Checking crossbeam-channel v0.5.15 [INFO] [stderr] Compiling png v0.17.16 [INFO] [stderr] Compiling digest v0.10.7 [INFO] [stderr] Compiling dlopen2_derive v0.4.0 [INFO] [stderr] Compiling tauri-runtime v2.7.0 [INFO] [stderr] Compiling cpufeatures v0.2.17 [INFO] [stderr] Compiling wry v0.52.1 [INFO] [stderr] Compiling sha2 v0.10.9 [INFO] [stderr] Checking dlopen2 v0.7.0 [INFO] [stderr] Compiling ico v0.4.0 [INFO] [stderr] Checking gdkwayland-sys v0.18.2 [INFO] [stderr] Compiling tokio-macros v2.5.0 [INFO] [stderr] Compiling base64 v0.22.1 [INFO] [stderr] Checking unicode-segmentation v1.12.0 [INFO] [stderr] Compiling tauri-runtime-wry v2.7.1 [INFO] [stderr] Checking tokio v1.46.1 [INFO] [stderr] Compiling serialize-to-javascript-impl v0.1.1 [INFO] [stderr] Compiling serde_repr v0.1.20 [INFO] [stderr] Checking keyboard-types v0.7.0 [INFO] [stderr] Checking serialize-to-javascript v0.1.1 [INFO] [stderr] Checking json v0.12.4 [INFO] [stderr] Checking heck v0.5.0 [INFO] [stderr] Checking iana-time-zone v0.1.63 [INFO] [stderr] Checking chrono v0.4.41 [INFO] [stderr] Checking cairo-rs v0.18.5 [INFO] [stderr] Checking atk v0.18.2 [INFO] [stderr] Checking javascriptcore-rs v1.1.2 [INFO] [stderr] Checking br-ble v0.2.0 [INFO] [stderr] Compiling tauri-build v2.3.0 [INFO] [stderr] Compiling tauri-codegen v2.3.0 [INFO] [stderr] Compiling tauri-plugin v2.3.0 [INFO] [stderr] Compiling tauri v2.6.2 [INFO] [stderr] Compiling tauri-macros v2.3.1 [INFO] [stderr] Compiling tauri-plugin-ble v0.1.2 (/opt/rustwide/workdir) [INFO] [stderr] Checking pango v0.18.3 [INFO] [stderr] Checking gdk-pixbuf v0.18.5 [INFO] [stderr] Checking soup3 v0.5.0 [INFO] [stderr] Checking gdk v0.18.2 [INFO] [stderr] Checking gdkx11 v0.18.2 [INFO] [stderr] Checking webkit2gtk v2.0.1 [INFO] [stderr] Checking tao v0.34.0 [INFO] [stderr] Checking muda v0.17.0 [INFO] [stdout] warning: function `discover_list` is never used [INFO] [stdout] --> src/device/mod.rs:94:8 [INFO] [stdout] | [INFO] [stdout] 94 | pub fn discover_list() -> 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: function `connect_device` is never used [INFO] [stdout] --> src/device/mod.rs:129:8 [INFO] [stdout] | [INFO] [stdout] 129 | pub fn connect_device(id: String) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `disconnected` is never used [INFO] [stdout] --> src/device/mod.rs:138:8 [INFO] [stdout] | [INFO] [stdout] 138 | pub fn disconnected(id: String) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `work_mode_device` is never used [INFO] [stdout] --> src/device/mod.rs:159:8 [INFO] [stdout] | [INFO] [stdout] 159 | pub fn work_mode_device(id: String, work_mode: String) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `set_device_zero` is never used [INFO] [stdout] --> src/device/mod.rs:172:8 [INFO] [stdout] | [INFO] [stdout] 172 | pub fn set_device_zero(id: String) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `zero` is never read [INFO] [stdout] --> src/device/mod.rs:218:9 [INFO] [stdout] | [INFO] [stdout] 182 | pub struct Device { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 218 | pub zero: bool, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Device` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Usb`, `File`, `Hid`, and `None` are never constructed [INFO] [stdout] --> src/device/mod.rs:293:5 [INFO] [stdout] | [INFO] [stdout] 289 | pub enum Types { [INFO] [stdout] | ----- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 293 | Usb, [INFO] [stdout] | ^^^ [INFO] [stdout] 294 | /// 文件解析设备 [INFO] [stdout] 295 | File, [INFO] [stdout] | ^^^^ [INFO] [stdout] 296 | /// 蓝牙HID设备 [INFO] [stdout] 297 | Hid, [INFO] [stdout] | ^^^ [INFO] [stdout] 298 | None, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Types` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `from` is never used [INFO] [stdout] --> src/device/mod.rs:311:8 [INFO] [stdout] | [INFO] [stdout] 301 | impl Types { [INFO] [stdout] | ---------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 311 | fn from(name: &str) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `SpiritLevel`, `Gyroscope`, `Potentiometer`, `Instrument`, `ScanCode`, and `None` are never constructed [INFO] [stdout] --> src/device/mod.rs:325:5 [INFO] [stdout] | [INFO] [stdout] 323 | pub enum Mode { [INFO] [stdout] | ---- variants in this enum [INFO] [stdout] 324 | /// 水平仪 [INFO] [stdout] 325 | SpiritLevel, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] 326 | /// 陀螺仪 [INFO] [stdout] 327 | Gyroscope, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 331 | Potentiometer, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 332 | /// 仪器 [INFO] [stdout] 333 | Instrument, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 334 | /// 扫码抢 [INFO] [stdout] 335 | ScanCode, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 336 | /// 未知 [INFO] [stdout] 337 | None, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Mode` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `from` is never used [INFO] [stdout] --> src/device/mod.rs:352:8 [INFO] [stdout] | [INFO] [stdout] 340 | impl Mode { [INFO] [stdout] | --------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 352 | fn from(name: &str) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `ConnectionState` is never used [INFO] [stdout] --> src/device/mod.rs:367:10 [INFO] [stdout] | [INFO] [stdout] 367 | pub enum ConnectionState { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `str` is never used [INFO] [stdout] --> src/device/mod.rs:381:8 [INFO] [stdout] | [INFO] [stdout] 380 | impl ConnectionState { [INFO] [stdout] | -------------------- method in this implementation [INFO] [stdout] 381 | fn str(&mut self) -> &'static str { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Dormancy`, `Abnormal`, `Disabled`, `ConnectionFailed`, and `Unconnected` are never constructed [INFO] [stdout] --> src/device/mod.rs:397:5 [INFO] [stdout] | [INFO] [stdout] 395 | pub enum ErrState { [INFO] [stdout] | -------- variants in this enum [INFO] [stdout] 396 | /// 休眠 [INFO] [stdout] 397 | Dormancy, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 398 | /// 异常 [INFO] [stdout] 399 | Abnormal, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 400 | /// 禁用 [INFO] [stdout] 401 | Disabled, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 402 | /// 连接失败 [INFO] [stdout] 403 | ConnectionFailed, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] 404 | /// 断开连接 [INFO] [stdout] 405 | Unconnected, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ErrState` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Data` is never constructed [INFO] [stdout] --> src/device/mod.rs:410:12 [INFO] [stdout] | [INFO] [stdout] 410 | pub struct Data { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `json` is never used [INFO] [stdout] --> src/device/mod.rs:460:12 [INFO] [stdout] | [INFO] [stdout] 459 | impl Data { [INFO] [stdout] | --------- method in this implementation [INFO] [stdout] 460 | pub fn json(self) -> JsonValue { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `ConnectFailed` and `Removed` are never constructed [INFO] [stdout] --> src/device/mod.rs:493:5 [INFO] [stdout] | [INFO] [stdout] 480 | pub enum Status { [INFO] [stdout] | ------ variants in this enum [INFO] [stdout] ... [INFO] [stdout] 493 | ConnectFailed, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 494 | /// 移除 [INFO] [stdout] 495 | Removed, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Status` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `from` is never used [INFO] [stdout] --> src/device/mod.rs:513:12 [INFO] [stdout] | [INFO] [stdout] 499 | impl Status { [INFO] [stdout] | ----------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 513 | pub fn from(name: &str) -> Status { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/device/ble/mod.rs:45:9 [INFO] [stdout] | [INFO] [stdout] 45 | LVH(Lvh), [INFO] [stdout] | --- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `BleModel` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 45 - LVH(Lvh), [INFO] [stdout] 45 + LVH(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `id` is never read [INFO] [stdout] --> src/device/ble/lvh.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct Lvh { [INFO] [stdout] | --- field in this struct [INFO] [stdout] 5 | pub id: String, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `Lvh` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Wt90` is never constructed [INFO] [stdout] --> src/device/ble/wt90.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Wt90 {} [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `a_xyz`, `w_xyz`, `angle_x`, `angle_y`, and `angle_z` are never used [INFO] [stdout] --> src/device/ble/wt90.rs:7:12 [INFO] [stdout] | [INFO] [stdout] 5 | impl Wt90 { [INFO] [stdout] | --------- associated functions in this implementation [INFO] [stdout] 6 | /// 加速度 [INFO] [stdout] 7 | pub fn a_xyz(mut data: Vec) -> f64 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 18 | pub fn w_xyz(mut data: Vec) -> f64 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 28 | pub fn angle_x(mut data: Vec) -> f64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 38 | pub fn angle_y(mut data: Vec) -> f64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 48 | pub fn angle_z(mut data: Vec) -> f64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `QDLY` contains a capitalized acronym [INFO] [stdout] --> src/device/ble/qdly.rs:8:12 [INFO] [stdout] | [INFO] [stdout] 8 | pub struct QDLY { [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Qdly` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LVH` contains a capitalized acronym [INFO] [stdout] --> src/device/ble/mod.rs:45:5 [INFO] [stdout] | [INFO] [stdout] 45 | LVH(Lvh), [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Lvh` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `GRL` contains a capitalized acronym [INFO] [stdout] --> src/device/ble/mod.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | GRL(Grl), [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Grl` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `QDLY` contains a capitalized acronym [INFO] [stdout] --> src/device/ble/mod.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | QDLY(QDLY), [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Qdly` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/device/ble/mod.rs:272:9 [INFO] [stdout] | [INFO] [stdout] 272 | / match match BleModel::from(&device.name, &device.id) { [INFO] [stdout] 273 | | BleModel::HL(mut e) => e.decode(data.clone()), [INFO] [stdout] 274 | | BleModel::GL(mut e) => e.decode(data.clone()), [INFO] [stdout] 275 | | BleModel::GR(mut e) => e.decode(data.clone()), [INFO] [stdout] ... | [INFO] [stdout] 414 | | Err(_) => {} [INFO] [stdout] 415 | | }; [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] 272 ~ if let Ok((mut sub_id, mut number)) = match BleModel::from(&device.name, &device.id) { [INFO] [stdout] 273 + BleModel::HL(mut e) => e.decode(data.clone()), [INFO] [stdout] 274 + BleModel::GL(mut e) => e.decode(data.clone()), [INFO] [stdout] 275 + BleModel::GR(mut e) => e.decode(data.clone()), [INFO] [stdout] 276 + BleModel::GRL(mut e) => e.decode(data.clone()), [INFO] [stdout] 277 + BleModel::TM(mut e) => e.decode(data.clone()), [INFO] [stdout] 278 + BleModel::BarCode(mut e) => e.decode(data.clone()), [INFO] [stdout] 279 + BleModel::QDLY(mut e) => e.decode(data.clone()), [INFO] [stdout] 280 + _ => return, [INFO] [stdout] 281 + } { [INFO] [stdout] 282 ~ // 处理气动量仪数据 - 考虑加一个东本的feature [INFO] [stdout] 283 + // number:0,1091A8301350,+1514.4182 [INFO] [stdout] 284 ~ // 这里的mac地址末尾+2才是蓝牙地址 [INFO] [stdout] 285 + if device.name.contains("Dasqua PMI") { [INFO] [stdout] 286 + let data_vec = number.split(',').map(|x| x.to_string()).collect::>(); [INFO] [stdout] 287 ~ // 如果切分出来的数组长度小于3,直接抛弃 [INFO] [stdout] 288 + if data_vec.len() < 3 { [INFO] [stdout] 289 + return; [INFO] [stdout] 290 + } [INFO] [stdout] 291 + let mut mac_vec = data_vec[1] [INFO] [stdout] 292 ~ .chars() // 遍历字符 [INFO] [stdout] 293 ~ .collect::>() // 转为 Vec [INFO] [stdout] 294 ~ .chunks_exact(2) // 每2个字符一组 [INFO] [stdout] 295 ~ .map(|chunk| chunk.iter().collect::()) // 每组转为字符串 [INFO] [stdout] 296 ~ .collect::>(); // 收集为 Vec [INFO] [stdout] 297 + let mac_last_cell = mac_vec.last().unwrap(); [INFO] [stdout] 298 + let num_mac = u32::from_str_radix(mac_last_cell, 16).unwrap(); [INFO] [stdout] 299 ~ // 这里的mac地址末尾+2才是蓝牙地址 [INFO] [stdout] 300 ~ let real_last_cell = format!("{:X}", num_mac + 2); // 大写十六进制 [INFO] [stdout] 301 + mac_vec.remove(mac_vec.len() - 1); [INFO] [stdout] 302 + mac_vec.push(real_last_cell); [INFO] [stdout] 303 + let real_mac = mac_vec.join(":").to_lowercase(); [INFO] [stdout] 304 + // println!("real_mac: {}", real_mac); [INFO] [stdout] 305 + [INFO] [stdout] 306 ~ // 如果是从站,执行初始化设备的流程 [INFO] [stdout] 307 + if !data_vec[0].eq("0") { [INFO] [stdout] 308 ~ // 判断当前id是否在devices中 [INFO] [stdout] 309 + if DEVICE.lock().unwrap().get(real_mac.as_str()).is_none() { [INFO] [stdout] 310 ~ // 不存在的话就执行注册逻辑 [INFO] [stdout] 311 + let mut sub_device = Device::default_ble( [INFO] [stdout] 312 + real_mac.clone(), [INFO] [stdout] 313 + device.name, [INFO] [stdout] 314 + Mode::Measure, [INFO] [stdout] 315 ~ vec!["被动", "主动"], [INFO] [stdout] 316 + Status::Discover, [INFO] [stdout] 317 + sub_id [INFO] [stdout] 318 + ); [INFO] [stdout] 319 + [INFO] [stdout] 320 ~ // 把主站地址存入从机的结构体字段中 [INFO] [stdout] 321 + sub_device.connect = false; [INFO] [stdout] 322 + DEVICE.lock().unwrap().insert(real_mac.clone(), sub_device); [INFO] [stdout] 323 + self.app.emit("ble-discover", DEVICE.lock().unwrap().get_mut(&real_mac).unwrap().json().to_string()).unwrap(); [INFO] [stdout] 324 + } else { [INFO] [stdout] 325 + if DEVICE.lock().unwrap().get(real_mac.as_str()).unwrap().status != Status::Connected { [INFO] [stdout] 326 + DEVICE.lock().unwrap().get_mut(&real_mac).unwrap().status = Status::Discover; [INFO] [stdout] 327 + DEVICE.lock().unwrap().get_mut(&real_mac).unwrap().connect = false; [INFO] [stdout] 328 + self.app.emit("ble-discover", DEVICE.lock().unwrap().get_mut(&real_mac).unwrap().json().to_string()).unwrap(); [INFO] [stdout] 329 + } [INFO] [stdout] 330 + } [INFO] [stdout] 331 + } [INFO] [stdout] 332 ~ // 把id设为当前从站的mac地址 [INFO] [stdout] 333 + sub_id = real_mac.clone(); [INFO] [stdout] 334 ~ // 取出真实数据 [INFO] [stdout] 335 + number = data_vec[2].clone(); [INFO] [stdout] 336 + }; [INFO] [stdout] 337 + [INFO] [stdout] 338 + if DEVICE.lock().unwrap().get(&sub_id.clone()).is_none() { [INFO] [stdout] 339 + return; [INFO] [stdout] 340 + } [INFO] [stdout] 341 + let state = DEVICE.lock().unwrap().get(&sub_id.clone()).unwrap().connect.clone(); [INFO] [stdout] 342 + if !state { [INFO] [stdout] 343 + return; [INFO] [stdout] 344 + } [INFO] [stdout] 345 + [INFO] [stdout] 346 ~ // 此处对返到前端的value进行处理 [INFO] [stdout] 347 ~ // 因为rust的f64会忽略掉小数位末尾的0位 [INFO] [stdout] 348 ~ // 对于各个设备接收到的value进行统一处理 [INFO] [stdout] 349 + let re = Regex::new(r"^[+-]?").unwrap(); [INFO] [stdout] 350 + let value_symbol = if re.is_match(number.as_str()) { [INFO] [stdout] 351 ~ // +号不返回符号 [INFO] [stdout] 352 + number[0..1].trim_start_matches("+") [INFO] [stdout] 353 + } else { [INFO] [stdout] 354 + "" [INFO] [stdout] 355 + }; [INFO] [stdout] 356 + [INFO] [stdout] 357 + let value_parsed = if number.contains(".") { [INFO] [stdout] 358 + let value_vec = number.split(".").collect::>(); [INFO] [stdout] 359 ~ // 去掉开头的0 [INFO] [stdout] 360 + let value_begin = if value_vec[0][1..].trim_start_matches("0").chars().count() == 0 { [INFO] [stdout] 361 + "0" [INFO] [stdout] 362 + } else { [INFO] [stdout] 363 + value_vec[0][1..].trim_start_matches("0") [INFO] [stdout] 364 + }; [INFO] [stdout] 365 + [INFO] [stdout] 366 + format!("{}{}.{}", value_symbol, value_begin, value_vec[1]) [INFO] [stdout] 367 + } else { [INFO] [stdout] 368 + let value_total = &number[1..].trim_start_matches("0"); [INFO] [stdout] 369 + format!("{}{}", value_symbol, value_total) [INFO] [stdout] 370 + }; [INFO] [stdout] 371 + [INFO] [stdout] 372 + let number = value_parsed; [INFO] [stdout] 373 + [INFO] [stdout] 374 + DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().value = number.clone(); [INFO] [stdout] 375 + let work_mode_index = DEVICE.lock().unwrap().get(&sub_id.clone()).unwrap().work_mode_index.clone(); [INFO] [stdout] 376 + let name = DEVICE.lock().unwrap().get(&sub_id.clone()).unwrap().name.clone(); [INFO] [stdout] 377 + let mut reading = DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().reading; [INFO] [stdout] 378 + let mut count = DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().count; [INFO] [stdout] 379 + let mut timestamp = DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().timestamp; [INFO] [stdout] 380 + [INFO] [stdout] 381 + match work_mode_index.as_str() { [INFO] [stdout] 382 ~ "主动" => { [INFO] [stdout] 383 + if reading { [INFO] [stdout] 384 + if count == 255 { [INFO] [stdout] 385 + count = 0; [INFO] [stdout] 386 + } [INFO] [stdout] 387 + count += 1; [INFO] [stdout] 388 + timestamp = Local::now().timestamp_micros() as f64 / 1000000.0; [INFO] [stdout] 389 + reading = false; [INFO] [stdout] 390 + } [INFO] [stdout] 391 + } [INFO] [stdout] 392 + _ => { [INFO] [stdout] 393 + if count == 255 { [INFO] [stdout] 394 + count = 0; [INFO] [stdout] 395 + } [INFO] [stdout] 396 + count += 1; [INFO] [stdout] 397 + timestamp = Local::now().timestamp_micros() as f64 / 1000000.0; [INFO] [stdout] 398 + } [INFO] [stdout] 399 + } [INFO] [stdout] 400 + info!( [INFO] [stdout] 401 + "{}:{}[{:.6}]: {:03} {}", [INFO] [stdout] 402 + sub_id, name, timestamp, count, number [INFO] [stdout] 403 + ); [INFO] [stdout] 404 + [INFO] [stdout] 405 ~ // 保存数据 [INFO] [stdout] 406 + DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().reading = reading; [INFO] [stdout] 407 + DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().count = count; [INFO] [stdout] 408 + DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().timestamp = timestamp; [INFO] [stdout] 409 + [INFO] [stdout] 410 + let dev = DEVICE.lock().unwrap().get(&sub_id.clone()).unwrap().clone(); [INFO] [stdout] 411 + self.app.clone().emit("received", dev.clone().json().to_string()).unwrap(); [INFO] [stdout] 412 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/device/ble/mod.rs:342:29 [INFO] [stdout] | [INFO] [stdout] 342 | let state = DEVICE.lock().unwrap().get(&sub_id.clone()).unwrap().connect.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `DEVICE.lock().unwrap().get(&sub_id.clone()).unwrap().connect` [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: this boolean expression can be simplified [INFO] [stdout] --> src/device/ble/mod.rs:427:32 [INFO] [stdout] | [INFO] [stdout] 427 | ... if !DEVICES.lock().unwrap().get_mut(&id.clone()).is_none(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `DEVICES.lock().unwrap().get_mut(&id.clone()).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/device/ble/mod.rs:436:32 [INFO] [stdout] | [INFO] [stdout] 436 | ... if !DEVICES.lock().unwrap().get_mut(&id.clone()).is_none(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `DEVICES.lock().unwrap().get_mut(&id.clone()).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/device/mod.rs:99:13 [INFO] [stdout] | [INFO] [stdout] 99 | / match device.types { [INFO] [stdout] 100 | | Types::Hid => { [INFO] [stdout] 101 | | let _ = data.push(device.json()); [INFO] [stdout] ... | [INFO] [stdout] 104 | | } [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] 99 ~ if let Types::Hid = device.types { [INFO] [stdout] 100 + let _ = data.push(device.json()); [INFO] [stdout] 101 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `discover_list` is never used [INFO] [stdout] --> src/device/mod.rs:94:8 [INFO] [stdout] | [INFO] [stdout] 94 | pub fn discover_list() -> 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: function `connect_device` is never used [INFO] [stdout] --> src/device/mod.rs:129:8 [INFO] [stdout] | [INFO] [stdout] 129 | pub fn connect_device(id: String) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `disconnected` is never used [INFO] [stdout] --> src/device/mod.rs:138:8 [INFO] [stdout] | [INFO] [stdout] 138 | pub fn disconnected(id: String) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `work_mode_device` is never used [INFO] [stdout] --> src/device/mod.rs:159:8 [INFO] [stdout] | [INFO] [stdout] 159 | pub fn work_mode_device(id: String, work_mode: String) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `set_device_zero` is never used [INFO] [stdout] --> src/device/mod.rs:172:8 [INFO] [stdout] | [INFO] [stdout] 172 | pub fn set_device_zero(id: String) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `zero` is never read [INFO] [stdout] --> src/device/mod.rs:218:9 [INFO] [stdout] | [INFO] [stdout] 182 | pub struct Device { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 218 | pub zero: bool, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Device` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Usb`, `File`, `Hid`, and `None` are never constructed [INFO] [stdout] --> src/device/mod.rs:293:5 [INFO] [stdout] | [INFO] [stdout] 289 | pub enum Types { [INFO] [stdout] | ----- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 293 | Usb, [INFO] [stdout] | ^^^ [INFO] [stdout] 294 | /// 文件解析设备 [INFO] [stdout] 295 | File, [INFO] [stdout] | ^^^^ [INFO] [stdout] 296 | /// 蓝牙HID设备 [INFO] [stdout] 297 | Hid, [INFO] [stdout] | ^^^ [INFO] [stdout] 298 | None, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Types` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `from` is never used [INFO] [stdout] --> src/device/mod.rs:311:8 [INFO] [stdout] | [INFO] [stdout] 301 | impl Types { [INFO] [stdout] | ---------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 311 | fn from(name: &str) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `SpiritLevel`, `Gyroscope`, `Potentiometer`, `Instrument`, `ScanCode`, and `None` are never constructed [INFO] [stdout] --> src/device/mod.rs:325:5 [INFO] [stdout] | [INFO] [stdout] 323 | pub enum Mode { [INFO] [stdout] | ---- variants in this enum [INFO] [stdout] 324 | /// 水平仪 [INFO] [stdout] 325 | SpiritLevel, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] 326 | /// 陀螺仪 [INFO] [stdout] 327 | Gyroscope, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 331 | Potentiometer, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 332 | /// 仪器 [INFO] [stdout] 333 | Instrument, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 334 | /// 扫码抢 [INFO] [stdout] 335 | ScanCode, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 336 | /// 未知 [INFO] [stdout] 337 | None, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Mode` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `from` is never used [INFO] [stdout] --> src/device/mod.rs:352:8 [INFO] [stdout] | [INFO] [stdout] 340 | impl Mode { [INFO] [stdout] | --------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 352 | fn from(name: &str) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `ConnectionState` is never used [INFO] [stdout] --> src/device/mod.rs:367:10 [INFO] [stdout] | [INFO] [stdout] 367 | pub enum ConnectionState { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `str` is never used [INFO] [stdout] --> src/device/mod.rs:381:8 [INFO] [stdout] | [INFO] [stdout] 380 | impl ConnectionState { [INFO] [stdout] | -------------------- method in this implementation [INFO] [stdout] 381 | fn str(&mut self) -> &'static str { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Dormancy`, `Abnormal`, `Disabled`, `ConnectionFailed`, and `Unconnected` are never constructed [INFO] [stdout] --> src/device/mod.rs:397:5 [INFO] [stdout] | [INFO] [stdout] 395 | pub enum ErrState { [INFO] [stdout] | -------- variants in this enum [INFO] [stdout] 396 | /// 休眠 [INFO] [stdout] 397 | Dormancy, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 398 | /// 异常 [INFO] [stdout] 399 | Abnormal, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 400 | /// 禁用 [INFO] [stdout] 401 | Disabled, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 402 | /// 连接失败 [INFO] [stdout] 403 | ConnectionFailed, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] 404 | /// 断开连接 [INFO] [stdout] 405 | Unconnected, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ErrState` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Data` is never constructed [INFO] [stdout] --> src/device/mod.rs:410:12 [INFO] [stdout] | [INFO] [stdout] 410 | pub struct Data { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `json` is never used [INFO] [stdout] --> src/device/mod.rs:460:12 [INFO] [stdout] | [INFO] [stdout] 459 | impl Data { [INFO] [stdout] | --------- method in this implementation [INFO] [stdout] 460 | pub fn json(self) -> JsonValue { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `ConnectFailed` and `Removed` are never constructed [INFO] [stdout] --> src/device/mod.rs:493:5 [INFO] [stdout] | [INFO] [stdout] 480 | pub enum Status { [INFO] [stdout] | ------ variants in this enum [INFO] [stdout] ... [INFO] [stdout] 493 | ConnectFailed, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 494 | /// 移除 [INFO] [stdout] 495 | Removed, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Status` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `from` is never used [INFO] [stdout] --> src/device/mod.rs:513:12 [INFO] [stdout] | [INFO] [stdout] 499 | impl Status { [INFO] [stdout] | ----------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 513 | pub fn from(name: &str) -> Status { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/device/ble/mod.rs:45:9 [INFO] [stdout] | [INFO] [stdout] 45 | LVH(Lvh), [INFO] [stdout] | --- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `BleModel` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 45 - LVH(Lvh), [INFO] [stdout] 45 + LVH(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `id` is never read [INFO] [stdout] --> src/device/ble/lvh.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct Lvh { [INFO] [stdout] | --- field in this struct [INFO] [stdout] 5 | pub id: String, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `Lvh` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Wt90` is never constructed [INFO] [stdout] --> src/device/ble/wt90.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Wt90 {} [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `a_xyz`, `w_xyz`, `angle_x`, `angle_y`, and `angle_z` are never used [INFO] [stdout] --> src/device/ble/wt90.rs:7:12 [INFO] [stdout] | [INFO] [stdout] 5 | impl Wt90 { [INFO] [stdout] | --------- associated functions in this implementation [INFO] [stdout] 6 | /// 加速度 [INFO] [stdout] 7 | pub fn a_xyz(mut data: Vec) -> f64 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 18 | pub fn w_xyz(mut data: Vec) -> f64 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 28 | pub fn angle_x(mut data: Vec) -> f64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 38 | pub fn angle_y(mut data: Vec) -> f64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 48 | pub fn angle_z(mut data: Vec) -> f64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `QDLY` contains a capitalized acronym [INFO] [stdout] --> src/device/ble/qdly.rs:8:12 [INFO] [stdout] | [INFO] [stdout] 8 | pub struct QDLY { [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Qdly` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LVH` contains a capitalized acronym [INFO] [stdout] --> src/device/ble/mod.rs:45:5 [INFO] [stdout] | [INFO] [stdout] 45 | LVH(Lvh), [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Lvh` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `GRL` contains a capitalized acronym [INFO] [stdout] --> src/device/ble/mod.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | GRL(Grl), [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Grl` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `QDLY` contains a capitalized acronym [INFO] [stdout] --> src/device/ble/mod.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | QDLY(QDLY), [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Qdly` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/device/ble/mod.rs:272:9 [INFO] [stdout] | [INFO] [stdout] 272 | / match match BleModel::from(&device.name, &device.id) { [INFO] [stdout] 273 | | BleModel::HL(mut e) => e.decode(data.clone()), [INFO] [stdout] 274 | | BleModel::GL(mut e) => e.decode(data.clone()), [INFO] [stdout] 275 | | BleModel::GR(mut e) => e.decode(data.clone()), [INFO] [stdout] ... | [INFO] [stdout] 414 | | Err(_) => {} [INFO] [stdout] 415 | | }; [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] 272 ~ if let Ok((mut sub_id, mut number)) = match BleModel::from(&device.name, &device.id) { [INFO] [stdout] 273 + BleModel::HL(mut e) => e.decode(data.clone()), [INFO] [stdout] 274 + BleModel::GL(mut e) => e.decode(data.clone()), [INFO] [stdout] 275 + BleModel::GR(mut e) => e.decode(data.clone()), [INFO] [stdout] 276 + BleModel::GRL(mut e) => e.decode(data.clone()), [INFO] [stdout] 277 + BleModel::TM(mut e) => e.decode(data.clone()), [INFO] [stdout] 278 + BleModel::BarCode(mut e) => e.decode(data.clone()), [INFO] [stdout] 279 + BleModel::QDLY(mut e) => e.decode(data.clone()), [INFO] [stdout] 280 + _ => return, [INFO] [stdout] 281 + } { [INFO] [stdout] 282 ~ // 处理气动量仪数据 - 考虑加一个东本的feature [INFO] [stdout] 283 + // number:0,1091A8301350,+1514.4182 [INFO] [stdout] 284 ~ // 这里的mac地址末尾+2才是蓝牙地址 [INFO] [stdout] 285 + if device.name.contains("Dasqua PMI") { [INFO] [stdout] 286 + let data_vec = number.split(',').map(|x| x.to_string()).collect::>(); [INFO] [stdout] 287 ~ // 如果切分出来的数组长度小于3,直接抛弃 [INFO] [stdout] 288 + if data_vec.len() < 3 { [INFO] [stdout] 289 + return; [INFO] [stdout] 290 + } [INFO] [stdout] 291 + let mut mac_vec = data_vec[1] [INFO] [stdout] 292 ~ .chars() // 遍历字符 [INFO] [stdout] 293 ~ .collect::>() // 转为 Vec [INFO] [stdout] 294 ~ .chunks_exact(2) // 每2个字符一组 [INFO] [stdout] 295 ~ .map(|chunk| chunk.iter().collect::()) // 每组转为字符串 [INFO] [stdout] 296 ~ .collect::>(); // 收集为 Vec [INFO] [stdout] 297 + let mac_last_cell = mac_vec.last().unwrap(); [INFO] [stdout] 298 + let num_mac = u32::from_str_radix(mac_last_cell, 16).unwrap(); [INFO] [stdout] 299 ~ // 这里的mac地址末尾+2才是蓝牙地址 [INFO] [stdout] 300 ~ let real_last_cell = format!("{:X}", num_mac + 2); // 大写十六进制 [INFO] [stdout] 301 + mac_vec.remove(mac_vec.len() - 1); [INFO] [stdout] 302 + mac_vec.push(real_last_cell); [INFO] [stdout] 303 + let real_mac = mac_vec.join(":").to_lowercase(); [INFO] [stdout] 304 + // println!("real_mac: {}", real_mac); [INFO] [stdout] 305 + [INFO] [stdout] 306 ~ // 如果是从站,执行初始化设备的流程 [INFO] [stdout] 307 + if !data_vec[0].eq("0") { [INFO] [stdout] 308 ~ // 判断当前id是否在devices中 [INFO] [stdout] 309 + if DEVICE.lock().unwrap().get(real_mac.as_str()).is_none() { [INFO] [stdout] 310 ~ // 不存在的话就执行注册逻辑 [INFO] [stdout] 311 + let mut sub_device = Device::default_ble( [INFO] [stdout] 312 + real_mac.clone(), [INFO] [stdout] 313 + device.name, [INFO] [stdout] 314 + Mode::Measure, [INFO] [stdout] 315 ~ vec!["被动", "主动"], [INFO] [stdout] 316 + Status::Discover, [INFO] [stdout] 317 + sub_id [INFO] [stdout] 318 + ); [INFO] [stdout] 319 + [INFO] [stdout] 320 ~ // 把主站地址存入从机的结构体字段中 [INFO] [stdout] 321 + sub_device.connect = false; [INFO] [stdout] 322 + DEVICE.lock().unwrap().insert(real_mac.clone(), sub_device); [INFO] [stdout] 323 + self.app.emit("ble-discover", DEVICE.lock().unwrap().get_mut(&real_mac).unwrap().json().to_string()).unwrap(); [INFO] [stdout] 324 + } else { [INFO] [stdout] 325 + if DEVICE.lock().unwrap().get(real_mac.as_str()).unwrap().status != Status::Connected { [INFO] [stdout] 326 + DEVICE.lock().unwrap().get_mut(&real_mac).unwrap().status = Status::Discover; [INFO] [stdout] 327 + DEVICE.lock().unwrap().get_mut(&real_mac).unwrap().connect = false; [INFO] [stdout] 328 + self.app.emit("ble-discover", DEVICE.lock().unwrap().get_mut(&real_mac).unwrap().json().to_string()).unwrap(); [INFO] [stdout] 329 + } [INFO] [stdout] 330 + } [INFO] [stdout] 331 + } [INFO] [stdout] 332 ~ // 把id设为当前从站的mac地址 [INFO] [stdout] 333 + sub_id = real_mac.clone(); [INFO] [stdout] 334 ~ // 取出真实数据 [INFO] [stdout] 335 + number = data_vec[2].clone(); [INFO] [stdout] 336 + }; [INFO] [stdout] 337 + [INFO] [stdout] 338 + if DEVICE.lock().unwrap().get(&sub_id.clone()).is_none() { [INFO] [stdout] 339 + return; [INFO] [stdout] 340 + } [INFO] [stdout] 341 + let state = DEVICE.lock().unwrap().get(&sub_id.clone()).unwrap().connect.clone(); [INFO] [stdout] 342 + if !state { [INFO] [stdout] 343 + return; [INFO] [stdout] 344 + } [INFO] [stdout] 345 + [INFO] [stdout] 346 ~ // 此处对返到前端的value进行处理 [INFO] [stdout] 347 ~ // 因为rust的f64会忽略掉小数位末尾的0位 [INFO] [stdout] 348 ~ // 对于各个设备接收到的value进行统一处理 [INFO] [stdout] 349 + let re = Regex::new(r"^[+-]?").unwrap(); [INFO] [stdout] 350 + let value_symbol = if re.is_match(number.as_str()) { [INFO] [stdout] 351 ~ // +号不返回符号 [INFO] [stdout] 352 + number[0..1].trim_start_matches("+") [INFO] [stdout] 353 + } else { [INFO] [stdout] 354 + "" [INFO] [stdout] 355 + }; [INFO] [stdout] 356 + [INFO] [stdout] 357 + let value_parsed = if number.contains(".") { [INFO] [stdout] 358 + let value_vec = number.split(".").collect::>(); [INFO] [stdout] 359 ~ // 去掉开头的0 [INFO] [stdout] 360 + let value_begin = if value_vec[0][1..].trim_start_matches("0").chars().count() == 0 { [INFO] [stdout] 361 + "0" [INFO] [stdout] 362 + } else { [INFO] [stdout] 363 + value_vec[0][1..].trim_start_matches("0") [INFO] [stdout] 364 + }; [INFO] [stdout] 365 + [INFO] [stdout] 366 + format!("{}{}.{}", value_symbol, value_begin, value_vec[1]) [INFO] [stdout] 367 + } else { [INFO] [stdout] 368 + let value_total = &number[1..].trim_start_matches("0"); [INFO] [stdout] 369 + format!("{}{}", value_symbol, value_total) [INFO] [stdout] 370 + }; [INFO] [stdout] 371 + [INFO] [stdout] 372 + let number = value_parsed; [INFO] [stdout] 373 + [INFO] [stdout] 374 + DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().value = number.clone(); [INFO] [stdout] 375 + let work_mode_index = DEVICE.lock().unwrap().get(&sub_id.clone()).unwrap().work_mode_index.clone(); [INFO] [stdout] 376 + let name = DEVICE.lock().unwrap().get(&sub_id.clone()).unwrap().name.clone(); [INFO] [stdout] 377 + let mut reading = DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().reading; [INFO] [stdout] 378 + let mut count = DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().count; [INFO] [stdout] 379 + let mut timestamp = DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().timestamp; [INFO] [stdout] 380 + [INFO] [stdout] 381 + match work_mode_index.as_str() { [INFO] [stdout] 382 ~ "主动" => { [INFO] [stdout] 383 + if reading { [INFO] [stdout] 384 + if count == 255 { [INFO] [stdout] 385 + count = 0; [INFO] [stdout] 386 + } [INFO] [stdout] 387 + count += 1; [INFO] [stdout] 388 + timestamp = Local::now().timestamp_micros() as f64 / 1000000.0; [INFO] [stdout] 389 + reading = false; [INFO] [stdout] 390 + } [INFO] [stdout] 391 + } [INFO] [stdout] 392 + _ => { [INFO] [stdout] 393 + if count == 255 { [INFO] [stdout] 394 + count = 0; [INFO] [stdout] 395 + } [INFO] [stdout] 396 + count += 1; [INFO] [stdout] 397 + timestamp = Local::now().timestamp_micros() as f64 / 1000000.0; [INFO] [stdout] 398 + } [INFO] [stdout] 399 + } [INFO] [stdout] 400 + info!( [INFO] [stdout] 401 + "{}:{}[{:.6}]: {:03} {}", [INFO] [stdout] 402 + sub_id, name, timestamp, count, number [INFO] [stdout] 403 + ); [INFO] [stdout] 404 + [INFO] [stdout] 405 ~ // 保存数据 [INFO] [stdout] 406 + DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().reading = reading; [INFO] [stdout] 407 + DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().count = count; [INFO] [stdout] 408 + DEVICE.lock().unwrap().get_mut(&sub_id.clone()).unwrap().timestamp = timestamp; [INFO] [stdout] 409 + [INFO] [stdout] 410 + let dev = DEVICE.lock().unwrap().get(&sub_id.clone()).unwrap().clone(); [INFO] [stdout] 411 + self.app.clone().emit("received", dev.clone().json().to_string()).unwrap(); [INFO] [stdout] 412 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/device/ble/mod.rs:342:29 [INFO] [stdout] | [INFO] [stdout] 342 | let state = DEVICE.lock().unwrap().get(&sub_id.clone()).unwrap().connect.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `DEVICE.lock().unwrap().get(&sub_id.clone()).unwrap().connect` [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: this boolean expression can be simplified [INFO] [stdout] --> src/device/ble/mod.rs:427:32 [INFO] [stdout] | [INFO] [stdout] 427 | ... if !DEVICES.lock().unwrap().get_mut(&id.clone()).is_none(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `DEVICES.lock().unwrap().get_mut(&id.clone()).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/device/ble/mod.rs:436:32 [INFO] [stdout] | [INFO] [stdout] 436 | ... if !DEVICES.lock().unwrap().get_mut(&id.clone()).is_none(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `DEVICES.lock().unwrap().get_mut(&id.clone()).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/device/mod.rs:99:13 [INFO] [stdout] | [INFO] [stdout] 99 | / match device.types { [INFO] [stdout] 100 | | Types::Hid => { [INFO] [stdout] 101 | | let _ = data.push(device.json()); [INFO] [stdout] ... | [INFO] [stdout] 104 | | } [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] 99 ~ if let Types::Hid = device.types { [INFO] [stdout] 100 + let _ = data.push(device.json()); [INFO] [stdout] 101 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 4m 48s [INFO] running `Command { std: "docker" "inspect" "bad859a64025da46b459ad4c82134011eda82d6129e11cc60f2814ff46b1b982", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "bad859a64025da46b459ad4c82134011eda82d6129e11cc60f2814ff46b1b982", kill_on_drop: false }` [INFO] [stdout] bad859a64025da46b459ad4c82134011eda82d6129e11cc60f2814ff46b1b982