[INFO] cloning repository https://github.com/TheDR-lul/Hedgehog [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/TheDR-lul/Hedgehog" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FTheDR-lul%2FHedgehog", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FTheDR-lul%2FHedgehog'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 56cde80a8cfbaef0adb23242551950f67c99e997 [INFO] linting TheDR-lul/Hedgehog against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FTheDR-lul%2FHedgehog" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/TheDR-lul/Hedgehog [INFO] finished tweaking git repo https://github.com/TheDR-lul/Hedgehog [INFO] tweaked toml for git repo https://github.com/TheDR-lul/Hedgehog written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/TheDR-lul/Hedgehog 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/TheDR-lul/Hedgehog 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 teloxide-macros v0.9.0 [INFO] [stderr] Downloaded hyper-util v0.1.11 [INFO] [stderr] Downloaded config v0.15.11 [INFO] [stderr] Downloaded pest_generator v2.8.0 [INFO] [stderr] Downloaded teloxide v0.15.0 [INFO] [stderr] Downloaded embed-resource v3.0.2 [INFO] [stderr] Downloaded pest_meta v2.8.0 [INFO] [stderr] Downloaded pest_derive v2.8.0 [INFO] [stderr] Downloaded sqlx-mysql v0.8.5 [INFO] [stderr] Downloaded rkyv v0.7.45 [INFO] [stderr] Downloaded pest v2.8.0 [INFO] [stderr] Downloaded yaml-rust2 v0.10.1 [INFO] [stderr] Downloaded rust_decimal v1.37.1 [INFO] [stderr] Downloaded sqlx v0.8.5 [INFO] [stderr] Downloaded sqlx-postgres v0.8.5 [INFO] [stderr] Downloaded h2 v0.4.9 [INFO] [stderr] Downloaded webpki-roots v0.26.10 [INFO] [stderr] Downloaded teloxide-core v0.11.2 [INFO] [stderr] Downloaded rustls v0.23.26 [INFO] [stderr] Downloaded libm v0.2.13 [INFO] [stderr] Downloaded sqlx-sqlite v0.8.5 [INFO] [stderr] Downloaded cc v1.2.21 [INFO] [stderr] Downloaded winnow v0.7.8 [INFO] [stderr] Downloaded sqlx-macros-core v0.8.5 [INFO] [stderr] Downloaded dptree v0.3.0 [INFO] [stderr] Downloaded rc-box v1.3.0 [INFO] [stderr] Downloaded rkyv_derive v0.7.45 [INFO] [stderr] Downloaded rust_decimal_macros v1.37.1 [INFO] [stderr] Downloaded whoami v1.6.0 [INFO] [stderr] Downloaded erasable v1.3.0 [INFO] [stderr] Downloaded trim-in-place v0.1.7 [INFO] [stderr] Downloaded rust-ini v0.21.1 [INFO] [stderr] Downloaded arraydeque v0.5.1 [INFO] [stderr] Downloaded sqlx-macros v0.8.5 [INFO] [stderr] Downloaded sqlx-core v0.8.5 [INFO] [stderr] Downloaded aquamarine v0.6.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] 40a62da2c4ea9c03e48e63236507a440a42c4b1322daaf1f8ba59e0d12a1eb74 [INFO] running `Command { std: "docker" "start" "-a" "40a62da2c4ea9c03e48e63236507a440a42c4b1322daaf1f8ba59e0d12a1eb74", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "40a62da2c4ea9c03e48e63236507a440a42c4b1322daaf1f8ba59e0d12a1eb74", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "40a62da2c4ea9c03e48e63236507a440a42c4b1322daaf1f8ba59e0d12a1eb74", kill_on_drop: false }` [INFO] [stdout] 40a62da2c4ea9c03e48e63236507a440a42c4b1322daaf1f8ba59e0d12a1eb74 [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] ffc469c716534341c5f30c57a514904b7b8f7cb8fdd3437b850a40d5a4f7dac4 [INFO] running `Command { std: "docker" "start" "-a" "ffc469c716534341c5f30c57a514904b7b8f7cb8fdd3437b850a40d5a4f7dac4", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.95 [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Compiling icu_locid_transform_data v1.5.1 [INFO] [stderr] Compiling icu_properties_data v1.5.1 [INFO] [stderr] Compiling icu_normalizer_data v1.5.1 [INFO] [stderr] Compiling libc v0.2.172 [INFO] [stderr] Compiling cc v1.2.21 [INFO] [stderr] Compiling lock_api v0.4.12 [INFO] [stderr] Checking log v0.4.27 [INFO] [stderr] Checking smallvec v1.15.0 [INFO] [stderr] Compiling memchr v2.7.4 [INFO] [stderr] Compiling stable_deref_trait v1.2.0 [INFO] [stderr] Compiling crossbeam-utils v0.8.21 [INFO] [stderr] Checking hashbrown v0.15.3 [INFO] [stderr] Checking futures-io v0.3.31 [INFO] [stderr] Checking writeable v0.5.5 [INFO] [stderr] Checking litemap v0.7.5 [INFO] [stderr] Compiling serde_json v1.0.140 [INFO] [stderr] Checking tracing-core v0.1.33 [INFO] [stderr] Compiling foldhash v0.1.5 [INFO] [stderr] Compiling allocator-api2 v0.2.21 [INFO] [stderr] Compiling futures-core v0.3.31 [INFO] [stderr] Compiling pin-project-lite v0.2.16 [INFO] [stderr] Compiling typenum v1.18.0 [INFO] [stderr] Compiling getrandom v0.2.16 [INFO] [stderr] Compiling rustls v0.23.26 [INFO] [stderr] Checking write16 v1.0.0 [INFO] [stderr] Checking rustls-pki-types v1.11.0 [INFO] [stderr] Compiling getrandom v0.3.2 [INFO] [stderr] Checking utf16_iter v1.0.5 [INFO] [stderr] Checking subtle v2.6.1 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Compiling futures-sink v0.3.31 [INFO] [stderr] Compiling crunchy v0.2.3 [INFO] [stderr] Compiling utf8_iter v1.0.4 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking mio v1.0.3 [INFO] [stderr] Checking signal-hook-registry v1.4.5 [INFO] [stderr] Checking socket2 v0.5.9 [INFO] [stderr] Compiling percent-encoding v2.3.1 [INFO] [stderr] Compiling openssl v0.10.72 [INFO] [stderr] Compiling tiny-keccak v2.0.2 [INFO] [stderr] Compiling untrusted v0.9.0 [INFO] [stderr] Checking indexmap v2.9.0 [INFO] [stderr] Compiling form_urlencoded v1.2.1 [INFO] [stderr] Compiling parking_lot_core v0.9.10 [INFO] [stderr] Compiling slab v0.4.9 [INFO] [stderr] Compiling quote v1.0.40 [INFO] [stderr] Compiling generic-array v0.14.7 [INFO] [stderr] Compiling bytes v1.10.1 [INFO] [stderr] Compiling futures-task v0.3.31 [INFO] [stderr] Compiling pin-utils v0.1.0 [INFO] [stderr] Compiling ryu v1.0.20 [INFO] [stderr] Compiling itoa v1.0.15 [INFO] [stderr] Compiling syn v2.0.101 [INFO] [stderr] Compiling concurrent-queue v2.5.0 [INFO] [stderr] Compiling parking_lot v0.12.3 [INFO] [stderr] Compiling futures-util v0.3.31 [INFO] [stderr] Compiling rustix v1.0.7 [INFO] [stderr] Compiling tokio v1.45.0 [INFO] [stderr] Compiling unicase v2.8.1 [INFO] [stderr] Compiling semver v1.0.26 [INFO] [stderr] Compiling crc-catalog v2.4.0 [INFO] [stderr] Compiling parking v2.2.1 [INFO] [stderr] Compiling zeroize v1.8.1 [INFO] [stderr] Compiling ucd-trie v0.1.7 [INFO] [stderr] Compiling event-listener v5.4.0 [INFO] [stderr] Compiling crc v3.2.1 [INFO] [stderr] Compiling const-random-macro v0.1.16 [INFO] [stderr] Compiling mime_guess v2.0.5 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Compiling openssl-sys v0.9.108 [INFO] [stderr] Compiling libsqlite3-sys v0.30.1 [INFO] [stderr] Compiling block-buffer v0.10.4 [INFO] [stderr] Compiling crypto-common v0.1.6 [INFO] [stderr] Compiling psm v0.1.26 [INFO] [stderr] Compiling futures-intrusive v0.5.0 [INFO] [stderr] Compiling crossbeam-queue v0.3.12 [INFO] [stderr] Compiling webpki-roots v0.26.10 [INFO] [stderr] Compiling hashlink v0.10.0 [INFO] [stderr] Compiling spin v0.9.8 [INFO] [stderr] Checking encoding_rs v0.8.35 [INFO] [stderr] Compiling erasable v1.3.0 [INFO] [stderr] Compiling sha2 v0.10.9 [INFO] [stderr] Compiling bitflags v2.9.0 [INFO] [stderr] Compiling base64 v0.22.1 [INFO] [stderr] Compiling linux-raw-sys v0.9.4 [INFO] [stderr] Compiling winnow v0.7.8 [INFO] [stderr] Compiling toml_write v0.1.1 [INFO] [stderr] Compiling flume v0.11.1 [INFO] [stderr] Compiling native-tls v0.2.14 [INFO] [stderr] Compiling atoi v2.0.0 [INFO] [stderr] Checking const-random v0.1.18 [INFO] [stderr] Compiling stacker v0.1.21 [INFO] [stderr] Checking rand_core v0.9.3 [INFO] [stderr] Compiling futures-channel v0.3.31 [INFO] [stderr] Compiling fastrand v2.3.0 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Checking dlv-list v0.5.2 [INFO] [stderr] Compiling rustc_version v0.4.1 [INFO] [stderr] Compiling proc-macro-error-attr2 v2.0.0 [INFO] [stderr] Compiling include_dir_macros v0.7.4 [INFO] [stderr] Checking rustls-pemfile v2.2.0 [INFO] [stderr] Compiling dotenvy v0.15.7 [INFO] [stderr] Checking bytemuck v1.23.0 [INFO] [stderr] Checking regex-syntax v0.8.5 [INFO] [stderr] Compiling hex v0.4.3 [INFO] [stderr] Checking hashbrown v0.14.5 [INFO] [stderr] Compiling tempfile v3.19.1 [INFO] [stderr] Compiling include_dir v0.7.4 [INFO] [stderr] Checking rgb v0.8.50 [INFO] [stderr] Checking chrono v0.4.41 [INFO] [stderr] Compiling proc-macro-error2 v2.0.1 [INFO] [stderr] Checking rc-box v1.3.0 [INFO] [stderr] Checking rand v0.9.1 [INFO] [stderr] Checking uuid v1.16.0 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Checking trim-in-place v0.1.7 [INFO] [stderr] Compiling rust_decimal v1.37.1 [INFO] [stderr] Compiling anyhow v1.0.98 [INFO] [stderr] Checking take_mut v0.2.2 [INFO] [stderr] Checking takecell v0.1.1 [INFO] [stderr] Checking ordered-multimap v0.7.3 [INFO] [stderr] Checking unicode-segmentation v1.12.0 [INFO] [stderr] Checking arraydeque v0.5.1 [INFO] [stderr] Checking tracing-log v0.2.0 [INFO] [stderr] Checking pathdiff v0.2.3 [INFO] [stderr] Checking arrayvec v0.7.6 [INFO] [stderr] Checking hmac v0.12.1 [INFO] [stderr] Checking urlencoding v2.1.3 [INFO] [stderr] Checking yaml-rust2 v0.10.1 [INFO] [stderr] Checking rust-ini v0.21.1 [INFO] [stderr] Checking dotenv v0.15.0 [INFO] [stderr] Checking convert_case v0.6.0 [INFO] [stderr] Compiling futures-executor v0.3.31 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Compiling tokio-stream v0.1.17 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling darling_core v0.20.11 [INFO] [stderr] Checking rustls-webpki v0.103.1 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling zerovec-derive v0.10.3 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling icu_provider_macros v1.5.0 [INFO] [stderr] Compiling thiserror-impl v2.0.12 [INFO] [stderr] Compiling tracing-attributes v0.1.28 [INFO] [stderr] Compiling tokio-macros v2.5.0 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling pin-project-internal v1.1.10 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.7.5 [INFO] [stderr] Compiling derive_more-impl v1.0.0 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Compiling async-trait v0.1.88 [INFO] [stderr] Compiling teloxide-macros v0.9.0 [INFO] [stderr] Compiling rust_decimal_macros v1.37.1 [INFO] [stderr] Checking pin-project v1.1.10 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Checking tracing-subscriber v0.3.19 [INFO] [stderr] Compiling thiserror v2.0.12 [INFO] [stderr] Compiling pest v2.8.0 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking tungstenite v0.26.2 [INFO] [stderr] Checking yoke v0.7.5 [INFO] [stderr] Compiling zerovec v0.10.4 [INFO] [stderr] Checking derive_more v1.0.0 [INFO] [stderr] Compiling darling_macro v0.20.11 [INFO] [stderr] Compiling darling v0.20.11 [INFO] [stderr] Compiling serde_with_macros v3.12.0 [INFO] [stderr] Checking tinystr v0.7.6 [INFO] [stderr] Checking icu_collections v1.5.0 [INFO] [stderr] Checking icu_locid v1.5.0 [INFO] [stderr] Compiling pest_meta v2.8.0 [INFO] [stderr] Compiling icu_provider v1.5.0 [INFO] [stderr] Checking futures v0.3.31 [INFO] [stderr] Checking dptree v0.3.0 [INFO] [stderr] Compiling pest_generator v2.8.0 [INFO] [stderr] Compiling icu_locid_transform v1.5.0 [INFO] [stderr] Checking icu_properties v1.5.1 [INFO] [stderr] Compiling pest_derive v2.8.0 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking either v1.15.0 [INFO] [stderr] Checking serde_spanned v0.6.8 [INFO] [stderr] Checking toml_datetime v0.6.9 [INFO] [stderr] Checking serde_with v3.12.0 [INFO] [stderr] Checking toml v0.5.11 [INFO] [stderr] Checking json5 v0.4.1 [INFO] [stderr] Checking serde_path_to_error v0.1.17 [INFO] [stderr] Checking tokio-util v0.7.15 [INFO] [stderr] Checking tower v0.5.2 [INFO] [stderr] Checking toml_edit v0.22.26 [INFO] [stderr] Checking tokio-tungstenite v0.26.2 [INFO] [stderr] Checking ron v0.8.1 [INFO] [stderr] Checking h2 v0.4.9 [INFO] [stderr] Checking winres v0.1.12 [INFO] [stderr] Compiling itertools v0.10.5 [INFO] [stderr] Checking toml v0.8.22 [INFO] [stderr] Compiling icu_normalizer v1.5.0 [INFO] [stderr] Compiling idna_adapter v1.2.0 [INFO] [stderr] Compiling idna v1.0.3 [INFO] [stderr] Checking config v0.15.11 [INFO] [stderr] Checking url v2.5.4 [INFO] [stderr] Checking sqlx-core v0.8.5 [INFO] [stderr] Compiling aquamarine v0.6.0 [INFO] [stderr] Compiling embed-resource v3.0.2 [INFO] [stderr] Compiling hedgehog v0.1.0 (/opt/rustwide/workdir) [INFO] [stderr] Checking sqlx-sqlite v0.8.5 [INFO] [stderr] Checking tokio-native-tls v0.3.1 [INFO] [stderr] Checking hyper v1.6.0 [INFO] [stderr] Checking hyper-util v0.1.11 [INFO] [stderr] Checking hyper-tls v0.6.0 [INFO] [stderr] Checking reqwest v0.12.15 [INFO] [stderr] Checking teloxide-core v0.11.2 [INFO] [stderr] Compiling sqlx-macros-core v0.8.5 [INFO] [stderr] Compiling sqlx-macros v0.8.5 [INFO] [stderr] Checking sqlx v0.8.5 [INFO] [stderr] Checking teloxide v0.15.0 [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/exchange/bybit.rs:1146:13 [INFO] [stdout] | [INFO] [stdout] 1146 | average_price: average_price, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `average_price` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/exchange/bybit.rs:1146:13 [INFO] [stdout] | [INFO] [stdout] 1146 | average_price: average_price, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `average_price` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Row` [INFO] [stdout] --> src/storage/schema.rs:6:28 [INFO] [stdout] | [INFO] [stdout] 6 | use sqlx::{Error, FromRow, Row}; [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Context` [INFO] [stdout] --> src/webservice_hedge/hedge_logic/chunk_execution.rs:3:30 [INFO] [stdout] | [INFO] [stdout] 3 | use anyhow::{anyhow, Result, Context}; // Добавили Context [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Context` [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:3:30 [INFO] [stdout] | [INFO] [stdout] 3 | use anyhow::{anyhow, Result, Context}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `rust_decimal::prelude` [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/init.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use rust_decimal::prelude::*; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Row` [INFO] [stdout] --> src/storage/schema.rs:6:28 [INFO] [stdout] | [INFO] [stdout] 6 | use sqlx::{Error, FromRow, Row}; [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Context` [INFO] [stdout] --> src/webservice_hedge/hedge_logic/chunk_execution.rs:3:30 [INFO] [stdout] | [INFO] [stdout] 3 | use anyhow::{anyhow, Result, Context}; // Добавили Context [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Context` [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:3:30 [INFO] [stdout] | [INFO] [stdout] 3 | use anyhow::{anyhow, Result, Context}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `rust_decimal::prelude` [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/init.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use rust_decimal::prelude::*; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `qty_filled_in_current_order` is never read [INFO] [stdout] --> src/hedger/common.rs:377:21 [INFO] [stdout] | [INFO] [stdout] 377 | qty_filled_in_current_order = 0.0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `current_order_id` is never read [INFO] [stdout] --> src/hedger/common.rs:59:48 [INFO] [stdout] | [INFO] [stdout] 59 | let mut current_order_id: Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `current_order_id` is never read [INFO] [stdout] --> src/hedger/common.rs:376:21 [INFO] [stdout] | [INFO] [stdout] 376 | current_order_id = None; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `last_placed_order_id` is never read [INFO] [stdout] --> src/hedger/common.rs:61:52 [INFO] [stdout] | [INFO] [stdout] 61 | let mut last_placed_order_id: Option = None; // Храним ID последнего *успешно размещенного* ордера [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `qty_filled_in_current_order` is never read [INFO] [stdout] --> src/hedger/common.rs:377:21 [INFO] [stdout] | [INFO] [stdout] 377 | qty_filled_in_current_order = 0.0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `current_order_id` is never read [INFO] [stdout] --> src/hedger/common.rs:59:48 [INFO] [stdout] | [INFO] [stdout] 59 | let mut current_order_id: Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `current_order_id` is never read [INFO] [stdout] --> src/hedger/common.rs:376:21 [INFO] [stdout] | [INFO] [stdout] 376 | current_order_id = None; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `last_placed_order_id` is never read [INFO] [stdout] --> src/hedger/common.rs:61:52 [INFO] [stdout] | [INFO] [stdout] 61 | let mut last_placed_order_id: Option = None; // Храним ID последнего *успешно размещенного* ордера [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `last_futures_filled_quantity` [INFO] [stdout] --> src/hedger/hedge.rs:388:17 [INFO] [stdout] | [INFO] [stdout] 388 | let last_futures_filled_quantity = *futures_filled_storage.lock().await; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_last_futures_filled_quantity` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `last_futures_filled_quantity` [INFO] [stdout] --> src/hedger/hedge.rs:388:17 [INFO] [stdout] | [INFO] [stdout] 388 | let last_futures_filled_quantity = *futures_filled_storage.lock().await; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_last_futures_filled_quantity` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `qc` [INFO] [stdout] --> src/notifier/unhedge_flow.rs:139:13 [INFO] [stdout] | [INFO] [stdout] 139 | let qc = cfg_for_callback.quote_currency.clone(); // Используем клон cfg [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_qc` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `qc` [INFO] [stdout] --> src/notifier/unhedge_flow.rs:139:13 [INFO] [stdout] | [INFO] [stdout] 139 | let qc = cfg_for_callback.quote_currency.clone(); // Используем клон cfg [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_qc` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `operation_info_opt` is never read [INFO] [stdout] --> src/notifier/active_ops.rs:157:76 [INFO] [stdout] | [INFO] [stdout] 157 | let mut operation_info_opt: Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `filled_spot_qty_in_operation` is never read [INFO] [stdout] --> src/notifier/active_ops.rs:158:61 [INFO] [stdout] | [INFO] [stdout] 158 | let mut filled_spot_qty_in_operation: f64 = 0.0; [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `operation_info_opt` is never read [INFO] [stdout] --> src/notifier/active_ops.rs:157:76 [INFO] [stdout] | [INFO] [stdout] 157 | let mut operation_info_opt: Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `filled_spot_qty_in_operation` is never read [INFO] [stdout] --> src/notifier/active_ops.rs:158:61 [INFO] [stdout] | [INFO] [stdout] 158 | let mut filled_spot_qty_in_operation: f64 = 0.0; [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `leg_found` is never read [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:68:25 [INFO] [stdout] | [INFO] [stdout] 68 | let mut leg_found = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `leg_found` is never read [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:68:25 [INFO] [stdout] | [INFO] [stdout] 68 | let mut leg_found = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `final_spot_qty` [INFO] [stdout] --> src/webservice_hedge/hedge_logic/reconciliation.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | let final_spot_qty = task.state.cumulative_spot_filled_quantity; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_final_spot_qty` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `final_spot_qty` [INFO] [stdout] --> src/webservice_hedge/hedge_logic/reconciliation.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | let final_spot_qty = task.state.cumulative_spot_filled_quantity; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_final_spot_qty` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `operation_type` [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | let operation_type = OperationType::Unhedge; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_operation_type` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `leg_found` is never read [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:74:25 [INFO] [stdout] | [INFO] [stdout] 74 | let mut leg_found = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `operation_type` [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | let operation_type = OperationType::Unhedge; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_operation_type` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `leg_found` is never read [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:74:25 [INFO] [stdout] | [INFO] [stdout] 74 | let mut leg_found = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ApiResponse` is never constructed [INFO] [stdout] --> src/exchange/bybit.rs:31:8 [INFO] [stdout] | [INFO] [stdout] 31 | struct ApiResponse { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `category` is never read [INFO] [stdout] --> src/exchange/bybit.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 86 | struct RiskLimitResult { [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] 87 | category: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RiskLimitResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `symbol` is never read [INFO] [stdout] --> src/exchange/bybit.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 92 | struct RiskLimitEntry { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] 93 | id: u64, [INFO] [stdout] 94 | symbol: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RiskLimitEntry` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `link_id` is never read [INFO] [stdout] --> src/exchange/bybit.rs:125:5 [INFO] [stdout] | [INFO] [stdout] 121 | struct OrderCreateResult { [INFO] [stdout] | ----------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 125 | link_id: String, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `OrderCreateResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `id` is never read [INFO] [stdout] --> src/exchange/bybit.rs:137:5 [INFO] [stdout] | [INFO] [stdout] 135 | struct OrderQueryEntry { [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] 136 | #[serde(rename = "orderId")] [INFO] [stdout] 137 | id: String, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `OrderQueryEntry` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `category` is never read [INFO] [stdout] --> src/exchange/bybit.rs:186:5 [INFO] [stdout] | [INFO] [stdout] 185 | struct FuturesTickersApiResult { [INFO] [stdout] | ----------------------- field in this struct [INFO] [stdout] 186 | category: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `FuturesTickersApiResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `ts` is never read [INFO] [stdout] --> src/exchange/bybit_ws/types_internal.rs:23:16 [INFO] [stdout] | [INFO] [stdout] 13 | pub(super) struct BybitWsResponse { // Делаем pub(super), чтобы были видны в protocol.rs [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 23 | pub(super) ts: Option, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `BybitWsResponse` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `max_wait` is never read [INFO] [stdout] --> src/hedger/mod.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 25 | pub struct Hedger { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 28 | max_wait: Duration, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Hedger` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `opposite` is never used [INFO] [stdout] --> src/hedger/common.rs:682:8 [INFO] [stdout] | [INFO] [stdout] 680 | trait SideSign { [INFO] [stdout] | -------- method in this trait [INFO] [stdout] 681 | fn sign(&self) -> f64; [INFO] [stdout] 682 | fn opposite(&self) -> Self; // Added opposite helper [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `progress_callback` and `original_spot_target` are never read [INFO] [stdout] --> src/webservice_hedge/unhedge_task.rs:28:16 [INFO] [stdout] | [INFO] [stdout] 21 | pub struct HedgerWsUnhedgeTask { [INFO] [stdout] | ------------------- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 28 | pub(crate) progress_callback: HedgeProgressCallback, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] 29 | pub(crate) original_spot_target: Decimal, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ApiResponse` is never constructed [INFO] [stdout] --> src/exchange/bybit.rs:31:8 [INFO] [stdout] | [INFO] [stdout] 31 | struct ApiResponse { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `category` is never read [INFO] [stdout] --> src/exchange/bybit.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 86 | struct RiskLimitResult { [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] 87 | category: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RiskLimitResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `symbol` is never read [INFO] [stdout] --> src/exchange/bybit.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 92 | struct RiskLimitEntry { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] 93 | id: u64, [INFO] [stdout] 94 | symbol: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RiskLimitEntry` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `link_id` is never read [INFO] [stdout] --> src/exchange/bybit.rs:125:5 [INFO] [stdout] | [INFO] [stdout] 121 | struct OrderCreateResult { [INFO] [stdout] | ----------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 125 | link_id: String, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `OrderCreateResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `id` is never read [INFO] [stdout] --> src/exchange/bybit.rs:137:5 [INFO] [stdout] | [INFO] [stdout] 135 | struct OrderQueryEntry { [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] 136 | #[serde(rename = "orderId")] [INFO] [stdout] 137 | id: String, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `OrderQueryEntry` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `category` is never read [INFO] [stdout] --> src/exchange/bybit.rs:186:5 [INFO] [stdout] | [INFO] [stdout] 185 | struct FuturesTickersApiResult { [INFO] [stdout] | ----------------------- field in this struct [INFO] [stdout] 186 | category: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `FuturesTickersApiResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `ts` is never read [INFO] [stdout] --> src/exchange/bybit_ws/types_internal.rs:23:16 [INFO] [stdout] | [INFO] [stdout] 13 | pub(super) struct BybitWsResponse { // Делаем pub(super), чтобы были видны в protocol.rs [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 23 | pub(super) ts: Option, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `BybitWsResponse` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `max_wait` is never read [INFO] [stdout] --> src/hedger/mod.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 25 | pub struct Hedger { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 28 | max_wait: Duration, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Hedger` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `opposite` is never used [INFO] [stdout] --> src/hedger/common.rs:682:8 [INFO] [stdout] | [INFO] [stdout] 680 | trait SideSign { [INFO] [stdout] | -------- method in this trait [INFO] [stdout] 681 | fn sign(&self) -> f64; [INFO] [stdout] 682 | fn opposite(&self) -> Self; // Added opposite helper [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `progress_callback` and `original_spot_target` are never read [INFO] [stdout] --> src/webservice_hedge/unhedge_task.rs:28:16 [INFO] [stdout] | [INFO] [stdout] 21 | pub struct HedgerWsUnhedgeTask { [INFO] [stdout] | ------------------- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 28 | pub(crate) progress_callback: HedgeProgressCallback, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] 29 | pub(crate) original_spot_target: Decimal, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchange/bybit.rs:243:20 [INFO] [stdout] | [INFO] [stdout] 243 | balance_cache: Arc, SystemTime)>>>, [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 `map_or` can be simplified [INFO] [stdout] --> src/exchange/bybit.rs:520:54 [INFO] [stdout] | [INFO] [stdout] 520 | if result_val.is_object() && result_val.as_object().map_or(false, |obj| obj.is_empty()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 520 - if result_val.is_object() && result_val.as_object().map_or(false, |obj| obj.is_empty()) { [INFO] [stdout] 520 + if result_val.is_object() && result_val.as_object().is_some_and(|obj| obj.is_empty()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchange/bybit.rs:243:20 [INFO] [stdout] | [INFO] [stdout] 243 | balance_cache: Arc, SystemTime)>>>, [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 `map_or` can be simplified [INFO] [stdout] --> src/exchange/bybit.rs:520:54 [INFO] [stdout] | [INFO] [stdout] 520 | if result_val.is_object() && result_val.as_object().map_or(false, |obj| obj.is_empty()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 520 - if result_val.is_object() && result_val.as_object().map_or(false, |obj| obj.is_empty()) { [INFO] [stdout] 520 + if result_val.is_object() && result_val.as_object().is_some_and(|obj| obj.is_empty()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchange/bybit_ws/types_internal.rs:109:58 [INFO] [stdout] | [INFO] [stdout] 109 | pub(super) fn parse_public_trade_update(data: Value) -> Result, anyhow::Error> { // Воз... [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: called `unwrap` on `min_order_qty_decimal` after checking its variant with `is_some` [INFO] [stdout] --> src/hedger/common.rs:364:48 [INFO] [stdout] | [INFO] [stdout] 361 | if is_spot && side == OrderSide::Sell && min_order_qty_decimal.is_some() { [INFO] [stdout] | ------------------------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 364 | && remaining_total_qty_d < min_order_qty_decimal.unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `min_order_qty_decimal` after checking its variant with `is_some` [INFO] [stdout] --> src/hedger/common.rs:368:83 [INFO] [stdout] | [INFO] [stdout] 361 | if is_spot && side == OrderSide::Sell && min_order_qty_decimal.is_some() { [INFO] [stdout] | ------------------------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 368 | operation_id, remaining_total_qty, remaining_total_qty_d, min_order_qty_decimal.unwrap(), stage [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | / if is_spot { [INFO] [stdout] 118 | | if let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 119 | | error!("op_id:{}: Failed update initial spot order info in DB: {}", operation_id, e); [INFO] [stdout] 120 | | } [INFO] [stdout] 121 | | } [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] 117 ~ if is_spot [INFO] [stdout] 118 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 119 | error!("op_id:{}: Failed update initial spot order info in DB: {}", operation_id, e); [INFO] [stdout] 120 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:196:26 [INFO] [stdout] | [INFO] [stdout] 196 | / ... if is_spot { [INFO] [stdout] 197 | | ... if let Err(db_err) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 198 | | ... error!("op_id:{}: Failed update DB after {} order not found: {}", operation_id, if is_spot { "spot" } else { "futur... [INFO] [stdout] 199 | | ... } [INFO] [stdout] 200 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 196 ~ if is_spot [INFO] [stdout] 197 ~ && let Err(db_err) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 198 | error!("op_id:{}: Failed update DB after {} order not found: {}", operation_id, if is_spot { "spot" } else { "futures" }, db_err); [INFO] [stdout] 199 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:251:17 [INFO] [stdout] | [INFO] [stdout] 251 | / if is_spot { [INFO] [stdout] 252 | | if let Err(e) = update_hedge_spot_order( [INFO] [stdout] 253 | | db, [INFO] [stdout] 254 | | operation_id, [INFO] [stdout] ... | [INFO] [stdout] 265 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 251 ~ if is_spot [INFO] [stdout] 252 ~ && let Err(e) = update_hedge_spot_order( [INFO] [stdout] 253 | db, [INFO] [stdout] ... [INFO] [stdout] 263 | ); [INFO] [stdout] 264 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchange/bybit_ws/types_internal.rs:109:58 [INFO] [stdout] | [INFO] [stdout] 109 | pub(super) fn parse_public_trade_update(data: Value) -> Result, anyhow::Error> { // Воз... [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: called `unwrap` on `min_order_qty_decimal` after checking its variant with `is_some` [INFO] [stdout] --> src/hedger/common.rs:364:48 [INFO] [stdout] | [INFO] [stdout] 361 | if is_spot && side == OrderSide::Sell && min_order_qty_decimal.is_some() { [INFO] [stdout] | ------------------------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 364 | && remaining_total_qty_d < min_order_qty_decimal.unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `min_order_qty_decimal` after checking its variant with `is_some` [INFO] [stdout] --> src/hedger/common.rs:368:83 [INFO] [stdout] | [INFO] [stdout] 361 | if is_spot && side == OrderSide::Sell && min_order_qty_decimal.is_some() { [INFO] [stdout] | ------------------------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 368 | operation_id, remaining_total_qty, remaining_total_qty_d, min_order_qty_decimal.unwrap(), stage [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | / if is_spot { [INFO] [stdout] 118 | | if let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 119 | | error!("op_id:{}: Failed update initial spot order info in DB: {}", operation_id, e); [INFO] [stdout] 120 | | } [INFO] [stdout] 121 | | } [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] 117 ~ if is_spot [INFO] [stdout] 118 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 119 | error!("op_id:{}: Failed update initial spot order info in DB: {}", operation_id, e); [INFO] [stdout] 120 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:388:37 [INFO] [stdout] | [INFO] [stdout] 388 | / ... if is_spot { [INFO] [stdout] 389 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 390 | | ... error!("op_id:{}: Failed update DB after dust cancel fill: {}", operation_id, e); [INFO] [stdout] 391 | | ... } [INFO] [stdout] 392 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 388 ~ if is_spot [INFO] [stdout] 389 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 390 | error!("op_id:{}: Failed update DB after dust cancel fill: {}", operation_id, e); [INFO] [stdout] 391 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:196:26 [INFO] [stdout] | [INFO] [stdout] 196 | / ... if is_spot { [INFO] [stdout] 197 | | ... if let Err(db_err) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 198 | | ... error!("op_id:{}: Failed update DB after {} order not found: {}", operation_id, if is_spot { "spot" } else { "futur... [INFO] [stdout] 199 | | ... } [INFO] [stdout] 200 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 196 ~ if is_spot [INFO] [stdout] 197 ~ && let Err(db_err) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 198 | error!("op_id:{}: Failed update DB after {} order not found: {}", operation_id, if is_spot { "spot" } else { "futures" }, db_err); [INFO] [stdout] 199 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:251:17 [INFO] [stdout] | [INFO] [stdout] 251 | / if is_spot { [INFO] [stdout] 252 | | if let Err(e) = update_hedge_spot_order( [INFO] [stdout] 253 | | db, [INFO] [stdout] 254 | | operation_id, [INFO] [stdout] ... | [INFO] [stdout] 265 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 251 ~ if is_spot [INFO] [stdout] 252 ~ && let Err(e) = update_hedge_spot_order( [INFO] [stdout] 253 | db, [INFO] [stdout] ... [INFO] [stdout] 263 | ); [INFO] [stdout] 264 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:437:33 [INFO] [stdout] | [INFO] [stdout] 437 | / ... if is_spot { [INFO] [stdout] 438 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 439 | | ... error!("op_id:{}: Failed update DB after cancel fill: {}", operation_id, e); [INFO] [stdout] 440 | | ... } [INFO] [stdout] 441 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 437 ~ if is_spot [INFO] [stdout] 438 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 439 | error!("op_id:{}: Failed update DB after cancel fill: {}", operation_id, e); [INFO] [stdout] 440 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:459:33 [INFO] [stdout] | [INFO] [stdout] 459 | / ... if is_spot { [INFO] [stdout] 460 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 461 | | ... error!("op_id:{}: Failed update DB after final cancel correction: {}", operation_id, e); [INFO] [stdout] 462 | | ... } [INFO] [stdout] 463 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 459 ~ if is_spot [INFO] [stdout] 460 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 461 | error!("op_id:{}: Failed update DB after final cancel correction: {}", operation_id, e); [INFO] [stdout] 462 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:530:13 [INFO] [stdout] | [INFO] [stdout] 530 | / ... if is_spot { [INFO] [stdout] 531 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 532 | | ... error!("op_id:{}: Failed update DB after replacement order placement: {}", operation_id, e); [INFO] [stdout] 533 | | ... } [INFO] [stdout] 534 | | ... } [INFO] [stdout] | |________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 530 ~ if is_spot [INFO] [stdout] 531 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 532 | error!("op_id:{}: Failed update DB after replacement order placement: {}", operation_id, e); [INFO] [stdout] 533 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:388:37 [INFO] [stdout] | [INFO] [stdout] 388 | / ... if is_spot { [INFO] [stdout] 389 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 390 | | ... error!("op_id:{}: Failed update DB after dust cancel fill: {}", operation_id, e); [INFO] [stdout] 391 | | ... } [INFO] [stdout] 392 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 388 ~ if is_spot [INFO] [stdout] 389 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 390 | error!("op_id:{}: Failed update DB after dust cancel fill: {}", operation_id, e); [INFO] [stdout] 391 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:556:13 [INFO] [stdout] | [INFO] [stdout] 556 | / if let Err(e) = progress_callback(update).await { [INFO] [stdout] 557 | | if !e.to_string().contains("message is not modified") { [INFO] [stdout] 558 | | warn!("op_id:{}: Progress callback failed (Stage: {:?}): {}", operation_id, stage, e); [INFO] [stdout] 559 | | } [INFO] [stdout] 560 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 556 ~ if let Err(e) = progress_callback(update).await [INFO] [stdout] 557 ~ && !e.to_string().contains("message is not modified") { [INFO] [stdout] 558 | warn!("op_id:{}: Progress callback failed (Stage: {:?}): {}", operation_id, stage, e); [INFO] [stdout] 559 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:437:33 [INFO] [stdout] | [INFO] [stdout] 437 | / ... if is_spot { [INFO] [stdout] 438 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 439 | | ... error!("op_id:{}: Failed update DB after cancel fill: {}", operation_id, e); [INFO] [stdout] 440 | | ... } [INFO] [stdout] 441 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 437 ~ if is_spot [INFO] [stdout] 438 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 439 | error!("op_id:{}: Failed update DB after cancel fill: {}", operation_id, e); [INFO] [stdout] 440 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:459:33 [INFO] [stdout] | [INFO] [stdout] 459 | / ... if is_spot { [INFO] [stdout] 460 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 461 | | ... error!("op_id:{}: Failed update DB after final cancel correction: {}", operation_id, e); [INFO] [stdout] 462 | | ... } [INFO] [stdout] 463 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 459 ~ if is_spot [INFO] [stdout] 460 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 461 | error!("op_id:{}: Failed update DB after final cancel correction: {}", operation_id, e); [INFO] [stdout] 462 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:530:13 [INFO] [stdout] | [INFO] [stdout] 530 | / ... if is_spot { [INFO] [stdout] 531 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 532 | | ... error!("op_id:{}: Failed update DB after replacement order placement: {}", operation_id, e); [INFO] [stdout] 533 | | ... } [INFO] [stdout] 534 | | ... } [INFO] [stdout] | |________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 530 ~ if is_spot [INFO] [stdout] 531 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 532 | error!("op_id:{}: Failed update DB after replacement order placement: {}", operation_id, e); [INFO] [stdout] 533 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:556:13 [INFO] [stdout] | [INFO] [stdout] 556 | / if let Err(e) = progress_callback(update).await { [INFO] [stdout] 557 | | if !e.to_string().contains("message is not modified") { [INFO] [stdout] 558 | | warn!("op_id:{}: Progress callback failed (Stage: {:?}): {}", operation_id, stage, e); [INFO] [stdout] 559 | | } [INFO] [stdout] 560 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 556 ~ if let Err(e) = progress_callback(update).await [INFO] [stdout] 557 ~ && !e.to_string().contains("message is not modified") { [INFO] [stdout] 558 | warn!("op_id:{}: Progress callback failed (Stage: {:?}): {}", operation_id, stage, e); [INFO] [stdout] 559 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/hedge.rs:273:5 [INFO] [stdout] | [INFO] [stdout] 273 | / if let Err(error) = progress_callback(spot_done_update).await { [INFO] [stdout] 274 | | if !error.to_string().contains("message is not modified") { [INFO] [stdout] 275 | | warn!( [INFO] [stdout] 276 | | "op_id:{}: Progress callback failed after spot fill: {}", [INFO] [stdout] ... | [INFO] [stdout] 280 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 273 ~ if let Err(error) = progress_callback(spot_done_update).await [INFO] [stdout] 274 ~ && !error.to_string().contains("message is not modified") { [INFO] [stdout] 275 | warn!( [INFO] [stdout] ... [INFO] [stdout] 278 | ); [INFO] [stdout] 279 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/hedge.rs:273:5 [INFO] [stdout] | [INFO] [stdout] 273 | / if let Err(error) = progress_callback(spot_done_update).await { [INFO] [stdout] 274 | | if !error.to_string().contains("message is not modified") { [INFO] [stdout] 275 | | warn!( [INFO] [stdout] 276 | | "op_id:{}: Progress callback failed after spot fill: {}", [INFO] [stdout] ... | [INFO] [stdout] 280 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 273 ~ if let Err(error) = progress_callback(spot_done_update).await [INFO] [stdout] 274 ~ && !error.to_string().contains("message is not modified") { [INFO] [stdout] 275 | warn!( [INFO] [stdout] ... [INFO] [stdout] 278 | ); [INFO] [stdout] 279 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/hedge.rs:436:5 [INFO] [stdout] | [INFO] [stdout] 436 | / if let Err(error) = progress_callback(futures_done_update).await { [INFO] [stdout] 437 | | if !error.to_string().contains("message is not modified") { [INFO] [stdout] 438 | | warn!("op_id:{}: Futures progress callback failed: {}", operation_identifier, error); [INFO] [stdout] 439 | | } [INFO] [stdout] 440 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 436 ~ if let Err(error) = progress_callback(futures_done_update).await [INFO] [stdout] 437 ~ && !error.to_string().contains("message is not modified") { [INFO] [stdout] 438 | warn!("op_id:{}: Futures progress callback failed: {}", operation_identifier, error); [INFO] [stdout] 439 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/hedge.rs:436:5 [INFO] [stdout] | [INFO] [stdout] 436 | / if let Err(error) = progress_callback(futures_done_update).await { [INFO] [stdout] 437 | | if !error.to_string().contains("message is not modified") { [INFO] [stdout] 438 | | warn!("op_id:{}: Futures progress callback failed: {}", operation_identifier, error); [INFO] [stdout] 439 | | } [INFO] [stdout] 440 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 436 ~ if let Err(error) = progress_callback(futures_done_update).await [INFO] [stdout] 437 ~ && !error.to_string().contains("message is not modified") { [INFO] [stdout] 438 | warn!("op_id:{}: Futures progress callback failed: {}", operation_identifier, error); [INFO] [stdout] 439 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/hedger/unhedge.rs:114:9 [INFO] [stdout] | [INFO] [stdout] 114 | Decimal::try_from(actual_spot_sell_qty).unwrap_or_else(|_| Decimal::ZERO); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 114 - Decimal::try_from(actual_spot_sell_qty).unwrap_or_else(|_| Decimal::ZERO); [INFO] [stdout] 114 + Decimal::try_from(actual_spot_sell_qty).unwrap_or(Decimal::ZERO); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/unhedge.rs:213:5 [INFO] [stdout] | [INFO] [stdout] 213 | / if let Err(e) = progress_callback(spot_done_update).await { [INFO] [stdout] 214 | | if !e.to_string().contains("message is not modified") { [INFO] [stdout] 215 | | warn!( [INFO] [stdout] 216 | | "op_id:{}: Unhedge progress callback failed after spot sell: {}", [INFO] [stdout] ... | [INFO] [stdout] 220 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 213 ~ if let Err(e) = progress_callback(spot_done_update).await [INFO] [stdout] 214 ~ && !e.to_string().contains("message is not modified") { [INFO] [stdout] 215 | warn!( [INFO] [stdout] ... [INFO] [stdout] 218 | ); [INFO] [stdout] 219 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/hedger/unhedge.rs:114:9 [INFO] [stdout] | [INFO] [stdout] 114 | Decimal::try_from(actual_spot_sell_qty).unwrap_or_else(|_| Decimal::ZERO); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 114 - Decimal::try_from(actual_spot_sell_qty).unwrap_or_else(|_| Decimal::ZERO); [INFO] [stdout] 114 + Decimal::try_from(actual_spot_sell_qty).unwrap_or(Decimal::ZERO); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/unhedge.rs:213:5 [INFO] [stdout] | [INFO] [stdout] 213 | / if let Err(e) = progress_callback(spot_done_update).await { [INFO] [stdout] 214 | | if !e.to_string().contains("message is not modified") { [INFO] [stdout] 215 | | warn!( [INFO] [stdout] 216 | | "op_id:{}: Unhedge progress callback failed after spot sell: {}", [INFO] [stdout] ... | [INFO] [stdout] 220 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 213 ~ if let Err(e) = progress_callback(spot_done_update).await [INFO] [stdout] 214 ~ && !e.to_string().contains("message is not modified") { [INFO] [stdout] 215 | warn!( [INFO] [stdout] ... [INFO] [stdout] 218 | ); [INFO] [stdout] 219 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/wallet_info.rs:58:13 [INFO] [stdout] | [INFO] [stdout] 58 | / if include_approx_value && coin != quote_currency { [INFO] [stdout] 59 | | if let Some(price) = prices.get(&coin) { [INFO] [stdout] 60 | | let total_qty = balance.free + balance.locked; [INFO] [stdout] 61 | | if total_qty > ORDER_FILL_TOLERANCE && *price > 0.0 { [INFO] [stdout] ... | [INFO] [stdout] 66 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 58 ~ if include_approx_value && coin != quote_currency [INFO] [stdout] 59 ~ && let Some(price) = prices.get(&coin) { [INFO] [stdout] 60 | let total_qty = balance.free + balance.locked; [INFO] [stdout] ... [INFO] [stdout] 64 | } [INFO] [stdout] 65 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/wallet_info.rs:58:13 [INFO] [stdout] | [INFO] [stdout] 58 | / if include_approx_value && coin != quote_currency { [INFO] [stdout] 59 | | if let Some(price) = prices.get(&coin) { [INFO] [stdout] 60 | | let total_qty = balance.free + balance.locked; [INFO] [stdout] 61 | | if total_qty > ORDER_FILL_TOLERANCE && *price > 0.0 { [INFO] [stdout] ... | [INFO] [stdout] 66 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 58 ~ if include_approx_value && coin != quote_currency [INFO] [stdout] 59 ~ && let Some(price) = prices.get(&coin) { [INFO] [stdout] 60 | let total_qty = balance.free + balance.locked; [INFO] [stdout] ... [INFO] [stdout] 64 | } [INFO] [stdout] 65 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/hedge_flow.rs:27:1 [INFO] [stdout] | [INFO] [stdout] 27 | / pub async fn handle_hedge_command( [INFO] [stdout] 28 | | bot: Bot, msg: Message, symbol_arg: String, exchange: Arc, state_storage: StateStorage, [INFO] [stdout] 29 | | running_operations: RunningOperations, cfg: Arc, db: Arc [INFO] [stdout] 30 | | ) -> anyhow::Result<()> [INFO] [stdout] 31 | | where E: Exchange + Clone + Send + Sync + 'static { [INFO] [stdout] | |_________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/unhedge_flow.rs:104:1 [INFO] [stdout] | [INFO] [stdout] 104 | / async fn spawn_unhedge_task( [INFO] [stdout] 105 | | bot: Bot, [INFO] [stdout] 106 | | exchange: Arc, [INFO] [stdout] 107 | | cfg: Arc, [INFO] [stdout] ... | [INFO] [stdout] 114 | | where [INFO] [stdout] 115 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/hedge_flow.rs:27:1 [INFO] [stdout] | [INFO] [stdout] 27 | / pub async fn handle_hedge_command( [INFO] [stdout] 28 | | bot: Bot, msg: Message, symbol_arg: String, exchange: Arc, state_storage: StateStorage, [INFO] [stdout] 29 | | running_operations: RunningOperations, cfg: Arc, db: Arc [INFO] [stdout] 30 | | ) -> anyhow::Result<()> [INFO] [stdout] 31 | | where E: Exchange + Clone + Send + Sync + 'static { [INFO] [stdout] | |_________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/unhedge_flow.rs:104:1 [INFO] [stdout] | [INFO] [stdout] 104 | / async fn spawn_unhedge_task( [INFO] [stdout] 105 | | bot: Bot, [INFO] [stdout] 106 | | exchange: Arc, [INFO] [stdout] 107 | | cfg: Arc, [INFO] [stdout] ... | [INFO] [stdout] 114 | | where [INFO] [stdout] 115 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/unhedge_flow.rs:371:1 [INFO] [stdout] | [INFO] [stdout] 371 | / pub async fn handle_unhedge_command( [INFO] [stdout] 372 | | bot: Bot, [INFO] [stdout] 373 | | msg: Message, [INFO] [stdout] 374 | | symbol_arg: String, [INFO] [stdout] ... | [INFO] [stdout] 381 | | where [INFO] [stdout] 382 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/unhedge_flow.rs:404:5 [INFO] [stdout] | [INFO] [stdout] 404 | / if let Some(bot_msg_id) = previous_bot_message_id { [INFO] [stdout] 405 | | if let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { warn!("Failed delete prev bot msg: {}", e); } [INFO] [stdout] 406 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 404 ~ if let Some(bot_msg_id) = previous_bot_message_id [INFO] [stdout] 405 ~ && let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { warn!("Failed delete prev bot msg: {}", e); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/unhedge_flow.rs:371:1 [INFO] [stdout] | [INFO] [stdout] 371 | / pub async fn handle_unhedge_command( [INFO] [stdout] 372 | | bot: Bot, [INFO] [stdout] 373 | | msg: Message, [INFO] [stdout] 374 | | symbol_arg: String, [INFO] [stdout] ... | [INFO] [stdout] 381 | | where [INFO] [stdout] 382 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/unhedge_flow.rs:404:5 [INFO] [stdout] | [INFO] [stdout] 404 | / if let Some(bot_msg_id) = previous_bot_message_id { [INFO] [stdout] 405 | | if let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { warn!("Failed delete prev bot msg: {}", e); } [INFO] [stdout] 406 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 404 ~ if let Some(bot_msg_id) = previous_bot_message_id [INFO] [stdout] 405 ~ && let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { warn!("Failed delete prev bot msg: {}", e); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be written as a `let` statement [INFO] [stdout] --> src/notifier/active_ops.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | / let filled_qty = match info.total_filled_spot_qty.lock().await { [INFO] [stdout] 53 | | guard => *guard, [INFO] [stdout] ... | [INFO] [stdout] 59 | | }; [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 52 ~ let guard = info.total_filled_spot_qty.lock().await; [INFO] [stdout] 53 + let filled_qty = *guard; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be written as a `let` statement [INFO] [stdout] --> src/notifier/active_ops.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | / let filled_qty = match info.total_filled_spot_qty.lock().await { [INFO] [stdout] 53 | | guard => *guard, [INFO] [stdout] ... | [INFO] [stdout] 59 | | }; [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 52 ~ let guard = info.total_filled_spot_qty.lock().await; [INFO] [stdout] 53 + let filled_qty = *guard; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assignment could be simplified [INFO] [stdout] --> src/notifier/active_ops.rs:165:25 [INFO] [stdout] | [INFO] [stdout] 165 | / filled_spot_qty_in_operation = match info.total_filled_spot_qty.lock().await { [INFO] [stdout] 166 | | guard => *guard, [INFO] [stdout] ... | [INFO] [stdout] 171 | | }; [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] help: consider removing the `match` expression [INFO] [stdout] | [INFO] [stdout] 165 ~ let guard = info.total_filled_spot_qty.lock().await; [INFO] [stdout] 166 ~ filled_spot_qty_in_operation = *guard; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assignment could be simplified [INFO] [stdout] --> src/notifier/active_ops.rs:165:25 [INFO] [stdout] | [INFO] [stdout] 165 | / filled_spot_qty_in_operation = match info.total_filled_spot_qty.lock().await { [INFO] [stdout] 166 | | guard => *guard, [INFO] [stdout] ... | [INFO] [stdout] 171 | | }; [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] help: consider removing the `match` expression [INFO] [stdout] | [INFO] [stdout] 165 ~ let guard = info.total_filled_spot_qty.lock().await; [INFO] [stdout] 166 ~ filled_spot_qty_in_operation = *guard; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/active_ops.rs:384:38 [INFO] [stdout] | [INFO] [stdout] 384 | ... } else if filled_spot_qty_in_operation > ORDER_FILL_TOLERANCE { [INFO] [stdout] | ______________^ [INFO] [stdout] 385 | | ... if final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") |... [INFO] [stdout] 386 | | ... final_text.push_str("\nПопытка продать накопленный спот не удалась."); [INFO] [stdout] 387 | | ... } [INFO] [stdout] 388 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 384 ~ } else if filled_spot_qty_in_operation > ORDER_FILL_TOLERANCE [INFO] [stdout] 385 ~ && final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] 386 | final_text.push_str("\nПопытка продать накопленный спот не удалась."); [INFO] [stdout] 387 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/notifier/active_ops.rs:385:39 [INFO] [stdout] | [INFO] [stdout] 385 | ...if final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 385 - if final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] 385 + if final_error_message.as_ref().is_some_and(|s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/active_ops.rs:384:38 [INFO] [stdout] | [INFO] [stdout] 384 | ... } else if filled_spot_qty_in_operation > ORDER_FILL_TOLERANCE { [INFO] [stdout] | ______________^ [INFO] [stdout] 385 | | ... if final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") |... [INFO] [stdout] 386 | | ... final_text.push_str("\nПопытка продать накопленный спот не удалась."); [INFO] [stdout] 387 | | ... } [INFO] [stdout] 388 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 384 ~ } else if filled_spot_qty_in_operation > ORDER_FILL_TOLERANCE [INFO] [stdout] 385 ~ && final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] 386 | final_text.push_str("\nПопытка продать накопленный спот не удалась."); [INFO] [stdout] 387 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/notifier/active_ops.rs:385:39 [INFO] [stdout] | [INFO] [stdout] 385 | ...if final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 385 - if final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] 385 + if final_error_message.as_ref().is_some_and(|s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | / pub async fn handle_hedge_command( [INFO] [stdout] 22 | | bot: Bot, [INFO] [stdout] 23 | | msg: Message, [INFO] [stdout] 24 | | symbol_arg: String, [INFO] [stdout] ... | [INFO] [stdout] 31 | | where [INFO] [stdout] 32 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | / pub async fn handle_hedge_command( [INFO] [stdout] 22 | | bot: Bot, [INFO] [stdout] 23 | | msg: Message, [INFO] [stdout] 24 | | symbol_arg: String, [INFO] [stdout] ... | [INFO] [stdout] 31 | | where [INFO] [stdout] 32 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | / if let Some(bot_msg_id) = previous_bot_message_id { [INFO] [stdout] 60 | | if let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { [INFO] [stdout] 61 | | warn!("Failed delete prev bot msg {}: {}", bot_msg_id, e); [INFO] [stdout] 62 | | } [INFO] [stdout] 63 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 59 ~ if let Some(bot_msg_id) = previous_bot_message_id [INFO] [stdout] 60 ~ && let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { [INFO] [stdout] 61 | warn!("Failed delete prev bot msg {}: {}", bot_msg_id, e); [INFO] [stdout] 62 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | / if let Some(bot_msg_id) = previous_bot_message_id { [INFO] [stdout] 60 | | if let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { [INFO] [stdout] 61 | | warn!("Failed delete prev bot msg {}: {}", bot_msg_id, e); [INFO] [stdout] 62 | | } [INFO] [stdout] 63 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 59 ~ if let Some(bot_msg_id) = previous_bot_message_id [INFO] [stdout] 60 ~ && let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { [INFO] [stdout] 61 | warn!("Failed delete prev bot msg {}: {}", bot_msg_id, e); [INFO] [stdout] 62 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:497:35 [INFO] [stdout] | [INFO] [stdout] 497 | let error_text = format!("⚠️ Волатильность должна быть не отрицательной (в %). Введите снова:"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"⚠️ Волатильность должна быть не отрицательной (в %). Введите снова:".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: useless use of `format!` [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:505:35 [INFO] [stdout] | [INFO] [stdout] 505 | let error_text = format!("⚠️ Неверный формат волатильности (в %). Введите снова:"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"⚠️ Неверный формат волатильности (в %). Введите снова:".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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:497:35 [INFO] [stdout] | [INFO] [stdout] 497 | let error_text = format!("⚠️ Волатильность должна быть не отрицательной (в %). Введите снова:"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"⚠️ Волатильность должна быть не отрицательной (в %). Введите снова:".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: useless use of `format!` [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:505:35 [INFO] [stdout] | [INFO] [stdout] 505 | let error_text = format!("⚠️ Неверный формат волатильности (в %). Введите снова:"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"⚠️ Неверный формат волатильности (в %). Введите снова:".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] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `anyhow::Error` [INFO] [stdout] --> src/notifier/hedge_flow_logic/ui.rs:118:25 [INFO] [stdout] | [INFO] [stdout] 118 | return Err(e.into()); [INFO] [stdout] | ^^^^^^^^ help: consider removing `.into()`: `e` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `anyhow::Error` [INFO] [stdout] --> src/notifier/hedge_flow_logic/ui.rs:118:25 [INFO] [stdout] | [INFO] [stdout] 118 | return Err(e.into()); [INFO] [stdout] | ^^^^^^^^ help: consider removing `.into()`: `e` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (10/7) [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:26:1 [INFO] [stdout] | [INFO] [stdout] 26 | / pub(super) async fn spawn_sequential_hedge_task( [INFO] [stdout] 27 | | bot: Bot, [INFO] [stdout] 28 | | exchange: Arc, [INFO] [stdout] 29 | | cfg: Arc, [INFO] [stdout] ... | [INFO] [stdout] 38 | | where [INFO] [stdout] 39 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (10/7) [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:26:1 [INFO] [stdout] | [INFO] [stdout] 26 | / pub(super) async fn spawn_sequential_hedge_task( [INFO] [stdout] 27 | | bot: Bot, [INFO] [stdout] 28 | | exchange: Arc, [INFO] [stdout] 29 | | cfg: Arc, [INFO] [stdout] ... | [INFO] [stdout] 38 | | where [INFO] [stdout] 39 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:129:14 [INFO] [stdout] | [INFO] [stdout] 129 | / if let Err(e) = bot_for_callback.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await { [INFO] [stdout] 130 | | if !e.to_string().contains("not modified") { warn!("op_id:{}: Progress callback failed: {}", operation_id_cb, e); } [INFO] [stdout] 131 | | } [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 129 ~ if let Err(e) = bot_for_callback.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await [INFO] [stdout] 130 ~ && !e.to_string().contains("not modified") { warn!("op_id:{}: Progress callback failed: {}", operation_id_cb, e); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:129:14 [INFO] [stdout] | [INFO] [stdout] 129 | / if let Err(e) = bot_for_callback.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await { [INFO] [stdout] 130 | | if !e.to_string().contains("not modified") { warn!("op_id:{}: Progress callback failed: {}", operation_id_cb, e); } [INFO] [stdout] 131 | | } [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 129 ~ if let Err(e) = bot_for_callback.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await [INFO] [stdout] 130 ~ && !e.to_string().contains("not modified") { warn!("op_id:{}: Progress callback failed: {}", operation_id_cb, e); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:145:57 [INFO] [stdout] | [INFO] [stdout] 145 | ... = result.is_err() && result.as_ref().err().map_or(false, |e| e.to_string().contains("cancelled by user")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 145 - let is_cancelled_by_button = result.is_err() && result.as_ref().err().map_or(false, |e| e.to_string().contains("cancelled by user")); [INFO] [stdout] 145 + let is_cancelled_by_button = result.is_err() && result.as_ref().err().is_some_and(|e| e.to_string().contains("cancelled by user")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:145:57 [INFO] [stdout] | [INFO] [stdout] 145 | ... = result.is_err() && result.as_ref().err().map_or(false, |e| e.to_string().contains("cancelled by user")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 145 - let is_cancelled_by_button = result.is_err() && result.as_ref().err().map_or(false, |e| e.to_string().contains("cancelled by user")); [INFO] [stdout] 145 + let is_cancelled_by_button = result.is_err() && result.as_ref().err().is_some_and(|e| e.to_string().contains("cancelled by user")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:189:1 [INFO] [stdout] | [INFO] [stdout] 189 | / pub(super) async fn spawn_ws_hedge_task( [INFO] [stdout] 190 | | bot: Bot, [INFO] [stdout] 191 | | exchange_rest: Arc, [INFO] [stdout] 192 | | cfg: Arc, [INFO] [stdout] ... | [INFO] [stdout] 199 | | where [INFO] [stdout] 200 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:189:1 [INFO] [stdout] | [INFO] [stdout] 189 | / pub(super) async fn spawn_ws_hedge_task( [INFO] [stdout] 190 | | bot: Bot, [INFO] [stdout] 191 | | exchange_rest: Arc, [INFO] [stdout] 192 | | cfg: Arc, [INFO] [stdout] ... | [INFO] [stdout] 199 | | where [INFO] [stdout] 200 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:328:13 [INFO] [stdout] | [INFO] [stdout] 328 | / if let Err(e) = bot_cb.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await { [INFO] [stdout] 329 | | if !e.to_string().contains("message is not modified") { [INFO] [stdout] 330 | | warn!("op_id:{}: WS Progress callback failed: {}", operation_id_cb, e); [INFO] [stdout] 331 | | } [INFO] [stdout] 332 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 328 ~ if let Err(e) = bot_cb.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await [INFO] [stdout] 329 ~ && !e.to_string().contains("message is not modified") { [INFO] [stdout] 330 | warn!("op_id:{}: WS Progress callback failed: {}", operation_id_cb, e); [INFO] [stdout] 331 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:328:13 [INFO] [stdout] | [INFO] [stdout] 328 | / if let Err(e) = bot_cb.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await { [INFO] [stdout] 329 | | if !e.to_string().contains("message is not modified") { [INFO] [stdout] 330 | | warn!("op_id:{}: WS Progress callback failed: {}", operation_id_cb, e); [INFO] [stdout] 331 | | } [INFO] [stdout] 332 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 328 ~ if let Err(e) = bot_cb.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await [INFO] [stdout] 329 ~ && !e.to_string().contains("message is not modified") { [INFO] [stdout] 330 | warn!("op_id:{}: WS Progress callback failed: {}", operation_id_cb, e); [INFO] [stdout] 331 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/mod.rs:114:1 [INFO] [stdout] | [INFO] [stdout] 114 | / pub async fn dispatch_command( [INFO] [stdout] 115 | | bot: Bot, [INFO] [stdout] 116 | | msg: Message, [INFO] [stdout] 117 | | cmd: Command, [INFO] [stdout] ... | [INFO] [stdout] 123 | | ) -> anyhow::Result<()> [INFO] [stdout] 124 | | where E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |__________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/mod.rs:114:1 [INFO] [stdout] | [INFO] [stdout] 114 | / pub async fn dispatch_command( [INFO] [stdout] 115 | | bot: Bot, [INFO] [stdout] 116 | | msg: Message, [INFO] [stdout] 117 | | cmd: Command, [INFO] [stdout] ... | [INFO] [stdout] 123 | | ) -> anyhow::Result<()> [INFO] [stdout] 124 | | where E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |__________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/notifier/mod.rs:249:16 [INFO] [stdout] | [INFO] [stdout] 249 | if msg.text().map_or(false, |t| t.starts_with('/')) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 249 - if msg.text().map_or(false, |t| t.starts_with('/')) { [INFO] [stdout] 249 + if msg.text().is_some_and(|t| t.starts_with('/')) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/notifier/mod.rs:249:16 [INFO] [stdout] | [INFO] [stdout] 249 | if msg.text().map_or(false, |t| t.starts_with('/')) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 249 - if msg.text().map_or(false, |t| t.starts_with('/')) { [INFO] [stdout] 249 + if msg.text().is_some_and(|t| t.starts_with('/')) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/storage/db.rs:47:1 [INFO] [stdout] | [INFO] [stdout] 47 | / pub async fn insert_hedge_operation( [INFO] [stdout] 48 | | db: &Db, [INFO] [stdout] 49 | | chat_id: i64, [INFO] [stdout] 50 | | base_symbol: &str, [INFO] [stdout] ... | [INFO] [stdout] 55 | | target_futures_qty: f64, [INFO] [stdout] 56 | | ) -> Result { [INFO] [stdout] | |___________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/storage/db.rs:47:1 [INFO] [stdout] | [INFO] [stdout] 47 | / pub async fn insert_hedge_operation( [INFO] [stdout] 48 | | db: &Db, [INFO] [stdout] 49 | | chat_id: i64, [INFO] [stdout] 50 | | base_symbol: &str, [INFO] [stdout] ... | [INFO] [stdout] 55 | | target_futures_qty: f64, [INFO] [stdout] 56 | | ) -> Result { [INFO] [stdout] | |___________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (11/7) [INFO] [stdout] --> src/webservice_hedge/common.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / pub fn calculate_auto_chunk_parameters( [INFO] [stdout] 12 | | // --- Цели --- [INFO] [stdout] 13 | | initial_target_spot_value: Decimal, // Общая целевая стоимость спота (из расчета по волатильности) [INFO] [stdout] 14 | | initial_target_futures_quantity: Decimal, // Общий целевой объем фьючерса (из расчета) [INFO] [stdout] ... | [INFO] [stdout] 28 | | ) -> Result<(u32, Decimal, Decimal)> { [INFO] [stdout] | |____________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/common.rs:75:32 [INFO] [stdout] | [INFO] [stdout] 75 | ... = min_spot_notional_value.map_or(true, |min_val| chunk_spot_value_estimate >= min_val || chunk_spot_value_estimate < tolerance); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 75 - let spot_notional_ok = min_spot_notional_value.map_or(true, |min_val| chunk_spot_value_estimate >= min_val || chunk_spot_value_estimate < tolerance); [INFO] [stdout] 75 + let spot_notional_ok = min_spot_notional_value.is_none_or(|min_val| chunk_spot_value_estimate >= min_val || chunk_spot_value_estimate < tolerance); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/common.rs:80:35 [INFO] [stdout] | [INFO] [stdout] 80 | ... = min_futures_notional_value.map_or(true, |min_val| chunk_futures_value_estimate >= min_val || chunk_futures_value_estimate < tolerance); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 80 - let futures_notional_ok = min_futures_notional_value.map_or(true, |min_val| chunk_futures_value_estimate >= min_val || chunk_futures_value_estimate < tolerance); [INFO] [stdout] 80 + let futures_notional_ok = min_futures_notional_value.is_none_or(|min_val| chunk_futures_value_estimate >= min_val || chunk_futures_value_estimate < tolerance); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (11/7) [INFO] [stdout] --> src/webservice_hedge/common.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / pub fn calculate_auto_chunk_parameters( [INFO] [stdout] 12 | | // --- Цели --- [INFO] [stdout] 13 | | initial_target_spot_value: Decimal, // Общая целевая стоимость спота (из расчета по волатильности) [INFO] [stdout] 14 | | initial_target_futures_quantity: Decimal, // Общий целевой объем фьючерса (из расчета) [INFO] [stdout] ... | [INFO] [stdout] 28 | | ) -> Result<(u32, Decimal, Decimal)> { [INFO] [stdout] | |____________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/common.rs:75:32 [INFO] [stdout] | [INFO] [stdout] 75 | ... = min_spot_notional_value.map_or(true, |min_val| chunk_spot_value_estimate >= min_val || chunk_spot_value_estimate < tolerance); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 75 - let spot_notional_ok = min_spot_notional_value.map_or(true, |min_val| chunk_spot_value_estimate >= min_val || chunk_spot_value_estimate < tolerance); [INFO] [stdout] 75 + let spot_notional_ok = min_spot_notional_value.is_none_or(|min_val| chunk_spot_value_estimate >= min_val || chunk_spot_value_estimate < tolerance); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/common.rs:80:35 [INFO] [stdout] | [INFO] [stdout] 80 | ... = min_futures_notional_value.map_or(true, |min_val| chunk_futures_value_estimate >= min_val || chunk_futures_value_estimate < tolerance); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 80 - let futures_notional_ok = min_futures_notional_value.map_or(true, |min_val| chunk_futures_value_estimate >= min_val || chunk_futures_value_estimate < tolerance); [INFO] [stdout] 80 + let futures_notional_ok = min_futures_notional_value.is_none_or(|min_val| chunk_futures_value_estimate >= min_val || chunk_futures_value_estimate < tolerance); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/chunk_execution.rs:59:28 [INFO] [stdout] | [INFO] [stdout] 59 | let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 60 | | (spot_quantity_rounded * current_spot_price_estimate) >= min_val || spot_quantity_rounded < tolerance [INFO] [stdout] 61 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 59 - let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] 59 + let spot_notional_ok = task.state.min_spot_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/chunk_execution.rs:63:31 [INFO] [stdout] | [INFO] [stdout] 63 | let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 64 | | (futures_quantity_rounded * futures_price_estimate) >= min_val || futures_quantity_rounded < tolerance [INFO] [stdout] 65 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 63 - let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] 63 + let futures_notional_ok = task.state.min_futures_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/chunk_execution.rs:59:28 [INFO] [stdout] | [INFO] [stdout] 59 | let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 60 | | (spot_quantity_rounded * current_spot_price_estimate) >= min_val || spot_quantity_rounded < tolerance [INFO] [stdout] 61 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 59 - let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] 59 + let spot_notional_ok = task.state.min_spot_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/chunk_execution.rs:63:31 [INFO] [stdout] | [INFO] [stdout] 63 | let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 64 | | (futures_quantity_rounded * futures_price_estimate) >= min_val || futures_quantity_rounded < tolerance [INFO] [stdout] 65 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 63 - let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] 63 + let futures_notional_ok = task.state.min_futures_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | / ... if let Some(spot_order) = spot_order_opt { [INFO] [stdout] 27 | | ... if matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 28 | | ... if let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_marke... [INFO] [stdout] 29 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] ... | [INFO] [stdout] 39 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 26 ~ if let Some(spot_order) = spot_order_opt [INFO] [stdout] 27 ~ && matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 28 | if let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_market_data.last_update_time_ms) { [INFO] [stdout] ... [INFO] [stdout] 37 | } [INFO] [stdout] 38 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | / ... if matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 28 | | ... if let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_market_da... [INFO] [stdout] 29 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] 30 | | ... if spot_order.limit_price < best_ask * (Decimal::ONE - stale_ratio_decimal) { [INFO] [stdout] ... | [INFO] [stdout] 38 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 27 ~ if matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) [INFO] [stdout] 28 ~ && let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_market_data.last_update_time_ms) { [INFO] [stdout] 29 | if now_ms - last_update_time < 5000 { [INFO] [stdout] ... [INFO] [stdout] 36 | } else { trace!(operation_id = task.operation_id, "Spot market data is too old for stale check ({:.1}s)", (now_ms - last_update_time) as f64 / 1000.0); } [INFO] [stdout] 37 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | / ... if let Some(spot_order) = spot_order_opt { [INFO] [stdout] 27 | | ... if matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 28 | | ... if let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_marke... [INFO] [stdout] 29 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] ... | [INFO] [stdout] 39 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 26 ~ if let Some(spot_order) = spot_order_opt [INFO] [stdout] 27 ~ && matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 28 | if let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_market_data.last_update_time_ms) { [INFO] [stdout] ... [INFO] [stdout] 37 | } [INFO] [stdout] 38 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | / ... if matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 28 | | ... if let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_market_da... [INFO] [stdout] 29 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] 30 | | ... if spot_order.limit_price < best_ask * (Decimal::ONE - stale_ratio_decimal) { [INFO] [stdout] ... | [INFO] [stdout] 38 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 27 ~ if matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) [INFO] [stdout] 28 ~ && let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_market_data.last_update_time_ms) { [INFO] [stdout] 29 | if now_ms - last_update_time < 5000 { [INFO] [stdout] ... [INFO] [stdout] 36 | } else { trace!(operation_id = task.operation_id, "Spot market data is too old for stale check ({:.1}s)", (now_ms - last_update_time) as f64 / 1000.0); } [INFO] [stdout] 37 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | / ... if let Some(futures_order) = futures_order_opt { [INFO] [stdout] 44 | | ... if matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 45 | | ... if let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures... [INFO] [stdout] 46 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] ... | [INFO] [stdout] 56 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 43 ~ if let Some(futures_order) = futures_order_opt [INFO] [stdout] 44 ~ && matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 45 | if let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures_market_data.last_update_time_ms) { [INFO] [stdout] ... [INFO] [stdout] 54 | } [INFO] [stdout] 55 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | / ... if matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 45 | | ... if let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures_mar... [INFO] [stdout] 46 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] 47 | | ... if futures_order.limit_price > best_bid * (Decimal::ONE + stale_ratio_decimal) { [INFO] [stdout] ... | [INFO] [stdout] 55 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 44 ~ if matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) [INFO] [stdout] 45 ~ && let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures_market_data.last_update_time_ms) { [INFO] [stdout] 46 | if now_ms - last_update_time < 5000 { [INFO] [stdout] ... [INFO] [stdout] 53 | } else { trace!(operation_id = task.operation_id, "Futures market data is too old for stale check ({:.1}s)", (now_ms - last_update_time) as f64 / 1000.0); } [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | / ... if let Some(futures_order) = futures_order_opt { [INFO] [stdout] 44 | | ... if matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 45 | | ... if let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures... [INFO] [stdout] 46 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] ... | [INFO] [stdout] 56 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 43 ~ if let Some(futures_order) = futures_order_opt [INFO] [stdout] 44 ~ && matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 45 | if let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures_market_data.last_update_time_ms) { [INFO] [stdout] ... [INFO] [stdout] 54 | } [INFO] [stdout] 55 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | / ... if matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 45 | | ... if let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures_mar... [INFO] [stdout] 46 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] 47 | | ... if futures_order.limit_price > best_bid * (Decimal::ONE + stale_ratio_decimal) { [INFO] [stdout] ... | [INFO] [stdout] 55 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 44 ~ if matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) [INFO] [stdout] 45 ~ && let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures_market_data.last_update_time_ms) { [INFO] [stdout] 46 | if now_ms - last_update_time < 5000 { [INFO] [stdout] ... [INFO] [stdout] 53 | } else { trace!(operation_id = task.operation_id, "Futures market data is too old for stale check ({:.1}s)", (now_ms - last_update_time) as f64 / 1000.0); } [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | / ... if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone { [INFO] [stdout] 20 | | ... if details.order_id == *cancelled_order_id { [INFO] [stdout] 21 | | ... info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled."); [INFO] [stdout] 22 | | ... handle_order_update(task, details.clone()).await?; // <-- Вызываем ИСПРАВЛЕННУЮ версию ниже [INFO] [stdout] ... | [INFO] [stdout] 36 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 19 ~ if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone [INFO] [stdout] 20 ~ && details.order_id == *cancelled_order_id { [INFO] [stdout] 21 | info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled."); [INFO] [stdout] ... [INFO] [stdout] 34 | return Ok(()); [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | / ... if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone { [INFO] [stdout] 20 | | ... if details.order_id == *cancelled_order_id { [INFO] [stdout] 21 | | ... info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled."); [INFO] [stdout] 22 | | ... handle_order_update(task, details.clone()).await?; // <-- Вызываем ИСПРАВЛЕННУЮ версию ниже [INFO] [stdout] ... | [INFO] [stdout] 36 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 19 ~ if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone [INFO] [stdout] 20 ~ && details.order_id == *cancelled_order_id { [INFO] [stdout] 21 | info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled."); [INFO] [stdout] ... [INFO] [stdout] 34 | return Ok(()); [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:76:29 [INFO] [stdout] | [INFO] [stdout] 76 | let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 76 - let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 76 + let old_filled_qty = if task.state.active_spot_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:79:15 [INFO] [stdout] | [INFO] [stdout] 79 | } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 79 - } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 79 + } else if task.state.active_futures_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:76:29 [INFO] [stdout] | [INFO] [stdout] 76 | let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 76 - let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 76 + let old_filled_qty = if task.state.active_spot_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:79:15 [INFO] [stdout] | [INFO] [stdout] 79 | } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 79 - } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 79 + } else if task.state.active_futures_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:52:28 [INFO] [stdout] | [INFO] [stdout] 52 | let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 53 | | (spot_quantity_rounded * current_spot_price_estimate) >= min_val || spot_quantity_rounded < tolerance [INFO] [stdout] 54 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 52 - let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] 52 + let spot_notional_ok = task.state.min_spot_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:56:31 [INFO] [stdout] | [INFO] [stdout] 56 | let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 57 | | (futures_quantity_rounded * futures_price_estimate) >= min_val || futures_quantity_rounded < tolerance [INFO] [stdout] 58 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 56 - let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] 56 + let futures_notional_ok = task.state.min_futures_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:52:28 [INFO] [stdout] | [INFO] [stdout] 52 | let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 53 | | (spot_quantity_rounded * current_spot_price_estimate) >= min_val || spot_quantity_rounded < tolerance [INFO] [stdout] 54 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 52 - let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] 52 + let spot_notional_ok = task.state.min_spot_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:56:31 [INFO] [stdout] | [INFO] [stdout] 56 | let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 57 | | (futures_quantity_rounded * futures_price_estimate) >= min_val || futures_quantity_rounded < tolerance [INFO] [stdout] 58 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 56 - let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] 56 + let futures_notional_ok = task.state.min_futures_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | / ... if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone { [INFO] [stdout] 22 | | ... if details.order_id == *cancelled_order_id { [INFO] [stdout] 23 | | ... info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled (u... [INFO] [stdout] 24 | | ... handle_order_update(task, details.clone()).await?; [INFO] [stdout] ... | [INFO] [stdout] 40 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 21 ~ if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone [INFO] [stdout] 22 ~ && details.order_id == *cancelled_order_id { [INFO] [stdout] 23 | info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled (unhedge)."); [INFO] [stdout] ... [INFO] [stdout] 38 | return Ok(()); [INFO] [stdout] 39 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | / ... if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone { [INFO] [stdout] 22 | | ... if details.order_id == *cancelled_order_id { [INFO] [stdout] 23 | | ... info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled (u... [INFO] [stdout] 24 | | ... handle_order_update(task, details.clone()).await?; [INFO] [stdout] ... | [INFO] [stdout] 40 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 21 ~ if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone [INFO] [stdout] 22 ~ && details.order_id == *cancelled_order_id { [INFO] [stdout] 23 | info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled (unhedge)."); [INFO] [stdout] ... [INFO] [stdout] 38 | return Ok(()); [INFO] [stdout] 39 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:81:29 [INFO] [stdout] | [INFO] [stdout] 81 | let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 81 - let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 81 + let old_filled_qty = if task.state.active_spot_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:84:15 [INFO] [stdout] | [INFO] [stdout] 84 | } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 84 - } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 84 + } else if task.state.active_futures_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:81:29 [INFO] [stdout] | [INFO] [stdout] 81 | let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 81 - let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 81 + let old_filled_qty = if task.state.active_spot_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:84:15 [INFO] [stdout] | [INFO] [stdout] 84 | } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 84 - } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 84 + } else if task.state.active_futures_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/exchange/bybit.rs:1146:13 [INFO] [stdout] | [INFO] [stdout] 1146 | average_price: average_price, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `average_price` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/exchange/bybit.rs:1146:13 [INFO] [stdout] | [INFO] [stdout] 1146 | average_price: average_price, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `average_price` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `ChunkOrderState`, `HedgerWsState`, `HedgerWsStatus`, `Leg`, `MarketUpdate`, and `OperationType` [INFO] [stdout] --> src/webservice_hedge/mod.rs:10:17 [INFO] [stdout] | [INFO] [stdout] 10 | pub use state::{HedgerWsState, HedgerWsStatus, OperationType, MarketUpdate, Leg, ChunkOrderState}; [INFO] [stdout] | ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `ChunkOrderState`, `HedgerWsState`, `HedgerWsStatus`, `Leg`, `MarketUpdate`, and `OperationType` [INFO] [stdout] --> src/webservice_hedge/mod.rs:10:17 [INFO] [stdout] | [INFO] [stdout] 10 | pub use state::{HedgerWsState, HedgerWsStatus, OperationType, MarketUpdate, Leg, ChunkOrderState}; [INFO] [stdout] | ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Row` [INFO] [stdout] --> src/storage/schema.rs:6:28 [INFO] [stdout] | [INFO] [stdout] 6 | use sqlx::{Error, FromRow, Row}; [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Context` [INFO] [stdout] --> src/webservice_hedge/hedge_logic/chunk_execution.rs:3:30 [INFO] [stdout] | [INFO] [stdout] 3 | use anyhow::{anyhow, Result, Context}; // Добавили Context [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Context` [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:3:30 [INFO] [stdout] | [INFO] [stdout] 3 | use anyhow::{anyhow, Result, Context}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `rust_decimal::prelude` [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/init.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use rust_decimal::prelude::*; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Row` [INFO] [stdout] --> src/storage/schema.rs:6:28 [INFO] [stdout] | [INFO] [stdout] 6 | use sqlx::{Error, FromRow, Row}; [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Context` [INFO] [stdout] --> src/webservice_hedge/hedge_logic/chunk_execution.rs:3:30 [INFO] [stdout] | [INFO] [stdout] 3 | use anyhow::{anyhow, Result, Context}; // Добавили Context [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Context` [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:3:30 [INFO] [stdout] | [INFO] [stdout] 3 | use anyhow::{anyhow, Result, Context}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `rust_decimal::prelude` [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/init.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use rust_decimal::prelude::*; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `qty_filled_in_current_order` is never read [INFO] [stdout] --> src/hedger/common.rs:377:21 [INFO] [stdout] | [INFO] [stdout] 377 | qty_filled_in_current_order = 0.0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `current_order_id` is never read [INFO] [stdout] --> src/hedger/common.rs:59:48 [INFO] [stdout] | [INFO] [stdout] 59 | let mut current_order_id: Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `current_order_id` is never read [INFO] [stdout] --> src/hedger/common.rs:376:21 [INFO] [stdout] | [INFO] [stdout] 376 | current_order_id = None; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `last_placed_order_id` is never read [INFO] [stdout] --> src/hedger/common.rs:61:52 [INFO] [stdout] | [INFO] [stdout] 61 | let mut last_placed_order_id: Option = None; // Храним ID последнего *успешно размещенного* ордера [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `last_futures_filled_quantity` [INFO] [stdout] --> src/hedger/hedge.rs:388:17 [INFO] [stdout] | [INFO] [stdout] 388 | let last_futures_filled_quantity = *futures_filled_storage.lock().await; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_last_futures_filled_quantity` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `qc` [INFO] [stdout] --> src/notifier/unhedge_flow.rs:139:13 [INFO] [stdout] | [INFO] [stdout] 139 | let qc = cfg_for_callback.quote_currency.clone(); // Используем клон cfg [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_qc` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `qty_filled_in_current_order` is never read [INFO] [stdout] --> src/hedger/common.rs:377:21 [INFO] [stdout] | [INFO] [stdout] 377 | qty_filled_in_current_order = 0.0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `current_order_id` is never read [INFO] [stdout] --> src/hedger/common.rs:59:48 [INFO] [stdout] | [INFO] [stdout] 59 | let mut current_order_id: Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `current_order_id` is never read [INFO] [stdout] --> src/hedger/common.rs:376:21 [INFO] [stdout] | [INFO] [stdout] 376 | current_order_id = None; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `last_placed_order_id` is never read [INFO] [stdout] --> src/hedger/common.rs:61:52 [INFO] [stdout] | [INFO] [stdout] 61 | let mut last_placed_order_id: Option = None; // Храним ID последнего *успешно размещенного* ордера [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `operation_info_opt` is never read [INFO] [stdout] --> src/notifier/active_ops.rs:157:76 [INFO] [stdout] | [INFO] [stdout] 157 | let mut operation_info_opt: Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `filled_spot_qty_in_operation` is never read [INFO] [stdout] --> src/notifier/active_ops.rs:158:61 [INFO] [stdout] | [INFO] [stdout] 158 | let mut filled_spot_qty_in_operation: f64 = 0.0; [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `leg_found` is never read [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:68:25 [INFO] [stdout] | [INFO] [stdout] 68 | let mut leg_found = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `final_spot_qty` [INFO] [stdout] --> src/webservice_hedge/hedge_logic/reconciliation.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | let final_spot_qty = task.state.cumulative_spot_filled_quantity; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_final_spot_qty` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `last_futures_filled_quantity` [INFO] [stdout] --> src/hedger/hedge.rs:388:17 [INFO] [stdout] | [INFO] [stdout] 388 | let last_futures_filled_quantity = *futures_filled_storage.lock().await; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_last_futures_filled_quantity` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `operation_type` [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | let operation_type = OperationType::Unhedge; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_operation_type` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `leg_found` is never read [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:74:25 [INFO] [stdout] | [INFO] [stdout] 74 | let mut leg_found = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `offset_points` is never read [INFO] [stdout] --> src/config.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 23 | pub struct Config { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 38 | pub offset_points: u32, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Config` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `cancel_order`, `get_order_status`, `get_market_price`, and `get_spot_price_fallback` are never used [INFO] [stdout] --> src/exchange/mod.rs:23:14 [INFO] [stdout] | [INFO] [stdout] 11 | pub trait Exchange: Send + Sync { [INFO] [stdout] | -------- methods in this trait [INFO] [stdout] ... [INFO] [stdout] 23 | async fn cancel_order(&self, symbol: &str, order_id: &str) -> Result<()>; // Deprecated [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] 24 | async fn get_spot_price(&self, symbol: &str) -> Result; [INFO] [stdout] 25 | async fn get_order_status(&self, symbol: &str, order_id: &str) -> Result; // Deprecated [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 36 | async fn get_market_price(&self, symbol: &str, is_spot: bool) -> Result; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] 37 | async fn get_spot_price_fallback(&self, futures_symbol: &str) -> Result; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `create_exchange` is never used [INFO] [stdout] --> src/exchange/mod.rs:45:14 [INFO] [stdout] | [INFO] [stdout] 45 | pub async fn create_exchange( [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ApiResponse` is never constructed [INFO] [stdout] --> src/exchange/bybit.rs:31:8 [INFO] [stdout] | [INFO] [stdout] 31 | struct ApiResponse { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `category` is never read [INFO] [stdout] --> src/exchange/bybit.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 86 | struct RiskLimitResult { [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] 87 | category: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RiskLimitResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `symbol` is never read [INFO] [stdout] --> src/exchange/bybit.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 92 | struct RiskLimitEntry { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] 93 | id: u64, [INFO] [stdout] 94 | symbol: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RiskLimitEntry` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `link_id` is never read [INFO] [stdout] --> src/exchange/bybit.rs:125:5 [INFO] [stdout] | [INFO] [stdout] 121 | struct OrderCreateResult { [INFO] [stdout] | ----------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 125 | link_id: String, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `OrderCreateResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `id` is never read [INFO] [stdout] --> src/exchange/bybit.rs:137:5 [INFO] [stdout] | [INFO] [stdout] 135 | struct OrderQueryEntry { [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] 136 | #[serde(rename = "orderId")] [INFO] [stdout] 137 | id: String, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `OrderQueryEntry` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `category` is never read [INFO] [stdout] --> src/exchange/bybit.rs:186:5 [INFO] [stdout] | [INFO] [stdout] 185 | struct FuturesTickersApiResult { [INFO] [stdout] | ----------------------- field in this struct [INFO] [stdout] 186 | category: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `FuturesTickersApiResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `side`, `qty`, `price`, and `ts` are never read [INFO] [stdout] --> src/exchange/types.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 44 | pub struct Order { [INFO] [stdout] | ----- fields in this struct [INFO] [stdout] 45 | pub id: String, [INFO] [stdout] 46 | pub side: OrderSide, [INFO] [stdout] | ^^^^ [INFO] [stdout] 47 | pub qty: f64, [INFO] [stdout] | ^^^ [INFO] [stdout] 48 | pub price: Option, // None для рыночных [INFO] [stdout] | ^^^^^ [INFO] [stdout] 49 | pub ts: i64, // Timestamp создания [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `Order` 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: fields `max_order_qty`, `max_mkt_order_qty`, and `post_only_max_order_qty` are never read [INFO] [stdout] --> src/exchange/types.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 119 | pub struct LotSizeFilter { [INFO] [stdout] | ------------- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 125 | pub max_order_qty: String, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 129 | pub max_mkt_order_qty: Option, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 133 | pub post_only_max_order_qty: Option, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `LotSizeFilter` 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: variant `PublicTrade` is never constructed [INFO] [stdout] --> src/exchange/types.rs:167:5 [INFO] [stdout] | [INFO] [stdout] 164 | pub enum SubscriptionType { [INFO] [stdout] | ---------------- variant in this enum [INFO] [stdout] ... [INFO] [stdout] 167 | PublicTrade { symbol: String }, // Публичные сделки [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `SubscriptionType` 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: field `ts` is never read [INFO] [stdout] --> src/exchange/bybit_ws/types_internal.rs:23:16 [INFO] [stdout] | [INFO] [stdout] 13 | pub(super) struct BybitWsResponse { // Делаем pub(super), чтобы были видны в protocol.rs [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 23 | pub(super) ts: Option, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `BybitWsResponse` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `max_wait` is never read [INFO] [stdout] --> src/hedger/mod.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 25 | pub struct Hedger { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 28 | max_wait: Duration, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Hedger` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `opposite` is never used [INFO] [stdout] --> src/hedger/common.rs:682:8 [INFO] [stdout] | [INFO] [stdout] 680 | trait SideSign { [INFO] [stdout] | -------- method in this trait [INFO] [stdout] 681 | fn sign(&self) -> f64; [INFO] [stdout] 682 | fn opposite(&self) -> Self; // Added opposite helper [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `symbol` is never read [INFO] [stdout] --> src/notifier/mod.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 50 | AwaitingUnhedgeOperationSelection { [INFO] [stdout] | --------------------------------- field in this variant [INFO] [stdout] 51 | symbol: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `UserState` 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: variant `ViewingAllPairs` is never constructed [INFO] [stdout] --> src/notifier/mod.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 39 | pub enum UserState { [INFO] [stdout] | --------- variant in this enum [INFO] [stdout] ... [INFO] [stdout] 59 | ViewingAllPairs { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `UserState` 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: field `operation_id` is never read [INFO] [stdout] --> src/notifier/mod.rs:76:9 [INFO] [stdout] | [INFO] [stdout] 74 | pub struct RunningOperationInfo { [INFO] [stdout] | -------------------- field in this struct [INFO] [stdout] 75 | pub handle: AbortHandle, [INFO] [stdout] 76 | pub operation_id: i64, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RunningOperationInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Unhedge` is never constructed [INFO] [stdout] --> src/notifier/mod.rs:86:5 [INFO] [stdout] | [INFO] [stdout] 84 | pub enum OperationType { [INFO] [stdout] | ------------- variant in this enum [INFO] [stdout] 85 | Hedge, [INFO] [stdout] 86 | Unhedge, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `OperationType` 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: function `handle_menu_wallet_callback` is never used [INFO] [stdout] --> src/notifier/navigation.rs:146:14 [INFO] [stdout] | [INFO] [stdout] 146 | pub async fn handle_menu_wallet_callback( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `handle_menu_info_callback` is never used [INFO] [stdout] --> src/notifier/navigation.rs:154:14 [INFO] [stdout] | [INFO] [stdout] 154 | pub async fn handle_menu_info_callback( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `handle_menu_active_ops_callback` is never used [INFO] [stdout] --> src/notifier/navigation.rs:163:14 [INFO] [stdout] | [INFO] [stdout] 163 | pub async fn handle_menu_active_ops_callback( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `MENU_MANAGE` is never used [INFO] [stdout] --> src/notifier/mod.rs:272:15 [INFO] [stdout] | [INFO] [stdout] 272 | pub const MENU_MANAGE: &str = "menu_manage"; // Если будет подменю [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `UnhedgeRequest` is never constructed [INFO] [stdout] --> src/models.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | pub struct UnhedgeRequest { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ExecutionReport` is never constructed [INFO] [stdout] --> src/models.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 23 | pub struct ExecutionReport { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `round_step` is never used [INFO] [stdout] --> src/utils.rs:4:8 [INFO] [stdout] | [INFO] [stdout] 4 | pub fn round_step(value: f64, step: f64) -> f64 { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `trading_symbol` is never used [INFO] [stdout] --> src/utils.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | pub fn trading_symbol(base: &str, quote: &str) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_running_hedge_operations` is never used [INFO] [stdout] --> src/storage/db.rs:141:14 [INFO] [stdout] | [INFO] [stdout] 141 | pub async fn get_running_hedge_operations(db: &Db) -> Result, SqlxError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple fields are never read [INFO] [stdout] --> src/storage/schema.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 83 | pub struct HedgeOperation { [INFO] [stdout] | -------------- fields in this struct [INFO] [stdout] 84 | pub id: i64, // Используем i64 для AUTOINCREMENT [INFO] [stdout] 85 | pub chat_id: i64, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 86 | pub base_symbol: String, [INFO] [stdout] 87 | pub quote_currency: String, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] 88 | pub initial_sum: f64, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] 89 | pub volatility: f64, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 90 | pub target_spot_qty: f64, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 96 | pub futures_order_id: Option, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] 97 | pub futures_filled_qty: f64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 98 | pub end_timestamp: Option, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 99 | pub error_message: Option, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `HedgeOperation` 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: field `progress_callback` is never read [INFO] [stdout] --> src/webservice_hedge/hedge_task.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 32 | pub struct HedgerWsHedgeTask { [INFO] [stdout] | ----------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 39 | pub progress_callback: HedgeProgressCallback, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `symbol`, `side`, and `target_quantity` are never read [INFO] [stdout] --> src/webservice_hedge/state.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 7 | pub struct ChunkOrderState { [INFO] [stdout] | --------------- fields in this struct [INFO] [stdout] 8 | pub order_id: String, [INFO] [stdout] 9 | pub symbol: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 10 | pub side: OrderSide, [INFO] [stdout] | ^^^^ [INFO] [stdout] 11 | pub limit_price: Decimal, // <-- ДОБАВЛЕНО: Цена, по которой ордер был выставлен [INFO] [stdout] 12 | pub target_quantity: Decimal, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ChunkOrderState` 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: variants `ConnectingWebSocket`, `Cancelling`, and `Cancelled` are never constructed [INFO] [stdout] --> src/webservice_hedge/state.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 62 | pub enum HedgerWsStatus { [INFO] [stdout] | -------------- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 65 | ConnectingWebSocket, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 90 | Cancelling, // Отмена пользователем всей операции [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 91 | Cancelled, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `HedgerWsStatus` 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: field `operation_id` is never read [INFO] [stdout] --> src/webservice_hedge/state.rs:109:9 [INFO] [stdout] | [INFO] [stdout] 108 | pub struct HedgerWsState { [INFO] [stdout] | ------------- field in this struct [INFO] [stdout] 109 | pub operation_id: i64, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `HedgerWsState` 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: variant `Unhedge` is never constructed [INFO] [stdout] --> src/webservice_hedge/state.rs:150:5 [INFO] [stdout] | [INFO] [stdout] 148 | pub enum OperationType { [INFO] [stdout] | ------------- variant in this enum [INFO] [stdout] 149 | Hedge, [INFO] [stdout] 150 | Unhedge, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `OperationType` 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 `new_unhedge` is never used [INFO] [stdout] --> src/webservice_hedge/state.rs:196:14 [INFO] [stdout] | [INFO] [stdout] 155 | impl HedgerWsState { [INFO] [stdout] | ------------------ associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 196 | pub fn new_unhedge( [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `HedgerWsUnhedgeTask` is never constructed [INFO] [stdout] --> src/webservice_hedge/unhedge_task.rs:21:12 [INFO] [stdout] | [INFO] [stdout] 21 | pub struct HedgerWsUnhedgeTask { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new` and `run` are never used [INFO] [stdout] --> src/webservice_hedge/unhedge_task.rs:35:18 [INFO] [stdout] | [INFO] [stdout] 34 | impl HedgerWsUnhedgeTask { [INFO] [stdout] | ------------------------ associated items in this implementation [INFO] [stdout] 35 | pub async fn new( [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 49 | pub async fn run(&mut self) -> Result<()> { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `start_next_chunk` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:15:21 [INFO] [stdout] | [INFO] [stdout] 15 | pub(crate) async fn start_next_chunk(task: &mut HedgerWsUnhedgeTask) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `calculate_limit_price_for_leg` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:17:8 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn calculate_limit_price_for_leg(task: &HedgerWsUnhedgeTask, leg: Leg) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `round_down_step` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:40:8 [INFO] [stdout] | [INFO] [stdout] 40 | pub fn round_down_step(task: &HedgerWsUnhedgeTask, value: Decimal, step: Decimal) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_current_price` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:56:8 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn get_current_price(task: &HedgerWsUnhedgeTask, leg: Leg) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `check_chunk_completion` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:71:8 [INFO] [stdout] | [INFO] [stdout] 71 | pub fn check_chunk_completion(task: &HedgerWsUnhedgeTask) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `send_progress_update` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:77:14 [INFO] [stdout] | [INFO] [stdout] 77 | pub async fn send_progress_update(task: &mut HedgerWsUnhedgeTask) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `update_final_db_status` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:85:14 [INFO] [stdout] | [INFO] [stdout] 85 | pub async fn update_final_db_status(task: &HedgerWsUnhedgeTask) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_decimals_from_step` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:109:8 [INFO] [stdout] | [INFO] [stdout] 109 | pub fn get_decimals_from_step(step: Option<&str>) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_step_decimal` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:115:8 [INFO] [stdout] | [INFO] [stdout] 115 | pub fn get_step_decimal(step: Option<&str>) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `check_value_imbalance` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:122:8 [INFO] [stdout] | [INFO] [stdout] 122 | pub fn check_value_imbalance(task: &HedgerWsUnhedgeTask) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `initialize_task` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/init.rs:22:21 [INFO] [stdout] | [INFO] [stdout] 22 | pub(crate) async fn initialize_task( [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `reconcile` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/reconciliation.rs:18:14 [INFO] [stdout] | [INFO] [stdout] 18 | pub async fn reconcile(task: &mut HedgerWsUnhedgeTask) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `handle_websocket_message` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:17:14 [INFO] [stdout] | [INFO] [stdout] 17 | pub async fn handle_websocket_message(task: &mut HedgerWsUnhedgeTask, message: WebSocketMessage) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `handle_order_update` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:68:10 [INFO] [stdout] | [INFO] [stdout] 68 | async fn handle_order_update(task: &mut HedgerWsUnhedgeTask, details: DetailedOrderStatus) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `handle_order_book_update` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:160:10 [INFO] [stdout] | [INFO] [stdout] 160 | async fn handle_order_book_update(task: &mut HedgerWsUnhedgeTask, symbol: String, bids: Vec, asks: Vec src/webservice_hedge/unhedge_logic/ws_handlers.rs:173:10 [INFO] [stdout] | [INFO] [stdout] 173 | async fn handle_public_trade_update(task: &mut HedgerWsUnhedgeTask, symbol: String, price: f64, qty: f64, side: OrderSide, timestam... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `qc` [INFO] [stdout] --> src/notifier/unhedge_flow.rs:139:13 [INFO] [stdout] | [INFO] [stdout] 139 | let qc = cfg_for_callback.quote_currency.clone(); // Используем клон cfg [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_qc` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `operation_info_opt` is never read [INFO] [stdout] --> src/notifier/active_ops.rs:157:76 [INFO] [stdout] | [INFO] [stdout] 157 | let mut operation_info_opt: Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `filled_spot_qty_in_operation` is never read [INFO] [stdout] --> src/notifier/active_ops.rs:158:61 [INFO] [stdout] | [INFO] [stdout] 158 | let mut filled_spot_qty_in_operation: f64 = 0.0; [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchange/bybit.rs:243:20 [INFO] [stdout] | [INFO] [stdout] 243 | balance_cache: Arc, SystemTime)>>>, [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: value assigned to `leg_found` is never read [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:68:25 [INFO] [stdout] | [INFO] [stdout] 68 | let mut leg_found = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `final_spot_qty` [INFO] [stdout] --> src/webservice_hedge/hedge_logic/reconciliation.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | let final_spot_qty = task.state.cumulative_spot_filled_quantity; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_final_spot_qty` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchange/bybit.rs:520:54 [INFO] [stdout] | [INFO] [stdout] 520 | if result_val.is_object() && result_val.as_object().map_or(false, |obj| obj.is_empty()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 520 - if result_val.is_object() && result_val.as_object().map_or(false, |obj| obj.is_empty()) { [INFO] [stdout] 520 + if result_val.is_object() && result_val.as_object().is_some_and(|obj| obj.is_empty()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `operation_type` [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | let operation_type = OperationType::Unhedge; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_operation_type` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `leg_found` is never read [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:74:25 [INFO] [stdout] | [INFO] [stdout] 74 | let mut leg_found = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `offset_points` is never read [INFO] [stdout] --> src/config.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 23 | pub struct Config { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 38 | pub offset_points: u32, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Config` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `cancel_order`, `get_order_status`, `get_market_price`, and `get_spot_price_fallback` are never used [INFO] [stdout] --> src/exchange/mod.rs:23:14 [INFO] [stdout] | [INFO] [stdout] 11 | pub trait Exchange: Send + Sync { [INFO] [stdout] | -------- methods in this trait [INFO] [stdout] ... [INFO] [stdout] 23 | async fn cancel_order(&self, symbol: &str, order_id: &str) -> Result<()>; // Deprecated [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] 24 | async fn get_spot_price(&self, symbol: &str) -> Result; [INFO] [stdout] 25 | async fn get_order_status(&self, symbol: &str, order_id: &str) -> Result; // Deprecated [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 36 | async fn get_market_price(&self, symbol: &str, is_spot: bool) -> Result; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] 37 | async fn get_spot_price_fallback(&self, futures_symbol: &str) -> Result; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `create_exchange` is never used [INFO] [stdout] --> src/exchange/mod.rs:45:14 [INFO] [stdout] | [INFO] [stdout] 45 | pub async fn create_exchange( [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ApiResponse` is never constructed [INFO] [stdout] --> src/exchange/bybit.rs:31:8 [INFO] [stdout] | [INFO] [stdout] 31 | struct ApiResponse { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `category` is never read [INFO] [stdout] --> src/exchange/bybit.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 86 | struct RiskLimitResult { [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] 87 | category: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RiskLimitResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `symbol` is never read [INFO] [stdout] --> src/exchange/bybit.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 92 | struct RiskLimitEntry { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] 93 | id: u64, [INFO] [stdout] 94 | symbol: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RiskLimitEntry` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `link_id` is never read [INFO] [stdout] --> src/exchange/bybit.rs:125:5 [INFO] [stdout] | [INFO] [stdout] 121 | struct OrderCreateResult { [INFO] [stdout] | ----------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 125 | link_id: String, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `OrderCreateResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `id` is never read [INFO] [stdout] --> src/exchange/bybit.rs:137:5 [INFO] [stdout] | [INFO] [stdout] 135 | struct OrderQueryEntry { [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] 136 | #[serde(rename = "orderId")] [INFO] [stdout] 137 | id: String, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `OrderQueryEntry` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `category` is never read [INFO] [stdout] --> src/exchange/bybit.rs:186:5 [INFO] [stdout] | [INFO] [stdout] 185 | struct FuturesTickersApiResult { [INFO] [stdout] | ----------------------- field in this struct [INFO] [stdout] 186 | category: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `FuturesTickersApiResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `side`, `qty`, `price`, and `ts` are never read [INFO] [stdout] --> src/exchange/types.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 44 | pub struct Order { [INFO] [stdout] | ----- fields in this struct [INFO] [stdout] 45 | pub id: String, [INFO] [stdout] 46 | pub side: OrderSide, [INFO] [stdout] | ^^^^ [INFO] [stdout] 47 | pub qty: f64, [INFO] [stdout] | ^^^ [INFO] [stdout] 48 | pub price: Option, // None для рыночных [INFO] [stdout] | ^^^^^ [INFO] [stdout] 49 | pub ts: i64, // Timestamp создания [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `Order` 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: fields `max_order_qty`, `max_mkt_order_qty`, and `post_only_max_order_qty` are never read [INFO] [stdout] --> src/exchange/types.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 119 | pub struct LotSizeFilter { [INFO] [stdout] | ------------- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 125 | pub max_order_qty: String, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 129 | pub max_mkt_order_qty: Option, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 133 | pub post_only_max_order_qty: Option, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `LotSizeFilter` 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: variant `PublicTrade` is never constructed [INFO] [stdout] --> src/exchange/types.rs:167:5 [INFO] [stdout] | [INFO] [stdout] 164 | pub enum SubscriptionType { [INFO] [stdout] | ---------------- variant in this enum [INFO] [stdout] ... [INFO] [stdout] 167 | PublicTrade { symbol: String }, // Публичные сделки [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `SubscriptionType` 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: field `ts` is never read [INFO] [stdout] --> src/exchange/bybit_ws/types_internal.rs:23:16 [INFO] [stdout] | [INFO] [stdout] 13 | pub(super) struct BybitWsResponse { // Делаем pub(super), чтобы были видны в protocol.rs [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 23 | pub(super) ts: Option, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `BybitWsResponse` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `max_wait` is never read [INFO] [stdout] --> src/hedger/mod.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 25 | pub struct Hedger { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 28 | max_wait: Duration, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Hedger` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `opposite` is never used [INFO] [stdout] --> src/hedger/common.rs:682:8 [INFO] [stdout] | [INFO] [stdout] 680 | trait SideSign { [INFO] [stdout] | -------- method in this trait [INFO] [stdout] 681 | fn sign(&self) -> f64; [INFO] [stdout] 682 | fn opposite(&self) -> Self; // Added opposite helper [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `symbol` is never read [INFO] [stdout] --> src/notifier/mod.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 50 | AwaitingUnhedgeOperationSelection { [INFO] [stdout] | --------------------------------- field in this variant [INFO] [stdout] 51 | symbol: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `UserState` 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: variant `ViewingAllPairs` is never constructed [INFO] [stdout] --> src/notifier/mod.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 39 | pub enum UserState { [INFO] [stdout] | --------- variant in this enum [INFO] [stdout] ... [INFO] [stdout] 59 | ViewingAllPairs { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `UserState` 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: field `operation_id` is never read [INFO] [stdout] --> src/notifier/mod.rs:76:9 [INFO] [stdout] | [INFO] [stdout] 74 | pub struct RunningOperationInfo { [INFO] [stdout] | -------------------- field in this struct [INFO] [stdout] 75 | pub handle: AbortHandle, [INFO] [stdout] 76 | pub operation_id: i64, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RunningOperationInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Unhedge` is never constructed [INFO] [stdout] --> src/notifier/mod.rs:86:5 [INFO] [stdout] | [INFO] [stdout] 84 | pub enum OperationType { [INFO] [stdout] | ------------- variant in this enum [INFO] [stdout] 85 | Hedge, [INFO] [stdout] 86 | Unhedge, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `OperationType` 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: function `handle_menu_wallet_callback` is never used [INFO] [stdout] --> src/notifier/navigation.rs:146:14 [INFO] [stdout] | [INFO] [stdout] 146 | pub async fn handle_menu_wallet_callback( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `handle_menu_info_callback` is never used [INFO] [stdout] --> src/notifier/navigation.rs:154:14 [INFO] [stdout] | [INFO] [stdout] 154 | pub async fn handle_menu_info_callback( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `handle_menu_active_ops_callback` is never used [INFO] [stdout] --> src/notifier/navigation.rs:163:14 [INFO] [stdout] | [INFO] [stdout] 163 | pub async fn handle_menu_active_ops_callback( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `MENU_MANAGE` is never used [INFO] [stdout] --> src/notifier/mod.rs:272:15 [INFO] [stdout] | [INFO] [stdout] 272 | pub const MENU_MANAGE: &str = "menu_manage"; // Если будет подменю [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `UnhedgeRequest` is never constructed [INFO] [stdout] --> src/models.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | pub struct UnhedgeRequest { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ExecutionReport` is never constructed [INFO] [stdout] --> src/models.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 23 | pub struct ExecutionReport { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `round_step` is never used [INFO] [stdout] --> src/utils.rs:4:8 [INFO] [stdout] | [INFO] [stdout] 4 | pub fn round_step(value: f64, step: f64) -> f64 { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `trading_symbol` is never used [INFO] [stdout] --> src/utils.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | pub fn trading_symbol(base: &str, quote: &str) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_running_hedge_operations` is never used [INFO] [stdout] --> src/storage/db.rs:141:14 [INFO] [stdout] | [INFO] [stdout] 141 | pub async fn get_running_hedge_operations(db: &Db) -> Result, SqlxError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple fields are never read [INFO] [stdout] --> src/storage/schema.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 83 | pub struct HedgeOperation { [INFO] [stdout] | -------------- fields in this struct [INFO] [stdout] 84 | pub id: i64, // Используем i64 для AUTOINCREMENT [INFO] [stdout] 85 | pub chat_id: i64, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 86 | pub base_symbol: String, [INFO] [stdout] 87 | pub quote_currency: String, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] 88 | pub initial_sum: f64, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] 89 | pub volatility: f64, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 90 | pub target_spot_qty: f64, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 96 | pub futures_order_id: Option, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] 97 | pub futures_filled_qty: f64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 98 | pub end_timestamp: Option, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 99 | pub error_message: Option, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `HedgeOperation` 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: field `progress_callback` is never read [INFO] [stdout] --> src/webservice_hedge/hedge_task.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 32 | pub struct HedgerWsHedgeTask { [INFO] [stdout] | ----------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 39 | pub progress_callback: HedgeProgressCallback, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `symbol`, `side`, and `target_quantity` are never read [INFO] [stdout] --> src/webservice_hedge/state.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 7 | pub struct ChunkOrderState { [INFO] [stdout] | --------------- fields in this struct [INFO] [stdout] 8 | pub order_id: String, [INFO] [stdout] 9 | pub symbol: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 10 | pub side: OrderSide, [INFO] [stdout] | ^^^^ [INFO] [stdout] 11 | pub limit_price: Decimal, // <-- ДОБАВЛЕНО: Цена, по которой ордер был выставлен [INFO] [stdout] 12 | pub target_quantity: Decimal, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ChunkOrderState` 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: variants `ConnectingWebSocket`, `Cancelling`, and `Cancelled` are never constructed [INFO] [stdout] --> src/webservice_hedge/state.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 62 | pub enum HedgerWsStatus { [INFO] [stdout] | -------------- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 65 | ConnectingWebSocket, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 90 | Cancelling, // Отмена пользователем всей операции [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 91 | Cancelled, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `HedgerWsStatus` 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: field `operation_id` is never read [INFO] [stdout] --> src/webservice_hedge/state.rs:109:9 [INFO] [stdout] | [INFO] [stdout] 108 | pub struct HedgerWsState { [INFO] [stdout] | ------------- field in this struct [INFO] [stdout] 109 | pub operation_id: i64, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `HedgerWsState` 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: variant `Unhedge` is never constructed [INFO] [stdout] --> src/webservice_hedge/state.rs:150:5 [INFO] [stdout] | [INFO] [stdout] 148 | pub enum OperationType { [INFO] [stdout] | ------------- variant in this enum [INFO] [stdout] 149 | Hedge, [INFO] [stdout] 150 | Unhedge, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `OperationType` 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 `new_unhedge` is never used [INFO] [stdout] --> src/webservice_hedge/state.rs:196:14 [INFO] [stdout] | [INFO] [stdout] 155 | impl HedgerWsState { [INFO] [stdout] | ------------------ associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 196 | pub fn new_unhedge( [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `HedgerWsUnhedgeTask` is never constructed [INFO] [stdout] --> src/webservice_hedge/unhedge_task.rs:21:12 [INFO] [stdout] | [INFO] [stdout] 21 | pub struct HedgerWsUnhedgeTask { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new` and `run` are never used [INFO] [stdout] --> src/webservice_hedge/unhedge_task.rs:35:18 [INFO] [stdout] | [INFO] [stdout] 34 | impl HedgerWsUnhedgeTask { [INFO] [stdout] | ------------------------ associated items in this implementation [INFO] [stdout] 35 | pub async fn new( [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 49 | pub async fn run(&mut self) -> Result<()> { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `start_next_chunk` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:15:21 [INFO] [stdout] | [INFO] [stdout] 15 | pub(crate) async fn start_next_chunk(task: &mut HedgerWsUnhedgeTask) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `calculate_limit_price_for_leg` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:17:8 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn calculate_limit_price_for_leg(task: &HedgerWsUnhedgeTask, leg: Leg) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `round_down_step` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:40:8 [INFO] [stdout] | [INFO] [stdout] 40 | pub fn round_down_step(task: &HedgerWsUnhedgeTask, value: Decimal, step: Decimal) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_current_price` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:56:8 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn get_current_price(task: &HedgerWsUnhedgeTask, leg: Leg) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `check_chunk_completion` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:71:8 [INFO] [stdout] | [INFO] [stdout] 71 | pub fn check_chunk_completion(task: &HedgerWsUnhedgeTask) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `send_progress_update` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:77:14 [INFO] [stdout] | [INFO] [stdout] 77 | pub async fn send_progress_update(task: &mut HedgerWsUnhedgeTask) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `update_final_db_status` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:85:14 [INFO] [stdout] | [INFO] [stdout] 85 | pub async fn update_final_db_status(task: &HedgerWsUnhedgeTask) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_decimals_from_step` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:109:8 [INFO] [stdout] | [INFO] [stdout] 109 | pub fn get_decimals_from_step(step: Option<&str>) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_step_decimal` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:115:8 [INFO] [stdout] | [INFO] [stdout] 115 | pub fn get_step_decimal(step: Option<&str>) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `check_value_imbalance` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/helpers.rs:122:8 [INFO] [stdout] | [INFO] [stdout] 122 | pub fn check_value_imbalance(task: &HedgerWsUnhedgeTask) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `initialize_task` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/init.rs:22:21 [INFO] [stdout] | [INFO] [stdout] 22 | pub(crate) async fn initialize_task( [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `reconcile` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/reconciliation.rs:18:14 [INFO] [stdout] | [INFO] [stdout] 18 | pub async fn reconcile(task: &mut HedgerWsUnhedgeTask) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `handle_websocket_message` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:17:14 [INFO] [stdout] | [INFO] [stdout] 17 | pub async fn handle_websocket_message(task: &mut HedgerWsUnhedgeTask, message: WebSocketMessage) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `handle_order_update` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:68:10 [INFO] [stdout] | [INFO] [stdout] 68 | async fn handle_order_update(task: &mut HedgerWsUnhedgeTask, details: DetailedOrderStatus) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `handle_order_book_update` is never used [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:160:10 [INFO] [stdout] | [INFO] [stdout] 160 | async fn handle_order_book_update(task: &mut HedgerWsUnhedgeTask, symbol: String, bids: Vec, asks: Vec src/webservice_hedge/unhedge_logic/ws_handlers.rs:173:10 [INFO] [stdout] | [INFO] [stdout] 173 | async fn handle_public_trade_update(task: &mut HedgerWsUnhedgeTask, symbol: String, price: f64, qty: f64, side: OrderSide, timestam... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchange/bybit_ws/types_internal.rs:109:58 [INFO] [stdout] | [INFO] [stdout] 109 | pub(super) fn parse_public_trade_update(data: Value) -> Result, anyhow::Error> { // Воз... [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: called `unwrap` on `min_order_qty_decimal` after checking its variant with `is_some` [INFO] [stdout] --> src/hedger/common.rs:364:48 [INFO] [stdout] | [INFO] [stdout] 361 | if is_spot && side == OrderSide::Sell && min_order_qty_decimal.is_some() { [INFO] [stdout] | ------------------------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 364 | && remaining_total_qty_d < min_order_qty_decimal.unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `min_order_qty_decimal` after checking its variant with `is_some` [INFO] [stdout] --> src/hedger/common.rs:368:83 [INFO] [stdout] | [INFO] [stdout] 361 | if is_spot && side == OrderSide::Sell && min_order_qty_decimal.is_some() { [INFO] [stdout] | ------------------------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 368 | operation_id, remaining_total_qty, remaining_total_qty_d, min_order_qty_decimal.unwrap(), stage [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | / if is_spot { [INFO] [stdout] 118 | | if let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 119 | | error!("op_id:{}: Failed update initial spot order info in DB: {}", operation_id, e); [INFO] [stdout] 120 | | } [INFO] [stdout] 121 | | } [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] 117 ~ if is_spot [INFO] [stdout] 118 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 119 | error!("op_id:{}: Failed update initial spot order info in DB: {}", operation_id, e); [INFO] [stdout] 120 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:196:26 [INFO] [stdout] | [INFO] [stdout] 196 | / ... if is_spot { [INFO] [stdout] 197 | | ... if let Err(db_err) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 198 | | ... error!("op_id:{}: Failed update DB after {} order not found: {}", operation_id, if is_spot { "spot" } else { "futur... [INFO] [stdout] 199 | | ... } [INFO] [stdout] 200 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 196 ~ if is_spot [INFO] [stdout] 197 ~ && let Err(db_err) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 198 | error!("op_id:{}: Failed update DB after {} order not found: {}", operation_id, if is_spot { "spot" } else { "futures" }, db_err); [INFO] [stdout] 199 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:251:17 [INFO] [stdout] | [INFO] [stdout] 251 | / if is_spot { [INFO] [stdout] 252 | | if let Err(e) = update_hedge_spot_order( [INFO] [stdout] 253 | | db, [INFO] [stdout] 254 | | operation_id, [INFO] [stdout] ... | [INFO] [stdout] 265 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 251 ~ if is_spot [INFO] [stdout] 252 ~ && let Err(e) = update_hedge_spot_order( [INFO] [stdout] 253 | db, [INFO] [stdout] ... [INFO] [stdout] 263 | ); [INFO] [stdout] 264 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:388:37 [INFO] [stdout] | [INFO] [stdout] 388 | / ... if is_spot { [INFO] [stdout] 389 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 390 | | ... error!("op_id:{}: Failed update DB after dust cancel fill: {}", operation_id, e); [INFO] [stdout] 391 | | ... } [INFO] [stdout] 392 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 388 ~ if is_spot [INFO] [stdout] 389 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 390 | error!("op_id:{}: Failed update DB after dust cancel fill: {}", operation_id, e); [INFO] [stdout] 391 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:437:33 [INFO] [stdout] | [INFO] [stdout] 437 | / ... if is_spot { [INFO] [stdout] 438 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 439 | | ... error!("op_id:{}: Failed update DB after cancel fill: {}", operation_id, e); [INFO] [stdout] 440 | | ... } [INFO] [stdout] 441 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 437 ~ if is_spot [INFO] [stdout] 438 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 439 | error!("op_id:{}: Failed update DB after cancel fill: {}", operation_id, e); [INFO] [stdout] 440 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:459:33 [INFO] [stdout] | [INFO] [stdout] 459 | / ... if is_spot { [INFO] [stdout] 460 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 461 | | ... error!("op_id:{}: Failed update DB after final cancel correction: {}", operation_id, e); [INFO] [stdout] 462 | | ... } [INFO] [stdout] 463 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 459 ~ if is_spot [INFO] [stdout] 460 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 461 | error!("op_id:{}: Failed update DB after final cancel correction: {}", operation_id, e); [INFO] [stdout] 462 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:530:13 [INFO] [stdout] | [INFO] [stdout] 530 | / ... if is_spot { [INFO] [stdout] 531 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 532 | | ... error!("op_id:{}: Failed update DB after replacement order placement: {}", operation_id, e); [INFO] [stdout] 533 | | ... } [INFO] [stdout] 534 | | ... } [INFO] [stdout] | |________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 530 ~ if is_spot [INFO] [stdout] 531 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 532 | error!("op_id:{}: Failed update DB after replacement order placement: {}", operation_id, e); [INFO] [stdout] 533 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:556:13 [INFO] [stdout] | [INFO] [stdout] 556 | / if let Err(e) = progress_callback(update).await { [INFO] [stdout] 557 | | if !e.to_string().contains("message is not modified") { [INFO] [stdout] 558 | | warn!("op_id:{}: Progress callback failed (Stage: {:?}): {}", operation_id, stage, e); [INFO] [stdout] 559 | | } [INFO] [stdout] 560 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 556 ~ if let Err(e) = progress_callback(update).await [INFO] [stdout] 557 ~ && !e.to_string().contains("message is not modified") { [INFO] [stdout] 558 | warn!("op_id:{}: Progress callback failed (Stage: {:?}): {}", operation_id, stage, e); [INFO] [stdout] 559 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchange/bybit.rs:243:20 [INFO] [stdout] | [INFO] [stdout] 243 | balance_cache: Arc, SystemTime)>>>, [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 `if` statement can be collapsed [INFO] [stdout] --> src/hedger/hedge.rs:273:5 [INFO] [stdout] | [INFO] [stdout] 273 | / if let Err(error) = progress_callback(spot_done_update).await { [INFO] [stdout] 274 | | if !error.to_string().contains("message is not modified") { [INFO] [stdout] 275 | | warn!( [INFO] [stdout] 276 | | "op_id:{}: Progress callback failed after spot fill: {}", [INFO] [stdout] ... | [INFO] [stdout] 280 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 273 ~ if let Err(error) = progress_callback(spot_done_update).await [INFO] [stdout] 274 ~ && !error.to_string().contains("message is not modified") { [INFO] [stdout] 275 | warn!( [INFO] [stdout] ... [INFO] [stdout] 278 | ); [INFO] [stdout] 279 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/hedge.rs:436:5 [INFO] [stdout] | [INFO] [stdout] 436 | / if let Err(error) = progress_callback(futures_done_update).await { [INFO] [stdout] 437 | | if !error.to_string().contains("message is not modified") { [INFO] [stdout] 438 | | warn!("op_id:{}: Futures progress callback failed: {}", operation_identifier, error); [INFO] [stdout] 439 | | } [INFO] [stdout] 440 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 436 ~ if let Err(error) = progress_callback(futures_done_update).await [INFO] [stdout] 437 ~ && !error.to_string().contains("message is not modified") { [INFO] [stdout] 438 | warn!("op_id:{}: Futures progress callback failed: {}", operation_identifier, error); [INFO] [stdout] 439 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchange/bybit.rs:520:54 [INFO] [stdout] | [INFO] [stdout] 520 | if result_val.is_object() && result_val.as_object().map_or(false, |obj| obj.is_empty()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 520 - if result_val.is_object() && result_val.as_object().map_or(false, |obj| obj.is_empty()) { [INFO] [stdout] 520 + if result_val.is_object() && result_val.as_object().is_some_and(|obj| obj.is_empty()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/hedger/unhedge.rs:114:9 [INFO] [stdout] | [INFO] [stdout] 114 | Decimal::try_from(actual_spot_sell_qty).unwrap_or_else(|_| Decimal::ZERO); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 114 - Decimal::try_from(actual_spot_sell_qty).unwrap_or_else(|_| Decimal::ZERO); [INFO] [stdout] 114 + Decimal::try_from(actual_spot_sell_qty).unwrap_or(Decimal::ZERO); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/unhedge.rs:213:5 [INFO] [stdout] | [INFO] [stdout] 213 | / if let Err(e) = progress_callback(spot_done_update).await { [INFO] [stdout] 214 | | if !e.to_string().contains("message is not modified") { [INFO] [stdout] 215 | | warn!( [INFO] [stdout] 216 | | "op_id:{}: Unhedge progress callback failed after spot sell: {}", [INFO] [stdout] ... | [INFO] [stdout] 220 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 213 ~ if let Err(e) = progress_callback(spot_done_update).await [INFO] [stdout] 214 ~ && !e.to_string().contains("message is not modified") { [INFO] [stdout] 215 | warn!( [INFO] [stdout] ... [INFO] [stdout] 218 | ); [INFO] [stdout] 219 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/wallet_info.rs:58:13 [INFO] [stdout] | [INFO] [stdout] 58 | / if include_approx_value && coin != quote_currency { [INFO] [stdout] 59 | | if let Some(price) = prices.get(&coin) { [INFO] [stdout] 60 | | let total_qty = balance.free + balance.locked; [INFO] [stdout] 61 | | if total_qty > ORDER_FILL_TOLERANCE && *price > 0.0 { [INFO] [stdout] ... | [INFO] [stdout] 66 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 58 ~ if include_approx_value && coin != quote_currency [INFO] [stdout] 59 ~ && let Some(price) = prices.get(&coin) { [INFO] [stdout] 60 | let total_qty = balance.free + balance.locked; [INFO] [stdout] ... [INFO] [stdout] 64 | } [INFO] [stdout] 65 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/hedge_flow.rs:27:1 [INFO] [stdout] | [INFO] [stdout] 27 | / pub async fn handle_hedge_command( [INFO] [stdout] 28 | | bot: Bot, msg: Message, symbol_arg: String, exchange: Arc, state_storage: StateStorage, [INFO] [stdout] 29 | | running_operations: RunningOperations, cfg: Arc, db: Arc [INFO] [stdout] 30 | | ) -> anyhow::Result<()> [INFO] [stdout] 31 | | where E: Exchange + Clone + Send + Sync + 'static { [INFO] [stdout] | |_________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/unhedge_flow.rs:104:1 [INFO] [stdout] | [INFO] [stdout] 104 | / async fn spawn_unhedge_task( [INFO] [stdout] 105 | | bot: Bot, [INFO] [stdout] 106 | | exchange: Arc, [INFO] [stdout] 107 | | cfg: Arc, [INFO] [stdout] ... | [INFO] [stdout] 114 | | where [INFO] [stdout] 115 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/unhedge_flow.rs:371:1 [INFO] [stdout] | [INFO] [stdout] 371 | / pub async fn handle_unhedge_command( [INFO] [stdout] 372 | | bot: Bot, [INFO] [stdout] 373 | | msg: Message, [INFO] [stdout] 374 | | symbol_arg: String, [INFO] [stdout] ... | [INFO] [stdout] 381 | | where [INFO] [stdout] 382 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/unhedge_flow.rs:404:5 [INFO] [stdout] | [INFO] [stdout] 404 | / if let Some(bot_msg_id) = previous_bot_message_id { [INFO] [stdout] 405 | | if let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { warn!("Failed delete prev bot msg: {}", e); } [INFO] [stdout] 406 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 404 ~ if let Some(bot_msg_id) = previous_bot_message_id [INFO] [stdout] 405 ~ && let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { warn!("Failed delete prev bot msg: {}", e); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be written as a `let` statement [INFO] [stdout] --> src/notifier/active_ops.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | / let filled_qty = match info.total_filled_spot_qty.lock().await { [INFO] [stdout] 53 | | guard => *guard, [INFO] [stdout] ... | [INFO] [stdout] 59 | | }; [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 52 ~ let guard = info.total_filled_spot_qty.lock().await; [INFO] [stdout] 53 + let filled_qty = *guard; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assignment could be simplified [INFO] [stdout] --> src/notifier/active_ops.rs:165:25 [INFO] [stdout] | [INFO] [stdout] 165 | / filled_spot_qty_in_operation = match info.total_filled_spot_qty.lock().await { [INFO] [stdout] 166 | | guard => *guard, [INFO] [stdout] ... | [INFO] [stdout] 171 | | }; [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] help: consider removing the `match` expression [INFO] [stdout] | [INFO] [stdout] 165 ~ let guard = info.total_filled_spot_qty.lock().await; [INFO] [stdout] 166 ~ filled_spot_qty_in_operation = *guard; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/active_ops.rs:384:38 [INFO] [stdout] | [INFO] [stdout] 384 | ... } else if filled_spot_qty_in_operation > ORDER_FILL_TOLERANCE { [INFO] [stdout] | ______________^ [INFO] [stdout] 385 | | ... if final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") |... [INFO] [stdout] 386 | | ... final_text.push_str("\nПопытка продать накопленный спот не удалась."); [INFO] [stdout] 387 | | ... } [INFO] [stdout] 388 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 384 ~ } else if filled_spot_qty_in_operation > ORDER_FILL_TOLERANCE [INFO] [stdout] 385 ~ && final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] 386 | final_text.push_str("\nПопытка продать накопленный спот не удалась."); [INFO] [stdout] 387 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/notifier/active_ops.rs:385:39 [INFO] [stdout] | [INFO] [stdout] 385 | ...if final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 385 - if final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] 385 + if final_error_message.as_ref().is_some_and(|s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | / pub async fn handle_hedge_command( [INFO] [stdout] 22 | | bot: Bot, [INFO] [stdout] 23 | | msg: Message, [INFO] [stdout] 24 | | symbol_arg: String, [INFO] [stdout] ... | [INFO] [stdout] 31 | | where [INFO] [stdout] 32 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | / if let Some(bot_msg_id) = previous_bot_message_id { [INFO] [stdout] 60 | | if let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { [INFO] [stdout] 61 | | warn!("Failed delete prev bot msg {}: {}", bot_msg_id, e); [INFO] [stdout] 62 | | } [INFO] [stdout] 63 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 59 ~ if let Some(bot_msg_id) = previous_bot_message_id [INFO] [stdout] 60 ~ && let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { [INFO] [stdout] 61 | warn!("Failed delete prev bot msg {}: {}", bot_msg_id, e); [INFO] [stdout] 62 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchange/bybit_ws/types_internal.rs:109:58 [INFO] [stdout] | [INFO] [stdout] 109 | pub(super) fn parse_public_trade_update(data: Value) -> Result, anyhow::Error> { // Воз... [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: called `unwrap` on `min_order_qty_decimal` after checking its variant with `is_some` [INFO] [stdout] --> src/hedger/common.rs:364:48 [INFO] [stdout] | [INFO] [stdout] 361 | if is_spot && side == OrderSide::Sell && min_order_qty_decimal.is_some() { [INFO] [stdout] | ------------------------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 364 | && remaining_total_qty_d < min_order_qty_decimal.unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `min_order_qty_decimal` after checking its variant with `is_some` [INFO] [stdout] --> src/hedger/common.rs:368:83 [INFO] [stdout] | [INFO] [stdout] 361 | if is_spot && side == OrderSide::Sell && min_order_qty_decimal.is_some() { [INFO] [stdout] | ------------------------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 368 | operation_id, remaining_total_qty, remaining_total_qty_d, min_order_qty_decimal.unwrap(), stage [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | / if is_spot { [INFO] [stdout] 118 | | if let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 119 | | error!("op_id:{}: Failed update initial spot order info in DB: {}", operation_id, e); [INFO] [stdout] 120 | | } [INFO] [stdout] 121 | | } [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] 117 ~ if is_spot [INFO] [stdout] 118 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 119 | error!("op_id:{}: Failed update initial spot order info in DB: {}", operation_id, e); [INFO] [stdout] 120 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:196:26 [INFO] [stdout] | [INFO] [stdout] 196 | / ... if is_spot { [INFO] [stdout] 197 | | ... if let Err(db_err) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 198 | | ... error!("op_id:{}: Failed update DB after {} order not found: {}", operation_id, if is_spot { "spot" } else { "futur... [INFO] [stdout] 199 | | ... } [INFO] [stdout] 200 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 196 ~ if is_spot [INFO] [stdout] 197 ~ && let Err(db_err) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 198 | error!("op_id:{}: Failed update DB after {} order not found: {}", operation_id, if is_spot { "spot" } else { "futures" }, db_err); [INFO] [stdout] 199 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:497:35 [INFO] [stdout] | [INFO] [stdout] 497 | let error_text = format!("⚠️ Волатильность должна быть не отрицательной (в %). Введите снова:"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"⚠️ Волатильность должна быть не отрицательной (в %). Введите снова:".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 `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:251:17 [INFO] [stdout] | [INFO] [stdout] 251 | / if is_spot { [INFO] [stdout] 252 | | if let Err(e) = update_hedge_spot_order( [INFO] [stdout] 253 | | db, [INFO] [stdout] 254 | | operation_id, [INFO] [stdout] ... | [INFO] [stdout] 265 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 251 ~ if is_spot [INFO] [stdout] 252 ~ && let Err(e) = update_hedge_spot_order( [INFO] [stdout] 253 | db, [INFO] [stdout] ... [INFO] [stdout] 263 | ); [INFO] [stdout] 264 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:505:35 [INFO] [stdout] | [INFO] [stdout] 505 | let error_text = format!("⚠️ Неверный формат волатильности (в %). Введите снова:"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"⚠️ Неверный формат волатильности (в %). Введите снова:".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] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:388:37 [INFO] [stdout] | [INFO] [stdout] 388 | / ... if is_spot { [INFO] [stdout] 389 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 390 | | ... error!("op_id:{}: Failed update DB after dust cancel fill: {}", operation_id, e); [INFO] [stdout] 391 | | ... } [INFO] [stdout] 392 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 388 ~ if is_spot [INFO] [stdout] 389 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 390 | error!("op_id:{}: Failed update DB after dust cancel fill: {}", operation_id, e); [INFO] [stdout] 391 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:437:33 [INFO] [stdout] | [INFO] [stdout] 437 | / ... if is_spot { [INFO] [stdout] 438 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 439 | | ... error!("op_id:{}: Failed update DB after cancel fill: {}", operation_id, e); [INFO] [stdout] 440 | | ... } [INFO] [stdout] 441 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 437 ~ if is_spot [INFO] [stdout] 438 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 439 | error!("op_id:{}: Failed update DB after cancel fill: {}", operation_id, e); [INFO] [stdout] 440 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:459:33 [INFO] [stdout] | [INFO] [stdout] 459 | / ... if is_spot { [INFO] [stdout] 460 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 461 | | ... error!("op_id:{}: Failed update DB after final cancel correction: {}", operation_id, e); [INFO] [stdout] 462 | | ... } [INFO] [stdout] 463 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 459 ~ if is_spot [INFO] [stdout] 460 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, None, cumulative_filled_qty).await { [INFO] [stdout] 461 | error!("op_id:{}: Failed update DB after final cancel correction: {}", operation_id, e); [INFO] [stdout] 462 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:530:13 [INFO] [stdout] | [INFO] [stdout] 530 | / ... if is_spot { [INFO] [stdout] 531 | | ... if let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 532 | | ... error!("op_id:{}: Failed update DB after replacement order placement: {}", operation_id, e); [INFO] [stdout] 533 | | ... } [INFO] [stdout] 534 | | ... } [INFO] [stdout] | |________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 530 ~ if is_spot [INFO] [stdout] 531 ~ && let Err(e) = update_hedge_spot_order(db, operation_id, current_order_id.as_deref(), cumulative_filled_qty).await { [INFO] [stdout] 532 | error!("op_id:{}: Failed update DB after replacement order placement: {}", operation_id, e); [INFO] [stdout] 533 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/common.rs:556:13 [INFO] [stdout] | [INFO] [stdout] 556 | / if let Err(e) = progress_callback(update).await { [INFO] [stdout] 557 | | if !e.to_string().contains("message is not modified") { [INFO] [stdout] 558 | | warn!("op_id:{}: Progress callback failed (Stage: {:?}): {}", operation_id, stage, e); [INFO] [stdout] 559 | | } [INFO] [stdout] 560 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 556 ~ if let Err(e) = progress_callback(update).await [INFO] [stdout] 557 ~ && !e.to_string().contains("message is not modified") { [INFO] [stdout] 558 | warn!("op_id:{}: Progress callback failed (Stage: {:?}): {}", operation_id, stage, e); [INFO] [stdout] 559 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/hedge.rs:273:5 [INFO] [stdout] | [INFO] [stdout] 273 | / if let Err(error) = progress_callback(spot_done_update).await { [INFO] [stdout] 274 | | if !error.to_string().contains("message is not modified") { [INFO] [stdout] 275 | | warn!( [INFO] [stdout] 276 | | "op_id:{}: Progress callback failed after spot fill: {}", [INFO] [stdout] ... | [INFO] [stdout] 280 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 273 ~ if let Err(error) = progress_callback(spot_done_update).await [INFO] [stdout] 274 ~ && !error.to_string().contains("message is not modified") { [INFO] [stdout] 275 | warn!( [INFO] [stdout] ... [INFO] [stdout] 278 | ); [INFO] [stdout] 279 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/hedge.rs:436:5 [INFO] [stdout] | [INFO] [stdout] 436 | / if let Err(error) = progress_callback(futures_done_update).await { [INFO] [stdout] 437 | | if !error.to_string().contains("message is not modified") { [INFO] [stdout] 438 | | warn!("op_id:{}: Futures progress callback failed: {}", operation_identifier, error); [INFO] [stdout] 439 | | } [INFO] [stdout] 440 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 436 ~ if let Err(error) = progress_callback(futures_done_update).await [INFO] [stdout] 437 ~ && !error.to_string().contains("message is not modified") { [INFO] [stdout] 438 | warn!("op_id:{}: Futures progress callback failed: {}", operation_identifier, error); [INFO] [stdout] 439 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `anyhow::Error` [INFO] [stdout] --> src/notifier/hedge_flow_logic/ui.rs:118:25 [INFO] [stdout] | [INFO] [stdout] 118 | return Err(e.into()); [INFO] [stdout] | ^^^^^^^^ help: consider removing `.into()`: `e` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (10/7) [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:26:1 [INFO] [stdout] | [INFO] [stdout] 26 | / pub(super) async fn spawn_sequential_hedge_task( [INFO] [stdout] 27 | | bot: Bot, [INFO] [stdout] 28 | | exchange: Arc, [INFO] [stdout] 29 | | cfg: Arc, [INFO] [stdout] ... | [INFO] [stdout] 38 | | where [INFO] [stdout] 39 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:129:14 [INFO] [stdout] | [INFO] [stdout] 129 | / if let Err(e) = bot_for_callback.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await { [INFO] [stdout] 130 | | if !e.to_string().contains("not modified") { warn!("op_id:{}: Progress callback failed: {}", operation_id_cb, e); } [INFO] [stdout] 131 | | } [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 129 ~ if let Err(e) = bot_for_callback.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await [INFO] [stdout] 130 ~ && !e.to_string().contains("not modified") { warn!("op_id:{}: Progress callback failed: {}", operation_id_cb, e); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:145:57 [INFO] [stdout] | [INFO] [stdout] 145 | ... = result.is_err() && result.as_ref().err().map_or(false, |e| e.to_string().contains("cancelled by user")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 145 - let is_cancelled_by_button = result.is_err() && result.as_ref().err().map_or(false, |e| e.to_string().contains("cancelled by user")); [INFO] [stdout] 145 + let is_cancelled_by_button = result.is_err() && result.as_ref().err().is_some_and(|e| e.to_string().contains("cancelled by user")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:189:1 [INFO] [stdout] | [INFO] [stdout] 189 | / pub(super) async fn spawn_ws_hedge_task( [INFO] [stdout] 190 | | bot: Bot, [INFO] [stdout] 191 | | exchange_rest: Arc, [INFO] [stdout] 192 | | cfg: Arc, [INFO] [stdout] ... | [INFO] [stdout] 199 | | where [INFO] [stdout] 200 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:328:13 [INFO] [stdout] | [INFO] [stdout] 328 | / if let Err(e) = bot_cb.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await { [INFO] [stdout] 329 | | if !e.to_string().contains("message is not modified") { [INFO] [stdout] 330 | | warn!("op_id:{}: WS Progress callback failed: {}", operation_id_cb, e); [INFO] [stdout] 331 | | } [INFO] [stdout] 332 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 328 ~ if let Err(e) = bot_cb.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await [INFO] [stdout] 329 ~ && !e.to_string().contains("message is not modified") { [INFO] [stdout] 330 | warn!("op_id:{}: WS Progress callback failed: {}", operation_id_cb, e); [INFO] [stdout] 331 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/hedger/unhedge.rs:114:9 [INFO] [stdout] | [INFO] [stdout] 114 | Decimal::try_from(actual_spot_sell_qty).unwrap_or_else(|_| Decimal::ZERO); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 114 - Decimal::try_from(actual_spot_sell_qty).unwrap_or_else(|_| Decimal::ZERO); [INFO] [stdout] 114 + Decimal::try_from(actual_spot_sell_qty).unwrap_or(Decimal::ZERO); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/mod.rs:114:1 [INFO] [stdout] | [INFO] [stdout] 114 | / pub async fn dispatch_command( [INFO] [stdout] 115 | | bot: Bot, [INFO] [stdout] 116 | | msg: Message, [INFO] [stdout] 117 | | cmd: Command, [INFO] [stdout] ... | [INFO] [stdout] 123 | | ) -> anyhow::Result<()> [INFO] [stdout] 124 | | where E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |__________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/hedger/unhedge.rs:213:5 [INFO] [stdout] | [INFO] [stdout] 213 | / if let Err(e) = progress_callback(spot_done_update).await { [INFO] [stdout] 214 | | if !e.to_string().contains("message is not modified") { [INFO] [stdout] 215 | | warn!( [INFO] [stdout] 216 | | "op_id:{}: Unhedge progress callback failed after spot sell: {}", [INFO] [stdout] ... | [INFO] [stdout] 220 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 213 ~ if let Err(e) = progress_callback(spot_done_update).await [INFO] [stdout] 214 ~ && !e.to_string().contains("message is not modified") { [INFO] [stdout] 215 | warn!( [INFO] [stdout] ... [INFO] [stdout] 218 | ); [INFO] [stdout] 219 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/notifier/mod.rs:249:16 [INFO] [stdout] | [INFO] [stdout] 249 | if msg.text().map_or(false, |t| t.starts_with('/')) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 249 - if msg.text().map_or(false, |t| t.starts_with('/')) { [INFO] [stdout] 249 + if msg.text().is_some_and(|t| t.starts_with('/')) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/storage/db.rs:47:1 [INFO] [stdout] | [INFO] [stdout] 47 | / pub async fn insert_hedge_operation( [INFO] [stdout] 48 | | db: &Db, [INFO] [stdout] 49 | | chat_id: i64, [INFO] [stdout] 50 | | base_symbol: &str, [INFO] [stdout] ... | [INFO] [stdout] 55 | | target_futures_qty: f64, [INFO] [stdout] 56 | | ) -> Result { [INFO] [stdout] | |___________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/wallet_info.rs:58:13 [INFO] [stdout] | [INFO] [stdout] 58 | / if include_approx_value && coin != quote_currency { [INFO] [stdout] 59 | | if let Some(price) = prices.get(&coin) { [INFO] [stdout] 60 | | let total_qty = balance.free + balance.locked; [INFO] [stdout] 61 | | if total_qty > ORDER_FILL_TOLERANCE && *price > 0.0 { [INFO] [stdout] ... | [INFO] [stdout] 66 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 58 ~ if include_approx_value && coin != quote_currency [INFO] [stdout] 59 ~ && let Some(price) = prices.get(&coin) { [INFO] [stdout] 60 | let total_qty = balance.free + balance.locked; [INFO] [stdout] ... [INFO] [stdout] 64 | } [INFO] [stdout] 65 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (11/7) [INFO] [stdout] --> src/webservice_hedge/common.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / pub fn calculate_auto_chunk_parameters( [INFO] [stdout] 12 | | // --- Цели --- [INFO] [stdout] 13 | | initial_target_spot_value: Decimal, // Общая целевая стоимость спота (из расчета по волатильности) [INFO] [stdout] 14 | | initial_target_futures_quantity: Decimal, // Общий целевой объем фьючерса (из расчета) [INFO] [stdout] ... | [INFO] [stdout] 28 | | ) -> Result<(u32, Decimal, Decimal)> { [INFO] [stdout] | |____________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/common.rs:75:32 [INFO] [stdout] | [INFO] [stdout] 75 | ... = min_spot_notional_value.map_or(true, |min_val| chunk_spot_value_estimate >= min_val || chunk_spot_value_estimate < tolerance); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 75 - let spot_notional_ok = min_spot_notional_value.map_or(true, |min_val| chunk_spot_value_estimate >= min_val || chunk_spot_value_estimate < tolerance); [INFO] [stdout] 75 + let spot_notional_ok = min_spot_notional_value.is_none_or(|min_val| chunk_spot_value_estimate >= min_val || chunk_spot_value_estimate < tolerance); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/common.rs:80:35 [INFO] [stdout] | [INFO] [stdout] 80 | ... = min_futures_notional_value.map_or(true, |min_val| chunk_futures_value_estimate >= min_val || chunk_futures_value_estimate < tolerance); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 80 - let futures_notional_ok = min_futures_notional_value.map_or(true, |min_val| chunk_futures_value_estimate >= min_val || chunk_futures_value_estimate < tolerance); [INFO] [stdout] 80 + let futures_notional_ok = min_futures_notional_value.is_none_or(|min_val| chunk_futures_value_estimate >= min_val || chunk_futures_value_estimate < tolerance); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/hedge_flow.rs:27:1 [INFO] [stdout] | [INFO] [stdout] 27 | / pub async fn handle_hedge_command( [INFO] [stdout] 28 | | bot: Bot, msg: Message, symbol_arg: String, exchange: Arc, state_storage: StateStorage, [INFO] [stdout] 29 | | running_operations: RunningOperations, cfg: Arc, db: Arc [INFO] [stdout] 30 | | ) -> anyhow::Result<()> [INFO] [stdout] 31 | | where E: Exchange + Clone + Send + Sync + 'static { [INFO] [stdout] | |_________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/unhedge_flow.rs:104:1 [INFO] [stdout] | [INFO] [stdout] 104 | / async fn spawn_unhedge_task( [INFO] [stdout] 105 | | bot: Bot, [INFO] [stdout] 106 | | exchange: Arc, [INFO] [stdout] 107 | | cfg: Arc, [INFO] [stdout] ... | [INFO] [stdout] 114 | | where [INFO] [stdout] 115 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/chunk_execution.rs:59:28 [INFO] [stdout] | [INFO] [stdout] 59 | let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 60 | | (spot_quantity_rounded * current_spot_price_estimate) >= min_val || spot_quantity_rounded < tolerance [INFO] [stdout] 61 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 59 - let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] 59 + let spot_notional_ok = task.state.min_spot_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/chunk_execution.rs:63:31 [INFO] [stdout] | [INFO] [stdout] 63 | let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 64 | | (futures_quantity_rounded * futures_price_estimate) >= min_val || futures_quantity_rounded < tolerance [INFO] [stdout] 65 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 63 - let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] 63 + let futures_notional_ok = task.state.min_futures_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/unhedge_flow.rs:371:1 [INFO] [stdout] | [INFO] [stdout] 371 | / pub async fn handle_unhedge_command( [INFO] [stdout] 372 | | bot: Bot, [INFO] [stdout] 373 | | msg: Message, [INFO] [stdout] 374 | | symbol_arg: String, [INFO] [stdout] ... | [INFO] [stdout] 381 | | where [INFO] [stdout] 382 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/unhedge_flow.rs:404:5 [INFO] [stdout] | [INFO] [stdout] 404 | / if let Some(bot_msg_id) = previous_bot_message_id { [INFO] [stdout] 405 | | if let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { warn!("Failed delete prev bot msg: {}", e); } [INFO] [stdout] 406 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 404 ~ if let Some(bot_msg_id) = previous_bot_message_id [INFO] [stdout] 405 ~ && let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { warn!("Failed delete prev bot msg: {}", e); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be written as a `let` statement [INFO] [stdout] --> src/notifier/active_ops.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | / let filled_qty = match info.total_filled_spot_qty.lock().await { [INFO] [stdout] 53 | | guard => *guard, [INFO] [stdout] ... | [INFO] [stdout] 59 | | }; [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 52 ~ let guard = info.total_filled_spot_qty.lock().await; [INFO] [stdout] 53 + let filled_qty = *guard; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assignment could be simplified [INFO] [stdout] --> src/notifier/active_ops.rs:165:25 [INFO] [stdout] | [INFO] [stdout] 165 | / filled_spot_qty_in_operation = match info.total_filled_spot_qty.lock().await { [INFO] [stdout] 166 | | guard => *guard, [INFO] [stdout] ... | [INFO] [stdout] 171 | | }; [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] help: consider removing the `match` expression [INFO] [stdout] | [INFO] [stdout] 165 ~ let guard = info.total_filled_spot_qty.lock().await; [INFO] [stdout] 166 ~ filled_spot_qty_in_operation = *guard; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | / ... if let Some(spot_order) = spot_order_opt { [INFO] [stdout] 27 | | ... if matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 28 | | ... if let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_marke... [INFO] [stdout] 29 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] ... | [INFO] [stdout] 39 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 26 ~ if let Some(spot_order) = spot_order_opt [INFO] [stdout] 27 ~ && matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 28 | if let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_market_data.last_update_time_ms) { [INFO] [stdout] ... [INFO] [stdout] 37 | } [INFO] [stdout] 38 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | / ... if matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 28 | | ... if let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_market_da... [INFO] [stdout] 29 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] 30 | | ... if spot_order.limit_price < best_ask * (Decimal::ONE - stale_ratio_decimal) { [INFO] [stdout] ... | [INFO] [stdout] 38 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 27 ~ if matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) [INFO] [stdout] 28 ~ && let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_market_data.last_update_time_ms) { [INFO] [stdout] 29 | if now_ms - last_update_time < 5000 { [INFO] [stdout] ... [INFO] [stdout] 36 | } else { trace!(operation_id = task.operation_id, "Spot market data is too old for stale check ({:.1}s)", (now_ms - last_update_time) as f64 / 1000.0); } [INFO] [stdout] 37 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | / ... if let Some(futures_order) = futures_order_opt { [INFO] [stdout] 44 | | ... if matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 45 | | ... if let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures... [INFO] [stdout] 46 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] ... | [INFO] [stdout] 56 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 43 ~ if let Some(futures_order) = futures_order_opt [INFO] [stdout] 44 ~ && matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 45 | if let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures_market_data.last_update_time_ms) { [INFO] [stdout] ... [INFO] [stdout] 54 | } [INFO] [stdout] 55 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | / ... if matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 45 | | ... if let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures_mar... [INFO] [stdout] 46 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] 47 | | ... if futures_order.limit_price > best_bid * (Decimal::ONE + stale_ratio_decimal) { [INFO] [stdout] ... | [INFO] [stdout] 55 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 44 ~ if matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) [INFO] [stdout] 45 ~ && let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures_market_data.last_update_time_ms) { [INFO] [stdout] 46 | if now_ms - last_update_time < 5000 { [INFO] [stdout] ... [INFO] [stdout] 53 | } else { trace!(operation_id = task.operation_id, "Futures market data is too old for stale check ({:.1}s)", (now_ms - last_update_time) as f64 / 1000.0); } [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/active_ops.rs:384:38 [INFO] [stdout] | [INFO] [stdout] 384 | ... } else if filled_spot_qty_in_operation > ORDER_FILL_TOLERANCE { [INFO] [stdout] | ______________^ [INFO] [stdout] 385 | | ... if final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") |... [INFO] [stdout] 386 | | ... final_text.push_str("\nПопытка продать накопленный спот не удалась."); [INFO] [stdout] 387 | | ... } [INFO] [stdout] 388 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 384 ~ } else if filled_spot_qty_in_operation > ORDER_FILL_TOLERANCE [INFO] [stdout] 385 ~ && final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] 386 | final_text.push_str("\nПопытка продать накопленный спот не удалась."); [INFO] [stdout] 387 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/notifier/active_ops.rs:385:39 [INFO] [stdout] | [INFO] [stdout] 385 | ...if final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 385 - if final_error_message.as_ref().map_or(false, |s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] 385 + if final_error_message.as_ref().is_some_and(|s| s.contains("Failed sell spot") || s.contains("Failed get balance") || s.contains("Balance too low")) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | / pub async fn handle_hedge_command( [INFO] [stdout] 22 | | bot: Bot, [INFO] [stdout] 23 | | msg: Message, [INFO] [stdout] 24 | | symbol_arg: String, [INFO] [stdout] ... | [INFO] [stdout] 31 | | where [INFO] [stdout] 32 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | / if let Some(bot_msg_id) = previous_bot_message_id { [INFO] [stdout] 60 | | if let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { [INFO] [stdout] 61 | | warn!("Failed delete prev bot msg {}: {}", bot_msg_id, e); [INFO] [stdout] 62 | | } [INFO] [stdout] 63 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 59 ~ if let Some(bot_msg_id) = previous_bot_message_id [INFO] [stdout] 60 ~ && let Err(e) = bot.delete_message(chat_id, MessageId(bot_msg_id)).await { [INFO] [stdout] 61 | warn!("Failed delete prev bot msg {}: {}", bot_msg_id, e); [INFO] [stdout] 62 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | / ... if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone { [INFO] [stdout] 20 | | ... if details.order_id == *cancelled_order_id { [INFO] [stdout] 21 | | ... info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled."); [INFO] [stdout] 22 | | ... handle_order_update(task, details.clone()).await?; // <-- Вызываем ИСПРАВЛЕННУЮ версию ниже [INFO] [stdout] ... | [INFO] [stdout] 36 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 19 ~ if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone [INFO] [stdout] 20 ~ && details.order_id == *cancelled_order_id { [INFO] [stdout] 21 | info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled."); [INFO] [stdout] ... [INFO] [stdout] 34 | return Ok(()); [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:76:29 [INFO] [stdout] | [INFO] [stdout] 76 | let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 76 - let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 76 + let old_filled_qty = if task.state.active_spot_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:79:15 [INFO] [stdout] | [INFO] [stdout] 79 | } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 79 - } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 79 + } else if task.state.active_futures_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:52:28 [INFO] [stdout] | [INFO] [stdout] 52 | let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 53 | | (spot_quantity_rounded * current_spot_price_estimate) >= min_val || spot_quantity_rounded < tolerance [INFO] [stdout] 54 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 52 - let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] 52 + let spot_notional_ok = task.state.min_spot_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:56:31 [INFO] [stdout] | [INFO] [stdout] 56 | let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 57 | | (futures_quantity_rounded * futures_price_estimate) >= min_val || futures_quantity_rounded < tolerance [INFO] [stdout] 58 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 56 - let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] 56 + let futures_notional_ok = task.state.min_futures_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:497:35 [INFO] [stdout] | [INFO] [stdout] 497 | let error_text = format!("⚠️ Волатильность должна быть не отрицательной (в %). Введите снова:"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"⚠️ Волатильность должна быть не отрицательной (в %). Введите снова:".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: useless use of `format!` [INFO] [stdout] --> src/notifier/hedge_flow_logic/handlers.rs:505:35 [INFO] [stdout] | [INFO] [stdout] 505 | let error_text = format!("⚠️ Неверный формат волатильности (в %). Введите снова:"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"⚠️ Неверный формат волатильности (в %). Введите снова:".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] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `anyhow::Error` [INFO] [stdout] --> src/notifier/hedge_flow_logic/ui.rs:118:25 [INFO] [stdout] | [INFO] [stdout] 118 | return Err(e.into()); [INFO] [stdout] | ^^^^^^^^ help: consider removing `.into()`: `e` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (10/7) [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:26:1 [INFO] [stdout] | [INFO] [stdout] 26 | / pub(super) async fn spawn_sequential_hedge_task( [INFO] [stdout] 27 | | bot: Bot, [INFO] [stdout] 28 | | exchange: Arc, [INFO] [stdout] 29 | | cfg: Arc, [INFO] [stdout] ... | [INFO] [stdout] 38 | | where [INFO] [stdout] 39 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:129:14 [INFO] [stdout] | [INFO] [stdout] 129 | / if let Err(e) = bot_for_callback.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await { [INFO] [stdout] 130 | | if !e.to_string().contains("not modified") { warn!("op_id:{}: Progress callback failed: {}", operation_id_cb, e); } [INFO] [stdout] 131 | | } [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 129 ~ if let Err(e) = bot_for_callback.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await [INFO] [stdout] 130 ~ && !e.to_string().contains("not modified") { warn!("op_id:{}: Progress callback failed: {}", operation_id_cb, e); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | / ... if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone { [INFO] [stdout] 22 | | ... if details.order_id == *cancelled_order_id { [INFO] [stdout] 23 | | ... info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled (u... [INFO] [stdout] 24 | | ... handle_order_update(task, details.clone()).await?; [INFO] [stdout] ... | [INFO] [stdout] 40 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 21 ~ if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone [INFO] [stdout] 22 ~ && details.order_id == *cancelled_order_id { [INFO] [stdout] 23 | info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled (unhedge)."); [INFO] [stdout] ... [INFO] [stdout] 38 | return Ok(()); [INFO] [stdout] 39 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:145:57 [INFO] [stdout] | [INFO] [stdout] 145 | ... = result.is_err() && result.as_ref().err().map_or(false, |e| e.to_string().contains("cancelled by user")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 145 - let is_cancelled_by_button = result.is_err() && result.as_ref().err().map_or(false, |e| e.to_string().contains("cancelled by user")); [INFO] [stdout] 145 + let is_cancelled_by_button = result.is_err() && result.as_ref().err().is_some_and(|e| e.to_string().contains("cancelled by user")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:189:1 [INFO] [stdout] | [INFO] [stdout] 189 | / pub(super) async fn spawn_ws_hedge_task( [INFO] [stdout] 190 | | bot: Bot, [INFO] [stdout] 191 | | exchange_rest: Arc, [INFO] [stdout] 192 | | cfg: Arc, [INFO] [stdout] ... | [INFO] [stdout] 199 | | where [INFO] [stdout] 200 | | E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:81:29 [INFO] [stdout] | [INFO] [stdout] 81 | let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 81 - let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 81 + let old_filled_qty = if task.state.active_spot_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:84:15 [INFO] [stdout] | [INFO] [stdout] 84 | } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 84 - } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 84 + } else if task.state.active_futures_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/notifier/hedge_flow_spawners.rs:328:13 [INFO] [stdout] | [INFO] [stdout] 328 | / if let Err(e) = bot_cb.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await { [INFO] [stdout] 329 | | if !e.to_string().contains("message is not modified") { [INFO] [stdout] 330 | | warn!("op_id:{}: WS Progress callback failed: {}", operation_id_cb, e); [INFO] [stdout] 331 | | } [INFO] [stdout] 332 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 328 ~ if let Err(e) = bot_cb.edit_message_text(chat_id_cb, msg_id_cb, text).reply_markup(kb).await [INFO] [stdout] 329 ~ && !e.to_string().contains("message is not modified") { [INFO] [stdout] 330 | warn!("op_id:{}: WS Progress callback failed: {}", operation_id_cb, e); [INFO] [stdout] 331 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/main.rs:48:26 [INFO] [stdout] | [INFO] [stdout] 48 | let base_url: &str = cfg [INFO] [stdout] | __________________________^ [INFO] [stdout] 49 | | .bybit_base_url [INFO] [stdout] 50 | | .as_deref() [INFO] [stdout] 51 | | .filter(|s| !s.is_empty()) [INFO] [stdout] ... | [INFO] [stdout] 58 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 52 ~ .unwrap_or({ [INFO] [stdout] 53 + if cfg.use_testnet { [INFO] [stdout] 54 + "https://api-testnet.bybit.com" [INFO] [stdout] 55 + } else { [INFO] [stdout] 56 + "https://api.bybit.com" [INFO] [stdout] 57 + } [INFO] [stdout] 58 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/notifier/mod.rs:114:1 [INFO] [stdout] | [INFO] [stdout] 114 | / pub async fn dispatch_command( [INFO] [stdout] 115 | | bot: Bot, [INFO] [stdout] 116 | | msg: Message, [INFO] [stdout] 117 | | cmd: Command, [INFO] [stdout] ... | [INFO] [stdout] 123 | | ) -> anyhow::Result<()> [INFO] [stdout] 124 | | where E: Exchange + Clone + Send + Sync + 'static, [INFO] [stdout] | |__________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/notifier/mod.rs:249:16 [INFO] [stdout] | [INFO] [stdout] 249 | if msg.text().map_or(false, |t| t.starts_with('/')) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 249 - if msg.text().map_or(false, |t| t.starts_with('/')) { [INFO] [stdout] 249 + if msg.text().is_some_and(|t| t.starts_with('/')) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/storage/db.rs:47:1 [INFO] [stdout] | [INFO] [stdout] 47 | / pub async fn insert_hedge_operation( [INFO] [stdout] 48 | | db: &Db, [INFO] [stdout] 49 | | chat_id: i64, [INFO] [stdout] 50 | | base_symbol: &str, [INFO] [stdout] ... | [INFO] [stdout] 55 | | target_futures_qty: f64, [INFO] [stdout] 56 | | ) -> Result { [INFO] [stdout] | |___________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (11/7) [INFO] [stdout] --> src/webservice_hedge/common.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / pub fn calculate_auto_chunk_parameters( [INFO] [stdout] 12 | | // --- Цели --- [INFO] [stdout] 13 | | initial_target_spot_value: Decimal, // Общая целевая стоимость спота (из расчета по волатильности) [INFO] [stdout] 14 | | initial_target_futures_quantity: Decimal, // Общий целевой объем фьючерса (из расчета) [INFO] [stdout] ... | [INFO] [stdout] 28 | | ) -> Result<(u32, Decimal, Decimal)> { [INFO] [stdout] | |____________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/common.rs:75:32 [INFO] [stdout] | [INFO] [stdout] 75 | ... = min_spot_notional_value.map_or(true, |min_val| chunk_spot_value_estimate >= min_val || chunk_spot_value_estimate < tolerance); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 75 - let spot_notional_ok = min_spot_notional_value.map_or(true, |min_val| chunk_spot_value_estimate >= min_val || chunk_spot_value_estimate < tolerance); [INFO] [stdout] 75 + let spot_notional_ok = min_spot_notional_value.is_none_or(|min_val| chunk_spot_value_estimate >= min_val || chunk_spot_value_estimate < tolerance); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/common.rs:80:35 [INFO] [stdout] | [INFO] [stdout] 80 | ... = min_futures_notional_value.map_or(true, |min_val| chunk_futures_value_estimate >= min_val || chunk_futures_value_estimate < tolerance); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 80 - let futures_notional_ok = min_futures_notional_value.map_or(true, |min_val| chunk_futures_value_estimate >= min_val || chunk_futures_value_estimate < tolerance); [INFO] [stdout] 80 + let futures_notional_ok = min_futures_notional_value.is_none_or(|min_val| chunk_futures_value_estimate >= min_val || chunk_futures_value_estimate < tolerance); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/chunk_execution.rs:59:28 [INFO] [stdout] | [INFO] [stdout] 59 | let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 60 | | (spot_quantity_rounded * current_spot_price_estimate) >= min_val || spot_quantity_rounded < tolerance [INFO] [stdout] 61 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 59 - let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] 59 + let spot_notional_ok = task.state.min_spot_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/chunk_execution.rs:63:31 [INFO] [stdout] | [INFO] [stdout] 63 | let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 64 | | (futures_quantity_rounded * futures_price_estimate) >= min_val || futures_quantity_rounded < tolerance [INFO] [stdout] 65 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 63 - let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] 63 + let futures_notional_ok = task.state.min_futures_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | / ... if let Some(spot_order) = spot_order_opt { [INFO] [stdout] 27 | | ... if matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 28 | | ... if let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_marke... [INFO] [stdout] 29 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] ... | [INFO] [stdout] 39 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 26 ~ if let Some(spot_order) = spot_order_opt [INFO] [stdout] 27 ~ && matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 28 | if let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_market_data.last_update_time_ms) { [INFO] [stdout] ... [INFO] [stdout] 37 | } [INFO] [stdout] 38 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | / ... if matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 28 | | ... if let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_market_da... [INFO] [stdout] 29 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] 30 | | ... if spot_order.limit_price < best_ask * (Decimal::ONE - stale_ratio_decimal) { [INFO] [stdout] ... | [INFO] [stdout] 38 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 27 ~ if matches!(spot_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) [INFO] [stdout] 28 ~ && let (Some(best_ask), Some(last_update_time)) = (task.state.spot_market_data.best_ask_price, task.state.spot_market_data.last_update_time_ms) { [INFO] [stdout] 29 | if now_ms - last_update_time < 5000 { [INFO] [stdout] ... [INFO] [stdout] 36 | } else { trace!(operation_id = task.operation_id, "Spot market data is too old for stale check ({:.1}s)", (now_ms - last_update_time) as f64 / 1000.0); } [INFO] [stdout] 37 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | / ... if let Some(futures_order) = futures_order_opt { [INFO] [stdout] 44 | | ... if matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 45 | | ... if let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures... [INFO] [stdout] 46 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] ... | [INFO] [stdout] 56 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 43 ~ if let Some(futures_order) = futures_order_opt [INFO] [stdout] 44 ~ && matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 45 | if let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures_market_data.last_update_time_ms) { [INFO] [stdout] ... [INFO] [stdout] 54 | } [INFO] [stdout] 55 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/order_management.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | / ... if matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) { [INFO] [stdout] 45 | | ... if let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures_mar... [INFO] [stdout] 46 | | ... if now_ms - last_update_time < 5000 { [INFO] [stdout] 47 | | ... if futures_order.limit_price > best_bid * (Decimal::ONE + stale_ratio_decimal) { [INFO] [stdout] ... | [INFO] [stdout] 55 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 44 ~ if matches!(futures_order.status, OrderStatusText::New | OrderStatusText::PartiallyFilled) [INFO] [stdout] 45 ~ && let (Some(best_bid), Some(last_update_time)) = (task.state.futures_market_data.best_bid_price, task.state.futures_market_data.last_update_time_ms) { [INFO] [stdout] 46 | if now_ms - last_update_time < 5000 { [INFO] [stdout] ... [INFO] [stdout] 53 | } else { trace!(operation_id = task.operation_id, "Futures market data is too old for stale check ({:.1}s)", (now_ms - last_update_time) as f64 / 1000.0); } [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | / ... if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone { [INFO] [stdout] 20 | | ... if details.order_id == *cancelled_order_id { [INFO] [stdout] 21 | | ... info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled."); [INFO] [stdout] 22 | | ... handle_order_update(task, details.clone()).await?; // <-- Вызываем ИСПРАВЛЕННУЮ версию ниже [INFO] [stdout] ... | [INFO] [stdout] 36 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 19 ~ if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone [INFO] [stdout] 20 ~ && details.order_id == *cancelled_order_id { [INFO] [stdout] 21 | info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled."); [INFO] [stdout] ... [INFO] [stdout] 34 | return Ok(()); [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:76:29 [INFO] [stdout] | [INFO] [stdout] 76 | let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 76 - let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 76 + let old_filled_qty = if task.state.active_spot_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/hedge_logic/ws_handlers.rs:79:15 [INFO] [stdout] | [INFO] [stdout] 79 | } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 79 - } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 79 + } else if task.state.active_futures_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:52:28 [INFO] [stdout] | [INFO] [stdout] 52 | let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 53 | | (spot_quantity_rounded * current_spot_price_estimate) >= min_val || spot_quantity_rounded < tolerance [INFO] [stdout] 54 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 52 - let spot_notional_ok = task.state.min_spot_notional.map_or(true, |min_val| { [INFO] [stdout] 52 + let spot_notional_ok = task.state.min_spot_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/chunk_execution.rs:56:31 [INFO] [stdout] | [INFO] [stdout] 56 | let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 57 | | (futures_quantity_rounded * futures_price_estimate) >= min_val || futures_quantity_rounded < tolerance [INFO] [stdout] 58 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 56 - let futures_notional_ok = task.state.min_futures_notional.map_or(true, |min_val| { [INFO] [stdout] 56 + let futures_notional_ok = task.state.min_futures_notional.is_none_or(|min_val| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | / ... if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone { [INFO] [stdout] 22 | | ... if details.order_id == *cancelled_order_id { [INFO] [stdout] 23 | | ... info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled (u... [INFO] [stdout] 24 | | ... handle_order_update(task, details.clone()).await?; [INFO] [stdout] ... | [INFO] [stdout] 40 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 21 ~ if let HedgerWsStatus::WaitingCancelConfirmation { ref cancelled_order_id, cancelled_leg, .. } = status_clone [INFO] [stdout] 22 ~ && details.order_id == *cancelled_order_id { [INFO] [stdout] 23 | info!(operation_id=task.operation_id, order_id=%details.order_id, "Received update for the order being cancelled (unhedge)."); [INFO] [stdout] ... [INFO] [stdout] 38 | return Ok(()); [INFO] [stdout] 39 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:81:29 [INFO] [stdout] | [INFO] [stdout] 81 | let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 81 - let old_filled_qty = if task.state.active_spot_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 81 + let old_filled_qty = if task.state.active_spot_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/webservice_hedge/unhedge_logic/ws_handlers.rs:84:15 [INFO] [stdout] | [INFO] [stdout] 84 | } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 84 - } else if task.state.active_futures_order.as_ref().map_or(false, |o| o.order_id == details.order_id) { [INFO] [stdout] 84 + } else if task.state.active_futures_order.as_ref().is_some_and(|o| o.order_id == details.order_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/main.rs:48:26 [INFO] [stdout] | [INFO] [stdout] 48 | let base_url: &str = cfg [INFO] [stdout] | __________________________^ [INFO] [stdout] 49 | | .bybit_base_url [INFO] [stdout] 50 | | .as_deref() [INFO] [stdout] 51 | | .filter(|s| !s.is_empty()) [INFO] [stdout] ... | [INFO] [stdout] 58 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 52 ~ .unwrap_or({ [INFO] [stdout] 53 + if cfg.use_testnet { [INFO] [stdout] 54 + "https://api-testnet.bybit.com" [INFO] [stdout] 55 + } else { [INFO] [stdout] 56 + "https://api.bybit.com" [INFO] [stdout] 57 + } [INFO] [stdout] 58 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2m 49s [INFO] running `Command { std: "docker" "inspect" "ffc469c716534341c5f30c57a514904b7b8f7cb8fdd3437b850a40d5a4f7dac4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "ffc469c716534341c5f30c57a514904b7b8f7cb8fdd3437b850a40d5a4f7dac4", kill_on_drop: false }` [INFO] [stdout] ffc469c716534341c5f30c57a514904b7b8f7cb8fdd3437b850a40d5a4f7dac4