[INFO] cloning repository https://github.com/eriksre/rust_crypto_mm [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/eriksre/rust_crypto_mm" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Feriksre%2Frust_crypto_mm", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Feriksre%2Frust_crypto_mm'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 2ba087e4fde3cec62318b5be1d80ec5bdda45473 [INFO] linting eriksre/rust_crypto_mm against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Feriksre%2Frust_crypto_mm" "/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/eriksre/rust_crypto_mm [INFO] finished tweaking git repo https://github.com/eriksre/rust_crypto_mm [INFO] tweaked toml for git repo https://github.com/eriksre/rust_crypto_mm written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/eriksre/rust_crypto_mm 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/eriksre/rust_crypto_mm 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 ryu v1.0.21 [INFO] [stderr] Downloaded fastwebsockets v0.6.0 [INFO] [stderr] Downloaded itoa v1.0.16 [INFO] [stderr] Downloaded zmij v0.1.8 [INFO] [stderr] Downloaded serde_json v1.0.147 [INFO] [stderr] Downloaded cc v1.2.50 [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] e74de87fb6371c00f06c47a927d587a1f9757d17164b0e950d154cc626fbcc7c [INFO] running `Command { std: "docker" "start" "-a" "e74de87fb6371c00f06c47a927d587a1f9757d17164b0e950d154cc626fbcc7c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "e74de87fb6371c00f06c47a927d587a1f9757d17164b0e950d154cc626fbcc7c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e74de87fb6371c00f06c47a927d587a1f9757d17164b0e950d154cc626fbcc7c", kill_on_drop: false }` [INFO] [stdout] e74de87fb6371c00f06c47a927d587a1f9757d17164b0e950d154cc626fbcc7c [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] 5b955961241cf6bbe1ba090bc235eb793255cc260ea699a4a8d592a166151210 [INFO] running `Command { std: "docker" "start" "-a" "5b955961241cf6bbe1ba090bc235eb793255cc260ea699a4a8d592a166151210", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.178 [INFO] [stderr] Compiling find-msvc-tools v0.1.5 [INFO] [stderr] Checking itoa v1.0.16 [INFO] [stderr] Checking smallvec v1.15.1 [INFO] [stderr] Checking log v0.4.29 [INFO] [stderr] Checking rustls-pki-types v1.13.2 [INFO] [stderr] Compiling syn v2.0.111 [INFO] [stderr] Checking futures-task v0.3.31 [INFO] [stderr] Compiling rustls v0.21.12 [INFO] [stderr] Checking indexmap v2.12.1 [INFO] [stderr] Checking tracing v0.1.44 [INFO] [stderr] Compiling serde_json v1.0.147 [INFO] [stderr] Compiling rustls v0.22.4 [INFO] [stderr] Checking zmij v0.1.8 [INFO] [stderr] Checking ryu v1.0.21 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking webpki-roots v1.0.4 [INFO] [stderr] Checking http v0.2.12 [INFO] [stderr] Checking http v1.4.0 [INFO] [stderr] Checking webpki-roots v0.26.11 [INFO] [stderr] Compiling cc v1.2.50 [INFO] [stderr] Checking http-body v0.4.6 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Checking signal-hook-registry v1.4.7 [INFO] [stderr] Checking socket2 v0.6.1 [INFO] [stderr] Checking mio v1.1.1 [INFO] [stderr] Checking socket2 v0.5.10 [INFO] [stderr] Checking parking_lot_core v0.9.12 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling zerovec-derive v0.11.2 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling tokio-macros v2.6.0 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.1 [INFO] [stderr] Checking tokio v1.48.0 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Checking yoke v0.8.1 [INFO] [stderr] Checking zerovec v0.11.5 [INFO] [stderr] Checking zerotrie v0.2.3 [INFO] [stderr] Checking sct v0.7.1 [INFO] [stderr] Checking rustls-webpki v0.101.7 [INFO] [stderr] Checking rustls-webpki v0.102.8 [INFO] [stderr] Checking tinystr v0.8.2 [INFO] [stderr] Checking potential_utf v0.1.4 [INFO] [stderr] Checking icu_collections v2.1.1 [INFO] [stderr] Checking icu_locale_core v2.1.1 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking icu_provider v2.1.1 [INFO] [stderr] Checking icu_normalizer v2.1.1 [INFO] [stderr] Checking icu_properties v2.1.2 [INFO] [stderr] Checking tokio-util v0.7.17 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking tokio-rustls v0.24.1 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Checking h2 v0.3.27 [INFO] [stderr] Checking url v2.5.7 [INFO] [stderr] Checking tungstenite v0.21.0 [INFO] [stderr] Checking hyper v0.14.32 [INFO] [stderr] Checking hyper-rustls v0.24.2 [INFO] [stderr] Checking reqwest v0.11.27 [INFO] [stderr] Checking rust_test v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/exchanges/binance/parser.rs:78:45 [INFO] [stdout] | [INFO] [stdout] 78 | let key = fnv1a64(sym.as_bytes()) ^ 0x4445_5054_48u64; // 'DEPTH' [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider: `0x0044_4550_5448_u64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] = note: `#[warn(clippy::unusual_byte_groupings)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/exchanges/binance/parsed.rs:202:45 [INFO] [stdout] | [INFO] [stdout] 202 | let key = fnv1a64(sym.as_bytes()) ^ 0x4445_5054_48u64; // 'DEPTH' [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider: `0x0044_4550_5448_u64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/exchanges/binance/parser.rs:78:45 [INFO] [stdout] | [INFO] [stdout] 78 | let key = fnv1a64(sym.as_bytes()) ^ 0x4445_5054_48u64; // 'DEPTH' [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider: `0x0044_4550_5448_u64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] = note: `#[warn(clippy::unusual_byte_groupings)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits of hex, binary or octal literal not in groups of equal size [INFO] [stdout] --> src/exchanges/binance/parsed.rs:202:45 [INFO] [stdout] | [INFO] [stdout] 202 | let key = fnv1a64(sym.as_bytes()) ^ 0x4445_5054_48u64; // 'DEPTH' [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider: `0x0044_4550_5448_u64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/base_classes/bbo_store.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | / pub fn update>( [INFO] [stdout] 60 | | &mut self, [INFO] [stdout] 61 | | symbol: S, [INFO] [stdout] 62 | | bid_px: f64, [INFO] [stdout] ... | [INFO] [stdout] 67 | | system_ts_ns: Option, [INFO] [stdout] 68 | | ) { [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 `map_or` can be simplified [INFO] [stdout] --> src/base_classes/bbo_store.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | self.get(symbol).map_or(false, BboEntry::is_ready) [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] 102 - self.get(symbol).map_or(false, BboEntry::is_ready) [INFO] [stdout] 102 + self.get(symbol).is_some_and(BboEntry::is_ready) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/binance.rs:103:17 [INFO] [stdout] | [INFO] [stdout] 103 | / if let Some((_feed, _)) = binance::events_for_book(text, &mut self.book) { [INFO] [stdout] 104 | | if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 105 | | let ob_ts = self.book.last_ts(); [INFO] [stdout] 106 | | match feed_gate.evaluate(ExchangeFeed::Binance, FeedKind::OrderBook, ob_ts) [INFO] [stdout] ... | [INFO] [stdout] 138 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 103 ~ if let Some((_feed, _)) = binance::events_for_book(text, &mut self.book) [INFO] [stdout] 104 ~ && let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 105 | let ob_ts = self.book.last_ts(); [INFO] [stdout] ... [INFO] [stdout] 136 | } [INFO] [stdout] 137 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/binance.rs:139:17 [INFO] [stdout] | [INFO] [stdout] 139 | / if binance::update_bbo_store(text, &mut self.bbo) { [INFO] [stdout] 140 | | if let Some(mid) = self [INFO] [stdout] 141 | | .bbo [INFO] [stdout] 142 | | .mid_price_f64_for(&self.symbol) [INFO] [stdout] ... | [INFO] [stdout] 209 | | } [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] 139 ~ if binance::update_bbo_store(text, &mut self.bbo) [INFO] [stdout] 140 ~ && let Some(mid) = self [INFO] [stdout] 141 | .bbo [INFO] [stdout] ... [INFO] [stdout] 207 | } [INFO] [stdout] 208 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/bitget.rs:70:21 [INFO] [stdout] | [INFO] [stdout] 70 | / if feed == "orderbook" { [INFO] [stdout] 71 | | if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 72 | | let ob_ts = self.book.last_ts(); [INFO] [stdout] 73 | | match feed_gate.evaluate( [INFO] [stdout] ... | [INFO] [stdout] 109 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 70 ~ if feed == "orderbook" [INFO] [stdout] 71 ~ && let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 72 | let ob_ts = self.book.last_ts(); [INFO] [stdout] ... [INFO] [stdout] 107 | } [INFO] [stdout] 108 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/bitget.rs:111:17 [INFO] [stdout] | [INFO] [stdout] 111 | / if bitget::update_bbo_store(text, &mut self.bbo) { [INFO] [stdout] 112 | | if let Some(mid) = self [INFO] [stdout] 113 | | .bbo [INFO] [stdout] 114 | | .mid_price_f64_for(&self.symbol) [INFO] [stdout] ... | [INFO] [stdout] 167 | | } [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] 111 ~ if bitget::update_bbo_store(text, &mut self.bbo) [INFO] [stdout] 112 ~ && let Some(mid) = self [INFO] [stdout] 113 | .bbo [INFO] [stdout] ... [INFO] [stdout] 165 | } [INFO] [stdout] 166 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/base_classes/engine/bybit.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | / frame [INFO] [stdout] 45 | | .topic() [INFO] [stdout] 46 | | .map_or(false, |topic| topic.starts_with("orderbook.1.")) [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] 46 - .map_or(false, |topic| topic.starts_with("orderbook.1.")) [INFO] [stdout] 46 + .is_some_and(|topic| topic.starts_with("orderbook.1.")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/config.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | / if FEED_OVERRIDES.set(feeds).is_err() { [INFO] [stdout] 11 | | if let Some(existing) = FEED_OVERRIDES.get().copied() { [INFO] [stdout] 12 | | if existing != feeds { [INFO] [stdout] 13 | | eprintln!( [INFO] [stdout] ... | [INFO] [stdout] 19 | | } [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] 10 ~ if FEED_OVERRIDES.set(feeds).is_err() [INFO] [stdout] 11 ~ && let Some(existing) = FEED_OVERRIDES.get().copied() { [INFO] [stdout] 12 | if existing != feeds { [INFO] [stdout] ... [INFO] [stdout] 17 | } [INFO] [stdout] 18 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/config.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | / if let Some(existing) = FEED_OVERRIDES.get().copied() { [INFO] [stdout] 12 | | if existing != feeds { [INFO] [stdout] 13 | | eprintln!( [INFO] [stdout] 14 | | "feed overrides already configured; keeping existing value {:?}", [INFO] [stdout] ... | [INFO] [stdout] 18 | | } [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] 11 ~ if let Some(existing) = FEED_OVERRIDES.get().copied() [INFO] [stdout] 12 ~ && existing != feeds { [INFO] [stdout] 13 | eprintln!( [INFO] [stdout] ... [INFO] [stdout] 16 | ); [INFO] [stdout] 17 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/config.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | / if DEMEAN_ENABLED.set(enabled).is_err() { [INFO] [stdout] 29 | | if let Some(existing) = DEMEAN_ENABLED.get().copied() { [INFO] [stdout] 30 | | if existing != enabled { [INFO] [stdout] 31 | | eprintln!( [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [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] 28 ~ if DEMEAN_ENABLED.set(enabled).is_err() [INFO] [stdout] 29 ~ && let Some(existing) = DEMEAN_ENABLED.get().copied() { [INFO] [stdout] 30 | if existing != enabled { [INFO] [stdout] ... [INFO] [stdout] 35 | } [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/config.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | / if let Some(existing) = DEMEAN_ENABLED.get().copied() { [INFO] [stdout] 30 | | if existing != enabled { [INFO] [stdout] 31 | | eprintln!( [INFO] [stdout] 32 | | "demean toggle already configured; keeping existing value {}", [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] 29 ~ if let Some(existing) = DEMEAN_ENABLED.get().copied() [INFO] [stdout] 30 ~ && existing != enabled { [INFO] [stdout] 31 | eprintln!( [INFO] [stdout] ... [INFO] [stdout] 34 | ); [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/gate.rs:90:21 [INFO] [stdout] | [INFO] [stdout] 90 | / if feed == "orderbook" { [INFO] [stdout] 91 | | if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 92 | | let ob_ts = self.book.last_ts(); [INFO] [stdout] 93 | | match feed_gate.evaluate(ExchangeFeed::Gate, FeedKind::OrderBook, ob_ts) [INFO] [stdout] ... | [INFO] [stdout] 139 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 90 ~ if feed == "orderbook" [INFO] [stdout] 91 ~ && let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 92 | let ob_ts = self.book.last_ts(); [INFO] [stdout] ... [INFO] [stdout] 137 | } [INFO] [stdout] 138 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/gate.rs:141:17 [INFO] [stdout] | [INFO] [stdout] 141 | / if gate::update_bbo_store(text, &mut self.bbo, self.qty_multiplier) { [INFO] [stdout] 142 | | if let Some(mid) = self [INFO] [stdout] 143 | | .bbo [INFO] [stdout] 144 | | .mid_price_f64_for(&self.symbol) [INFO] [stdout] ... | [INFO] [stdout] 207 | | } [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] 141 ~ if gate::update_bbo_store(text, &mut self.bbo, self.qty_multiplier) [INFO] [stdout] 142 ~ && let Some(mid) = self [INFO] [stdout] 143 | .bbo [INFO] [stdout] ... [INFO] [stdout] 205 | } [INFO] [stdout] 206 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used consecutive `str::replace` call [INFO] [stdout] --> src/base_classes/engine/helpers.rs:49:26 [INFO] [stdout] | [INFO] [stdout] 49 | let replaced = upper.replace('/', "-").replace('_', "-"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['/', '_'], "-")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace [INFO] [stdout] = note: `#[warn(clippy::collapsible_str_replace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/base_classes/engine/helpers.rs:74:22 [INFO] [stdout] | [INFO] [stdout] 74 | if count <= 3 || count % 100 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace with: `count.is_multiple_of(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/lighter.rs:57:21 [INFO] [stdout] | [INFO] [stdout] 57 | / if feed == "orderbook" { [INFO] [stdout] 58 | | if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 59 | | let ob_ts = self.book.last_ts(); [INFO] [stdout] 60 | | let gate_ts = ob_ts.max(ts); [INFO] [stdout] ... | [INFO] [stdout] 110 | | } [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] 57 ~ if feed == "orderbook" [INFO] [stdout] 58 ~ && let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 59 | let ob_ts = self.book.last_ts(); [INFO] [stdout] ... [INFO] [stdout] 108 | } [INFO] [stdout] 109 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/mexc.rs:72:21 [INFO] [stdout] | [INFO] [stdout] 72 | / if feed == "orderbook" { [INFO] [stdout] 73 | | if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 74 | | let ob_ts = self.book.last_ts(); [INFO] [stdout] 75 | | match feed_gate.evaluate(ExchangeFeed::Mexc, FeedKind::OrderBook, ob_ts) [INFO] [stdout] ... | [INFO] [stdout] 111 | | } [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] 72 ~ if feed == "orderbook" [INFO] [stdout] 73 ~ && let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 74 | let ob_ts = self.book.last_ts(); [INFO] [stdout] ... [INFO] [stdout] 109 | } [INFO] [stdout] 110 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/base_classes/engine/okx.rs:77:25 [INFO] [stdout] | [INFO] [stdout] 77 | / match feed { [INFO] [stdout] 78 | | "orderbook" => { [INFO] [stdout] 79 | | if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 80 | | let ob_ts = self.book.last_ts(); [INFO] [stdout] ... | [INFO] [stdout] 122 | | _ => {} [INFO] [stdout] 123 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 77 ~ if feed == "orderbook" { [INFO] [stdout] 78 + if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 79 + let ob_ts = self.book.last_ts(); [INFO] [stdout] 80 + match feed_gate.evaluate( [INFO] [stdout] 81 + ExchangeFeed::Okx, [INFO] [stdout] 82 + FeedKind::OrderBook, [INFO] [stdout] 83 + ob_ts, [INFO] [stdout] 84 + ) { [INFO] [stdout] 85 + GateDecision::Accept => { [INFO] [stdout] 86 + let (bid_vec, ask_vec) = [INFO] [stdout] 87 + self.book.top_levels_f64(SNAPSHOT_DEPTH); [INFO] [stdout] 88 + let bid_levels = levels_to_array(&bid_vec); [INFO] [stdout] 89 + let ask_levels = levels_to_array(&ask_vec); [INFO] [stdout] 90 + { [INFO] [stdout] 91 + let mut st = lock_state(); [INFO] [stdout] 92 + let snap = &mut st.okx.orderbook; [INFO] [stdout] 93 + snap.price = Some(mid); [INFO] [stdout] 94 + snap.seq = snap.seq.wrapping_add(1); [INFO] [stdout] 95 + snap.ts_ns = Some(ts); [INFO] [stdout] 96 + snap.source_engine_ts_ns = Some(ob_ts); [INFO] [stdout] 97 + snap.source_system_ts_ns = [INFO] [stdout] 98 + self.book.last_system_ts_ns(); [INFO] [stdout] 99 + snap.bid_levels = bid_levels; [INFO] [stdout] 100 + snap.ask_levels = ask_levels; [INFO] [stdout] 101 + snap.direction = None; [INFO] [stdout] 102 + snap.received_at = Some(f.recv_instant); [INFO] [stdout] 103 + } [INFO] [stdout] 104 + publisher.publish(); [INFO] [stdout] 105 + } [INFO] [stdout] 106 + GateDecision::Reject { [INFO] [stdout] 107 + last_ts, [INFO] [stdout] 108 + reject_count, [INFO] [stdout] 109 + } => { [INFO] [stdout] 110 + log_stale_update( [INFO] [stdout] 111 + ExchangeFeed::Okx, [INFO] [stdout] 112 + FeedKind::OrderBook, [INFO] [stdout] 113 + ob_ts, [INFO] [stdout] 114 + last_ts, [INFO] [stdout] 115 + reject_count, [INFO] [stdout] 116 + ); [INFO] [stdout] 117 + } [INFO] [stdout] 118 + } [INFO] [stdout] 119 + } [INFO] [stdout] 120 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/okx.rs:126:17 [INFO] [stdout] | [INFO] [stdout] 126 | / if channel == OkxWs::BBO_TBT [INFO] [stdout] 127 | | && okx::update_bbo_store(&mut f, &mut self.bbo, self.qty_multiplier) [INFO] [stdout] 128 | | { [INFO] [stdout] 129 | | if let Some(mid) = self [INFO] [stdout] ... | [INFO] [stdout] 184 | | } [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] 127 ~ && okx::update_bbo_store(&mut f, &mut self.bbo, self.qty_multiplier) [INFO] [stdout] 128 ~ && let Some(mid) = self [INFO] [stdout] 129 | .bbo [INFO] [stdout] ... [INFO] [stdout] 181 | } [INFO] [stdout] 182 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/okx.rs:243:17 [INFO] [stdout] | [INFO] [stdout] 243 | / if channel == OkxWs::TICKERS { [INFO] [stdout] 244 | | if let Some((_, ticker)) = [INFO] [stdout] 245 | | okx::update_tickers(&mut f, &mut self.tickers, self.qty_multiplier) [INFO] [stdout] ... | [INFO] [stdout] 313 | | } [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] 243 ~ if channel == OkxWs::TICKERS [INFO] [stdout] 244 ~ && let Some((_, ticker)) = [INFO] [stdout] 245 | okx::update_tickers(&mut f, &mut self.tickers, self.qty_multiplier) [INFO] [stdout] ... [INFO] [stdout] 311 | } [INFO] [stdout] 312 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/mod.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | / if let Some(tx) = self.tx.as_ref() { [INFO] [stdout] 66 | | if price.is_finite() && price > 0.0 { [INFO] [stdout] 67 | | let _ = tx.send(ReferenceEvent { [INFO] [stdout] 68 | | price, [INFO] [stdout] ... | [INFO] [stdout] 76 | | } [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] 65 ~ if let Some(tx) = self.tx.as_ref() [INFO] [stdout] 66 ~ && price.is_finite() && price > 0.0 { [INFO] [stdout] 67 | let _ = tx.send(ReferenceEvent { [INFO] [stdout] ... [INFO] [stdout] 74 | }); [INFO] [stdout] 75 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/base_classes/engine/mod.rs:274:12 [INFO] [stdout] | [INFO] [stdout] 274 | ): ( [INFO] [stdout] | ____________^ [INFO] [stdout] 275 | | Option, [INFO] [stdout] 276 | | bool, [INFO] [stdout] 277 | | bool, [INFO] [stdout] ... | [INFO] [stdout] 280 | | Option, [INFO] [stdout] 281 | | ) = rt.block_on(async { [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 `impl` can be derived [INFO] [stdout] --> src/base_classes/feed_config.rs:23:1 [INFO] [stdout] | [INFO] [stdout] 23 | / impl Default for FeedToggle { [INFO] [stdout] 24 | | fn default() -> Self { [INFO] [stdout] 25 | | FeedToggle::Auto [INFO] [stdout] 26 | | } [INFO] [stdout] 27 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 5 + #[derive(Default)] [INFO] [stdout] 6 | pub enum FeedToggle { [INFO] [stdout] 7 | On, [INFO] [stdout] 8 | Off, [INFO] [stdout] 9 ~ #[default] [INFO] [stdout] 10 ~ Auto, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/base_classes/order_book.rs:318:9 [INFO] [stdout] | [INFO] [stdout] 318 | tmp_b.sort_unstable_by(|a, b| b.px.cmp(&a.px)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 318 - tmp_b.sort_unstable_by(|a, b| b.px.cmp(&a.px)); [INFO] [stdout] 318 + tmp_b.sort_unstable_by_key(|b| std::cmp::Reverse(b.px)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/base_classes/order_book.rs:333:9 [INFO] [stdout] | [INFO] [stdout] 333 | tmp_a.sort_unstable_by(|a, b| a.px.cmp(&b.px)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 333 - tmp_a.sort_unstable_by(|a, b| a.px.cmp(&b.px)); [INFO] [stdout] 333 + tmp_a.sort_unstable_by_key(|a| a.px); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/base_classes/bbo_store.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | / pub fn update>( [INFO] [stdout] 60 | | &mut self, [INFO] [stdout] 61 | | symbol: S, [INFO] [stdout] 62 | | bid_px: f64, [INFO] [stdout] ... | [INFO] [stdout] 67 | | system_ts_ns: Option, [INFO] [stdout] 68 | | ) { [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 `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/order_book.rs:343:9 [INFO] [stdout] | [INFO] [stdout] 343 | / if let (Some(b), Some(a)) = (self.best_bid(), self.best_ask()) { [INFO] [stdout] 344 | | if b.px >= a.px { [INFO] [stdout] 345 | | self.trim_asks_at_or_below(b.px); [INFO] [stdout] 346 | | self.trim_bids_at_or_above(a.px); [INFO] [stdout] 347 | | } [INFO] [stdout] 348 | | } [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] 343 ~ if let (Some(b), Some(a)) = (self.best_bid(), self.best_ask()) [INFO] [stdout] 344 ~ && b.px >= a.px { [INFO] [stdout] 345 | self.trim_asks_at_or_below(b.px); [INFO] [stdout] 346 | self.trim_bids_at_or_above(a.px); [INFO] [stdout] 347 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/base_classes/bbo_store.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | self.get(symbol).map_or(false, BboEntry::is_ready) [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] 102 - self.get(symbol).map_or(false, BboEntry::is_ready) [INFO] [stdout] 102 + self.get(symbol).is_some_and(BboEntry::is_ready) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/base_classes/orderbook_trait.rs:9:47 [INFO] [stdout] | [INFO] [stdout] 9 | fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/binance.rs:103:17 [INFO] [stdout] | [INFO] [stdout] 103 | / if let Some((_feed, _)) = binance::events_for_book(text, &mut self.book) { [INFO] [stdout] 104 | | if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 105 | | let ob_ts = self.book.last_ts(); [INFO] [stdout] 106 | | match feed_gate.evaluate(ExchangeFeed::Binance, FeedKind::OrderBook, ob_ts) [INFO] [stdout] ... | [INFO] [stdout] 138 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 103 ~ if let Some((_feed, _)) = binance::events_for_book(text, &mut self.book) [INFO] [stdout] 104 ~ && let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 105 | let ob_ts = self.book.last_ts(); [INFO] [stdout] ... [INFO] [stdout] 136 | } [INFO] [stdout] 137 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/binance.rs:139:17 [INFO] [stdout] | [INFO] [stdout] 139 | / if binance::update_bbo_store(text, &mut self.bbo) { [INFO] [stdout] 140 | | if let Some(mid) = self [INFO] [stdout] 141 | | .bbo [INFO] [stdout] 142 | | .mid_price_f64_for(&self.symbol) [INFO] [stdout] ... | [INFO] [stdout] 209 | | } [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] 139 ~ if binance::update_bbo_store(text, &mut self.bbo) [INFO] [stdout] 140 ~ && let Some(mid) = self [INFO] [stdout] 141 | .bbo [INFO] [stdout] ... [INFO] [stdout] 207 | } [INFO] [stdout] 208 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Producer` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/base_classes/ring_buffer.rs:99:5 [INFO] [stdout] | [INFO] [stdout] 99 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/base_classes/ring_buffer.rs:109:5 [INFO] [stdout] | [INFO] [stdout] 109 | pub fn try_pop(&self) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Consumer` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/base_classes/ring_buffer.rs:137:5 [INFO] [stdout] | [INFO] [stdout] 137 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/bitget.rs:70:21 [INFO] [stdout] | [INFO] [stdout] 70 | / if feed == "orderbook" { [INFO] [stdout] 71 | | if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 72 | | let ob_ts = self.book.last_ts(); [INFO] [stdout] 73 | | match feed_gate.evaluate( [INFO] [stdout] ... | [INFO] [stdout] 109 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 70 ~ if feed == "orderbook" [INFO] [stdout] 71 ~ && let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 72 | let ob_ts = self.book.last_ts(); [INFO] [stdout] ... [INFO] [stdout] 107 | } [INFO] [stdout] 108 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/bitget.rs:111:17 [INFO] [stdout] | [INFO] [stdout] 111 | / if bitget::update_bbo_store(text, &mut self.bbo) { [INFO] [stdout] 112 | | if let Some(mid) = self [INFO] [stdout] 113 | | .bbo [INFO] [stdout] 114 | | .mid_price_f64_for(&self.symbol) [INFO] [stdout] ... | [INFO] [stdout] 167 | | } [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] 111 ~ if bitget::update_bbo_store(text, &mut self.bbo) [INFO] [stdout] 112 ~ && let Some(mid) = self [INFO] [stdout] 113 | .bbo [INFO] [stdout] ... [INFO] [stdout] 165 | } [INFO] [stdout] 166 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/base_classes/engine/bybit.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | / frame [INFO] [stdout] 45 | | .topic() [INFO] [stdout] 46 | | .map_or(false, |topic| topic.starts_with("orderbook.1.")) [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] 46 - .map_or(false, |topic| topic.starts_with("orderbook.1.")) [INFO] [stdout] 46 + .is_some_and(|topic| topic.starts_with("orderbook.1.")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/config.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | / if FEED_OVERRIDES.set(feeds).is_err() { [INFO] [stdout] 11 | | if let Some(existing) = FEED_OVERRIDES.get().copied() { [INFO] [stdout] 12 | | if existing != feeds { [INFO] [stdout] 13 | | eprintln!( [INFO] [stdout] ... | [INFO] [stdout] 19 | | } [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] 10 ~ if FEED_OVERRIDES.set(feeds).is_err() [INFO] [stdout] 11 ~ && let Some(existing) = FEED_OVERRIDES.get().copied() { [INFO] [stdout] 12 | if existing != feeds { [INFO] [stdout] ... [INFO] [stdout] 17 | } [INFO] [stdout] 18 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/config.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | / if let Some(existing) = FEED_OVERRIDES.get().copied() { [INFO] [stdout] 12 | | if existing != feeds { [INFO] [stdout] 13 | | eprintln!( [INFO] [stdout] 14 | | "feed overrides already configured; keeping existing value {:?}", [INFO] [stdout] ... | [INFO] [stdout] 18 | | } [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] 11 ~ if let Some(existing) = FEED_OVERRIDES.get().copied() [INFO] [stdout] 12 ~ && existing != feeds { [INFO] [stdout] 13 | eprintln!( [INFO] [stdout] ... [INFO] [stdout] 16 | ); [INFO] [stdout] 17 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/config.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | / if DEMEAN_ENABLED.set(enabled).is_err() { [INFO] [stdout] 29 | | if let Some(existing) = DEMEAN_ENABLED.get().copied() { [INFO] [stdout] 30 | | if existing != enabled { [INFO] [stdout] 31 | | eprintln!( [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [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] 28 ~ if DEMEAN_ENABLED.set(enabled).is_err() [INFO] [stdout] 29 ~ && let Some(existing) = DEMEAN_ENABLED.get().copied() { [INFO] [stdout] 30 | if existing != enabled { [INFO] [stdout] ... [INFO] [stdout] 35 | } [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/config.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | / if let Some(existing) = DEMEAN_ENABLED.get().copied() { [INFO] [stdout] 30 | | if existing != enabled { [INFO] [stdout] 31 | | eprintln!( [INFO] [stdout] 32 | | "demean toggle already configured; keeping existing value {}", [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] 29 ~ if let Some(existing) = DEMEAN_ENABLED.get().copied() [INFO] [stdout] 30 ~ && existing != enabled { [INFO] [stdout] 31 | eprintln!( [INFO] [stdout] ... [INFO] [stdout] 34 | ); [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/gate.rs:90:21 [INFO] [stdout] | [INFO] [stdout] 90 | / if feed == "orderbook" { [INFO] [stdout] 91 | | if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 92 | | let ob_ts = self.book.last_ts(); [INFO] [stdout] 93 | | match feed_gate.evaluate(ExchangeFeed::Gate, FeedKind::OrderBook, ob_ts) [INFO] [stdout] ... | [INFO] [stdout] 139 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 90 ~ if feed == "orderbook" [INFO] [stdout] 91 ~ && let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 92 | let ob_ts = self.book.last_ts(); [INFO] [stdout] ... [INFO] [stdout] 137 | } [INFO] [stdout] 138 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/gate.rs:141:17 [INFO] [stdout] | [INFO] [stdout] 141 | / if gate::update_bbo_store(text, &mut self.bbo, self.qty_multiplier) { [INFO] [stdout] 142 | | if let Some(mid) = self [INFO] [stdout] 143 | | .bbo [INFO] [stdout] 144 | | .mid_price_f64_for(&self.symbol) [INFO] [stdout] ... | [INFO] [stdout] 207 | | } [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] 141 ~ if gate::update_bbo_store(text, &mut self.bbo, self.qty_multiplier) [INFO] [stdout] 142 ~ && let Some(mid) = self [INFO] [stdout] 143 | .bbo [INFO] [stdout] ... [INFO] [stdout] 205 | } [INFO] [stdout] 206 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/base_classes/ws.rs:164:17 [INFO] [stdout] | [INFO] [stdout] 164 | return; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 163 - run_ws_tungstenite(handler, producer, producer_signal); [INFO] [stdout] 164 - return; [INFO] [stdout] 163 + run_ws_tungstenite(handler, producer, producer_signal); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant guard [INFO] [stdout] --> src/base_classes/ws.rs:212:25 [INFO] [stdout] | [INFO] [stdout] 212 | Some(ev) if ev == "ping" => {} [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards [INFO] [stdout] = note: `#[warn(clippy::redundant_guards)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 212 - Some(ev) if ev == "ping" => {} [INFO] [stdout] 212 + Some("ping") => {} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/ws.rs:449:20 [INFO] [stdout] | [INFO] [stdout] 449 | } else if let Some(hb) = &static_app_hb { [INFO] [stdout] | ____________________^ [INFO] [stdout] 450 | | if last_app_hb.elapsed() >= Duration::from_secs(hb.interval_secs) { [INFO] [stdout] 451 | | let ok = match &hb.payload { [INFO] [stdout] 452 | | HeartbeatPayload::Text(s) => send_tungstenite_message( [INFO] [stdout] ... | [INFO] [stdout] 473 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 449 ~ } else if let Some(hb) = &static_app_hb [INFO] [stdout] 450 ~ && last_app_hb.elapsed() >= Duration::from_secs(hb.interval_secs) { [INFO] [stdout] 451 | let ok = match &hb.payload { [INFO] [stdout] ... [INFO] [stdout] 471 | last_app_hb = Instant::now(); [INFO] [stdout] 472 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/base_classes/ws.rs:522:29 [INFO] [stdout] | [INFO] [stdout] 522 | / ... if !send_tungstenite_message( [INFO] [stdout] 523 | | ... &mut socket, [INFO] [stdout] 524 | | ... Message::Pong(p), [INFO] [stdout] 525 | | ... &label, [INFO] [stdout] ... | [INFO] [stdout] 531 | | ... break; [INFO] [stdout] 532 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 521 ~ Message::Ping(p) [INFO] [stdout] 522 | if !send_tungstenite_message( [INFO] [stdout] ... [INFO] [stdout] 526 | "pong reply", [INFO] [stdout] 527 ~ ) => { [INFO] [stdout] 528 | std::thread::sleep(backoff); [INFO] [stdout] ... [INFO] [stdout] 531 | break; [INFO] [stdout] 532 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/ws.rs:494:29 [INFO] [stdout] | [INFO] [stdout] 494 | / ... if let Some((k, s)) = handler.sequence_key_text(&txt) { [INFO] [stdout] 495 | | ... if !seq_gate.accept(k, s) { [INFO] [stdout] 496 | | ... continue; [INFO] [stdout] 497 | | ... } [INFO] [stdout] 498 | | ... } [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] 494 ~ if let Some((k, s)) = handler.sequence_key_text(&txt) [INFO] [stdout] 495 ~ && !seq_gate.accept(k, s) { [INFO] [stdout] 496 | continue; [INFO] [stdout] 497 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/ws.rs:508:29 [INFO] [stdout] | [INFO] [stdout] 508 | / ... if let Some((k, s)) = handler.sequence_key_binary(&bin) { [INFO] [stdout] 509 | | ... if !seq_gate.accept(k, s) { [INFO] [stdout] 510 | | ... continue; [INFO] [stdout] 511 | | ... } [INFO] [stdout] 512 | | ... } [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] 508 ~ if let Some((k, s)) = handler.sequence_key_binary(&bin) [INFO] [stdout] 509 ~ && !seq_gate.accept(k, s) { [INFO] [stdout] 510 | continue; [INFO] [stdout] 511 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/collectors/binance.rs:73:18 [INFO] [stdout] | [INFO] [stdout] 73 | fn event_payload<'a>(root: &'a Value) -> &'a Value { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 73 - fn event_payload<'a>(root: &'a Value) -> &'a Value { [INFO] [stdout] 73 + fn event_payload(root: &Value) -> &Value { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used consecutive `str::replace` call [INFO] [stdout] --> src/base_classes/engine/helpers.rs:49:26 [INFO] [stdout] | [INFO] [stdout] 49 | let replaced = upper.replace('/', "-").replace('_', "-"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['/', '_'], "-")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace [INFO] [stdout] = note: `#[warn(clippy::collapsible_str_replace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/base_classes/engine/helpers.rs:74:22 [INFO] [stdout] | [INFO] [stdout] 74 | if count <= 3 || count % 100 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace with: `count.is_multiple_of(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/lighter.rs:57:21 [INFO] [stdout] | [INFO] [stdout] 57 | / if feed == "orderbook" { [INFO] [stdout] 58 | | if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 59 | | let ob_ts = self.book.last_ts(); [INFO] [stdout] 60 | | let gate_ts = ob_ts.max(ts); [INFO] [stdout] ... | [INFO] [stdout] 110 | | } [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] 57 ~ if feed == "orderbook" [INFO] [stdout] 58 ~ && let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 59 | let ob_ts = self.book.last_ts(); [INFO] [stdout] ... [INFO] [stdout] 108 | } [INFO] [stdout] 109 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/binance.rs:229:13 [INFO] [stdout] | [INFO] [stdout] 229 | / if book.apply_depth_update(&evt) { [INFO] [stdout] 230 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 231 | | return Some(("orderbook", mid)); [INFO] [stdout] 232 | | } [INFO] [stdout] 233 | | } [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] 229 ~ if book.apply_depth_update(&evt) [INFO] [stdout] 230 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 231 | return Some(("orderbook", mid)); [INFO] [stdout] 232 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bitget.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | / if book.apply_bbo(&msg) { [INFO] [stdout] 33 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 34 | | out.push(("orderbook", mid)); [INFO] [stdout] 35 | | } [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] 32 ~ if book.apply_bbo(&msg) [INFO] [stdout] 33 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 34 | out.push(("orderbook", mid)); [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bitget.rs:45:25 [INFO] [stdout] | [INFO] [stdout] 45 | / if book.apply(&msg) { [INFO] [stdout] 46 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 47 | | out.push(("orderbook", mid)); [INFO] [stdout] 48 | | } [INFO] [stdout] 49 | | } [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] 45 ~ if book.apply(&msg) [INFO] [stdout] 46 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 47 | out.push(("orderbook", mid)); [INFO] [stdout] 48 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bitget.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | / if let Some(entry) = value.get(*key) { [INFO] [stdout] 119 | | if let Some(v) = as_f64(entry) { [INFO] [stdout] 120 | | return Some(v); [INFO] [stdout] 121 | | } [INFO] [stdout] 122 | | } [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] 118 ~ if let Some(entry) = value.get(*key) [INFO] [stdout] 119 ~ && let Some(v) = as_f64(entry) { [INFO] [stdout] 120 | return Some(v); [INFO] [stdout] 121 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/mexc.rs:72:21 [INFO] [stdout] | [INFO] [stdout] 72 | / if feed == "orderbook" { [INFO] [stdout] 73 | | if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 74 | | let ob_ts = self.book.last_ts(); [INFO] [stdout] 75 | | match feed_gate.evaluate(ExchangeFeed::Mexc, FeedKind::OrderBook, ob_ts) [INFO] [stdout] ... | [INFO] [stdout] 111 | | } [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] 72 ~ if feed == "orderbook" [INFO] [stdout] 73 ~ && let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 74 | let ob_ts = self.book.last_ts(); [INFO] [stdout] ... [INFO] [stdout] 109 | } [INFO] [stdout] 110 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bitget.rs:129:9 [INFO] [stdout] | [INFO] [stdout] 129 | / if let Some(entry) = value.get(*key) { [INFO] [stdout] 130 | | if let Some(v) = as_u64(entry) { [INFO] [stdout] 131 | | return Some(v); [INFO] [stdout] 132 | | } [INFO] [stdout] 133 | | } [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 Some(entry) = value.get(*key) [INFO] [stdout] 130 ~ && let Some(v) = as_u64(entry) { [INFO] [stdout] 131 | return Some(v); [INFO] [stdout] 132 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bitget.rs:163:5 [INFO] [stdout] | [INFO] [stdout] 163 | / if let Some(action) = raw.get("action").and_then(|v| v.as_str()) { [INFO] [stdout] 164 | | if action != "snapshot" && action != "update" { [INFO] [stdout] 165 | | return None; [INFO] [stdout] 166 | | } [INFO] [stdout] 167 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 163 ~ if let Some(action) = raw.get("action").and_then(|v| v.as_str()) [INFO] [stdout] 164 ~ && action != "snapshot" && action != "update" { [INFO] [stdout] 165 | return None; [INFO] [stdout] 166 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bitget.rs:405:9 [INFO] [stdout] | [INFO] [stdout] 405 | / if let Some(action) = raw.get("action").and_then(|v| v.as_str()) { [INFO] [stdout] 406 | | if action != "snapshot" && action != "update" { [INFO] [stdout] 407 | | return false; [INFO] [stdout] 408 | | } [INFO] [stdout] 409 | | } [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] 405 ~ if let Some(action) = raw.get("action").and_then(|v| v.as_str()) [INFO] [stdout] 406 ~ && action != "snapshot" && action != "update" { [INFO] [stdout] 407 | return false; [INFO] [stdout] 408 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/base_classes/engine/okx.rs:77:25 [INFO] [stdout] | [INFO] [stdout] 77 | / match feed { [INFO] [stdout] 78 | | "orderbook" => { [INFO] [stdout] 79 | | if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 80 | | let ob_ts = self.book.last_ts(); [INFO] [stdout] ... | [INFO] [stdout] 122 | | _ => {} [INFO] [stdout] 123 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 77 ~ if feed == "orderbook" { [INFO] [stdout] 78 + if let Some(mid) = self.book.mid_price_f64() { [INFO] [stdout] 79 + let ob_ts = self.book.last_ts(); [INFO] [stdout] 80 + match feed_gate.evaluate( [INFO] [stdout] 81 + ExchangeFeed::Okx, [INFO] [stdout] 82 + FeedKind::OrderBook, [INFO] [stdout] 83 + ob_ts, [INFO] [stdout] 84 + ) { [INFO] [stdout] 85 + GateDecision::Accept => { [INFO] [stdout] 86 + let (bid_vec, ask_vec) = [INFO] [stdout] 87 + self.book.top_levels_f64(SNAPSHOT_DEPTH); [INFO] [stdout] 88 + let bid_levels = levels_to_array(&bid_vec); [INFO] [stdout] 89 + let ask_levels = levels_to_array(&ask_vec); [INFO] [stdout] 90 + { [INFO] [stdout] 91 + let mut st = lock_state(); [INFO] [stdout] 92 + let snap = &mut st.okx.orderbook; [INFO] [stdout] 93 + snap.price = Some(mid); [INFO] [stdout] 94 + snap.seq = snap.seq.wrapping_add(1); [INFO] [stdout] 95 + snap.ts_ns = Some(ts); [INFO] [stdout] 96 + snap.source_engine_ts_ns = Some(ob_ts); [INFO] [stdout] 97 + snap.source_system_ts_ns = [INFO] [stdout] 98 + self.book.last_system_ts_ns(); [INFO] [stdout] 99 + snap.bid_levels = bid_levels; [INFO] [stdout] 100 + snap.ask_levels = ask_levels; [INFO] [stdout] 101 + snap.direction = None; [INFO] [stdout] 102 + snap.received_at = Some(f.recv_instant); [INFO] [stdout] 103 + } [INFO] [stdout] 104 + publisher.publish(); [INFO] [stdout] 105 + } [INFO] [stdout] 106 + GateDecision::Reject { [INFO] [stdout] 107 + last_ts, [INFO] [stdout] 108 + reject_count, [INFO] [stdout] 109 + } => { [INFO] [stdout] 110 + log_stale_update( [INFO] [stdout] 111 + ExchangeFeed::Okx, [INFO] [stdout] 112 + FeedKind::OrderBook, [INFO] [stdout] 113 + ob_ts, [INFO] [stdout] 114 + last_ts, [INFO] [stdout] 115 + reject_count, [INFO] [stdout] 116 + ); [INFO] [stdout] 117 + } [INFO] [stdout] 118 + } [INFO] [stdout] 119 + } [INFO] [stdout] 120 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/okx.rs:126:17 [INFO] [stdout] | [INFO] [stdout] 126 | / if channel == OkxWs::BBO_TBT [INFO] [stdout] 127 | | && okx::update_bbo_store(&mut f, &mut self.bbo, self.qty_multiplier) [INFO] [stdout] 128 | | { [INFO] [stdout] 129 | | if let Some(mid) = self [INFO] [stdout] ... | [INFO] [stdout] 184 | | } [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] 127 ~ && okx::update_bbo_store(&mut f, &mut self.bbo, self.qty_multiplier) [INFO] [stdout] 128 ~ && let Some(mid) = self [INFO] [stdout] 129 | .bbo [INFO] [stdout] ... [INFO] [stdout] 181 | } [INFO] [stdout] 182 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bybit.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | / if let Some(topic) = find_json_string(s, "topic") { [INFO] [stdout] 16 | | if topic.starts_with("orderbook.") { [INFO] [stdout] 17 | | match serde_json::from_str::(s) { [INFO] [stdout] 18 | | Ok(msg) => { [INFO] [stdout] ... | [INFO] [stdout] 130 | | } [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] 15 ~ if let Some(topic) = find_json_string(s, "topic") [INFO] [stdout] 16 ~ && topic.starts_with("orderbook.") { [INFO] [stdout] 17 | match serde_json::from_str::(s) { [INFO] [stdout] ... [INFO] [stdout] 128 | } [INFO] [stdout] 129 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `v.get(0)` [INFO] [stdout] --> src/collectors/bybit.rs:24:54 [INFO] [stdout] | [INFO] [stdout] 24 | ... BybitDataCont::Arr(v) => v.get(0).cloned(), [INFO] [stdout] | ^^^^^^^^ help: try: `v.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/okx.rs:243:17 [INFO] [stdout] | [INFO] [stdout] 243 | / if channel == OkxWs::TICKERS { [INFO] [stdout] 244 | | if let Some((_, ticker)) = [INFO] [stdout] 245 | | okx::update_tickers(&mut f, &mut self.tickers, self.qty_multiplier) [INFO] [stdout] ... | [INFO] [stdout] 313 | | } [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] 243 ~ if channel == OkxWs::TICKERS [INFO] [stdout] 244 ~ && let Some((_, ticker)) = [INFO] [stdout] 245 | okx::update_tickers(&mut f, &mut self.tickers, self.qty_multiplier) [INFO] [stdout] ... [INFO] [stdout] 311 | } [INFO] [stdout] 312 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bybit.rs:26:25 [INFO] [stdout] | [INFO] [stdout] 26 | / if let Some(d) = dopt { [INFO] [stdout] 27 | | if let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] 28 | | let bid = match b[0].parse::() { [INFO] [stdout] 29 | | Ok(v) if v.is_finite() => v, [INFO] [stdout] ... | [INFO] [stdout] 115 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 26 ~ if let Some(d) = dopt [INFO] [stdout] 27 ~ && let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] 28 | let bid = match b[0].parse::() { [INFO] [stdout] ... [INFO] [stdout] 113 | } [INFO] [stdout] 114 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `d.b.get(0)` [INFO] [stdout] --> src/collectors/bybit.rs:27:58 [INFO] [stdout] | [INFO] [stdout] 27 | ... if let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `d.b.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `d.a.get(0)` [INFO] [stdout] --> src/collectors/bybit.rs:27:70 [INFO] [stdout] | [INFO] [stdout] 27 | ... if let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `d.a.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bybit.rs:101:33 [INFO] [stdout] | [INFO] [stdout] 101 | / ... if book.apply_bbo( [INFO] [stdout] 102 | | ... bid, [INFO] [stdout] 103 | | ... bid_qty, [INFO] [stdout] 104 | | ... ask, [INFO] [stdout] ... | [INFO] [stdout] 113 | | ... } [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] 109 ~ ) [INFO] [stdout] 110 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 111 | out.push(("bbo", mid)); [INFO] [stdout] 112 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bybit.rs:118:25 [INFO] [stdout] | [INFO] [stdout] 118 | / if book.apply(&msg) { [INFO] [stdout] 119 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 120 | | out.push(("orderbook", mid)); [INFO] [stdout] 121 | | } [INFO] [stdout] 122 | | } [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] 118 ~ if book.apply(&msg) [INFO] [stdout] 119 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 120 | out.push(("orderbook", mid)); [INFO] [stdout] 121 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/engine/mod.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | / if let Some(tx) = self.tx.as_ref() { [INFO] [stdout] 66 | | if price.is_finite() && price > 0.0 { [INFO] [stdout] 67 | | let _ = tx.send(ReferenceEvent { [INFO] [stdout] 68 | | price, [INFO] [stdout] ... | [INFO] [stdout] 76 | | } [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] 65 ~ if let Some(tx) = self.tx.as_ref() [INFO] [stdout] 66 ~ && price.is_finite() && price > 0.0 { [INFO] [stdout] 67 | let _ = tx.send(ReferenceEvent { [INFO] [stdout] ... [INFO] [stdout] 74 | }); [INFO] [stdout] 75 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bybit.rs:136:5 [INFO] [stdout] | [INFO] [stdout] 136 | / if let Some(topic) = find_json_string(s, "topic") { [INFO] [stdout] 137 | | if topic.starts_with("orderbook.1.") { [INFO] [stdout] 138 | | match serde_json::from_str::(s) { [INFO] [stdout] 139 | | Ok(msg) => { [INFO] [stdout] ... | [INFO] [stdout] 239 | | } [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] 136 ~ if let Some(topic) = find_json_string(s, "topic") [INFO] [stdout] 137 ~ && topic.starts_with("orderbook.1.") { [INFO] [stdout] 138 | match serde_json::from_str::(s) { [INFO] [stdout] ... [INFO] [stdout] 237 | } [INFO] [stdout] 238 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `v.get(0)` [INFO] [stdout] --> src/collectors/bybit.rs:142:50 [INFO] [stdout] | [INFO] [stdout] 142 | BybitDataCont::Arr(v) => v.get(0).cloned(), [INFO] [stdout] | ^^^^^^^^ help: try: `v.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bybit.rs:144:21 [INFO] [stdout] | [INFO] [stdout] 144 | / if let Some(d) = dopt { [INFO] [stdout] 145 | | if let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] 146 | | let bid = match b[0].parse::() { [INFO] [stdout] 147 | | Ok(v) if v.is_finite() => v, [INFO] [stdout] ... | [INFO] [stdout] 232 | | } [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] 144 ~ if let Some(d) = dopt [INFO] [stdout] 145 ~ && let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] 146 | let bid = match b[0].parse::() { [INFO] [stdout] ... [INFO] [stdout] 230 | } [INFO] [stdout] 231 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `d.b.get(0)` [INFO] [stdout] --> src/collectors/bybit.rs:145:54 [INFO] [stdout] | [INFO] [stdout] 145 | if let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `d.b.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `d.a.get(0)` [INFO] [stdout] --> src/collectors/bybit.rs:145:66 [INFO] [stdout] | [INFO] [stdout] 145 | if let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `d.a.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/base_classes/engine/mod.rs:274:12 [INFO] [stdout] | [INFO] [stdout] 274 | ): ( [INFO] [stdout] | ____________^ [INFO] [stdout] 275 | | Option, [INFO] [stdout] 276 | | bool, [INFO] [stdout] 277 | | bool, [INFO] [stdout] ... | [INFO] [stdout] 280 | | Option, [INFO] [stdout] 281 | | ) = rt.block_on(async { [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/collectors/gate.rs:24:21 [INFO] [stdout] | [INFO] [stdout] 24 | / if book.apply(&msg) { [INFO] [stdout] 25 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 26 | | out.push(("orderbook", mid)); [INFO] [stdout] 27 | | } [INFO] [stdout] 28 | | } [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] 24 ~ if book.apply(&msg) [INFO] [stdout] 25 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 26 | out.push(("orderbook", mid)); [INFO] [stdout] 27 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/collectors/gate.rs:109:17 [INFO] [stdout] | [INFO] [stdout] 109 | fn value_to_f64<'a>(value: &'a Value, keys: &[&str]) -> Option { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 109 - fn value_to_f64<'a>(value: &'a Value, keys: &[&str]) -> Option { [INFO] [stdout] 109 + fn value_to_f64(value: &Value, keys: &[&str]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/gate.rs:111:9 [INFO] [stdout] | [INFO] [stdout] 111 | / if let Some(v) = value.get(*key) { [INFO] [stdout] 112 | | if let Some(num) = as_f64(v) { [INFO] [stdout] 113 | | return Some(num); [INFO] [stdout] 114 | | } [INFO] [stdout] 115 | | } [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] 111 ~ if let Some(v) = value.get(*key) [INFO] [stdout] 112 ~ && let Some(num) = as_f64(v) { [INFO] [stdout] 113 | return Some(num); [INFO] [stdout] 114 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/collectors/gate.rs:120:17 [INFO] [stdout] | [INFO] [stdout] 120 | fn value_to_u64<'a>(value: &'a Value, keys: &[&str]) -> Option { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 120 - fn value_to_u64<'a>(value: &'a Value, keys: &[&str]) -> Option { [INFO] [stdout] 120 + fn value_to_u64(value: &Value, keys: &[&str]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/gate.rs:122:9 [INFO] [stdout] | [INFO] [stdout] 122 | / if let Some(v) = value.get(*key) { [INFO] [stdout] 123 | | if let Some(num) = as_u64(v) { [INFO] [stdout] 124 | | return Some(num); [INFO] [stdout] 125 | | } [INFO] [stdout] 126 | | } [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] 122 ~ if let Some(v) = value.get(*key) [INFO] [stdout] 123 ~ && let Some(num) = as_u64(v) { [INFO] [stdout] 124 | return Some(num); [INFO] [stdout] 125 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/gate.rs:146:5 [INFO] [stdout] | [INFO] [stdout] 146 | / if let Some(event) = event_name(&raw) { [INFO] [stdout] 147 | | if event != "update" { [INFO] [stdout] 148 | | return None; [INFO] [stdout] 149 | | } [INFO] [stdout] 150 | | } [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] 146 ~ if let Some(event) = event_name(&raw) [INFO] [stdout] 147 ~ && event != "update" { [INFO] [stdout] 148 | return None; [INFO] [stdout] 149 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/gate.rs:449:9 [INFO] [stdout] | [INFO] [stdout] 449 | / if let Some(event) = event_name(&raw) { [INFO] [stdout] 450 | | if event != "update" { [INFO] [stdout] 451 | | return false; [INFO] [stdout] 452 | | } [INFO] [stdout] 453 | | } [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] 449 ~ if let Some(event) = event_name(&raw) [INFO] [stdout] 450 ~ && event != "update" { [INFO] [stdout] 451 | return false; [INFO] [stdout] 452 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/base_classes/feed_config.rs:23:1 [INFO] [stdout] | [INFO] [stdout] 23 | / impl Default for FeedToggle { [INFO] [stdout] 24 | | fn default() -> Self { [INFO] [stdout] 25 | | FeedToggle::Auto [INFO] [stdout] 26 | | } [INFO] [stdout] 27 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 5 + #[derive(Default)] [INFO] [stdout] 6 | pub enum FeedToggle { [INFO] [stdout] 7 | On, [INFO] [stdout] 8 | Off, [INFO] [stdout] 9 ~ #[default] [INFO] [stdout] 10 ~ Auto, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/gate.rs:548:9 [INFO] [stdout] | [INFO] [stdout] 548 | / if let Some(event) = event_name(&raw) { [INFO] [stdout] 549 | | if event != "update" { [INFO] [stdout] 550 | | return 0; [INFO] [stdout] 551 | | } [INFO] [stdout] 552 | | } [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] 548 ~ if let Some(event) = event_name(&raw) [INFO] [stdout] 549 ~ && event != "update" { [INFO] [stdout] 550 | return 0; [INFO] [stdout] 551 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/helpers.rs:24:21 [INFO] [stdout] | [INFO] [stdout] 24 | / if let Some(end) = rest2.find('\"') { [INFO] [stdout] 25 | | if let Ok(v) = rest2[..end].parse::() { [INFO] [stdout] 26 | | return Some(v); [INFO] [stdout] 27 | | } [INFO] [stdout] 28 | | } [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] 24 ~ if let Some(end) = rest2.find('\"') [INFO] [stdout] 25 ~ && let Ok(v) = rest2[..end].parse::() { [INFO] [stdout] 26 | return Some(v); [INFO] [stdout] 27 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/lighter.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | / if book.apply(msg) { [INFO] [stdout] 59 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 60 | | out.push(("orderbook", mid)); [INFO] [stdout] 61 | | } [INFO] [stdout] 62 | | } [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 book.apply(msg) [INFO] [stdout] 59 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 60 | out.push(("orderbook", mid)); [INFO] [stdout] 61 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/mexc.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / if matches!(frame.channel(), Some("push.depth")) { [INFO] [stdout] 19 | | if let Some(msg) = frame.depth_msg() { [INFO] [stdout] 20 | | if book.apply(msg) { [INFO] [stdout] 21 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] ... | [INFO] [stdout] 26 | | } [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] 18 ~ if matches!(frame.channel(), Some("push.depth")) [INFO] [stdout] 19 ~ && let Some(msg) = frame.depth_msg() { [INFO] [stdout] 20 | if book.apply(msg) { [INFO] [stdout] ... [INFO] [stdout] 24 | } [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/mexc.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | / if let Some(msg) = frame.depth_msg() { [INFO] [stdout] 20 | | if book.apply(msg) { [INFO] [stdout] 21 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 22 | | out.push(("orderbook", mid)); [INFO] [stdout] ... | [INFO] [stdout] 25 | | } [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 Some(msg) = frame.depth_msg() [INFO] [stdout] 20 ~ && book.apply(msg) { [INFO] [stdout] 21 | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 22 | out.push(("orderbook", mid)); [INFO] [stdout] 23 | } [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/mexc.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | / if book.apply(msg) { [INFO] [stdout] 21 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 22 | | out.push(("orderbook", mid)); [INFO] [stdout] 23 | | } [INFO] [stdout] 24 | | } [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] 20 ~ if book.apply(msg) [INFO] [stdout] 21 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 22 | out.push(("orderbook", mid)); [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/base_classes/order_book.rs:318:9 [INFO] [stdout] | [INFO] [stdout] 318 | tmp_b.sort_unstable_by(|a, b| b.px.cmp(&a.px)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 318 - tmp_b.sort_unstable_by(|a, b| b.px.cmp(&a.px)); [INFO] [stdout] 318 + tmp_b.sort_unstable_by_key(|b| std::cmp::Reverse(b.px)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/okx.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | / if let Some(msg) = frame.orderbook_msg() { [INFO] [stdout] 18 | | if book.apply(msg) { [INFO] [stdout] 19 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 20 | | out.push(("orderbook", mid)); [INFO] [stdout] ... | [INFO] [stdout] 23 | | } [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] 17 ~ if let Some(msg) = frame.orderbook_msg() [INFO] [stdout] 18 ~ && book.apply(msg) { [INFO] [stdout] 19 | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 20 | out.push(("orderbook", mid)); [INFO] [stdout] 21 | } [INFO] [stdout] 22 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/okx.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | / if book.apply(msg) { [INFO] [stdout] 19 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 20 | | out.push(("orderbook", mid)); [INFO] [stdout] 21 | | } [INFO] [stdout] 22 | | } [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] 18 ~ if book.apply(msg) [INFO] [stdout] 19 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 20 | out.push(("orderbook", mid)); [INFO] [stdout] 21 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/okx.rs:26:13 [INFO] [stdout] | [INFO] [stdout] 26 | / if let Some(msg) = frame.orderbook_msg() { [INFO] [stdout] 27 | | if book.apply_bbo(msg) { [INFO] [stdout] 28 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 29 | | out.push(("orderbook", mid)); [INFO] [stdout] ... | [INFO] [stdout] 32 | | } [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(msg) = frame.orderbook_msg() [INFO] [stdout] 27 ~ && book.apply_bbo(msg) { [INFO] [stdout] 28 | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 29 | out.push(("orderbook", mid)); [INFO] [stdout] 30 | } [INFO] [stdout] 31 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/okx.rs:27:17 [INFO] [stdout] | [INFO] [stdout] 27 | / if book.apply_bbo(msg) { [INFO] [stdout] 28 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 29 | | out.push(("orderbook", mid)); [INFO] [stdout] 30 | | } [INFO] [stdout] 31 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 27 ~ if book.apply_bbo(msg) [INFO] [stdout] 28 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 29 | out.push(("orderbook", mid)); [INFO] [stdout] 30 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/base_classes/order_book.rs:333:9 [INFO] [stdout] | [INFO] [stdout] 333 | tmp_a.sort_unstable_by(|a, b| a.px.cmp(&b.px)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 333 - tmp_a.sort_unstable_by(|a, b| a.px.cmp(&b.px)); [INFO] [stdout] 333 + tmp_a.sort_unstable_by_key(|a| a.px); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/order_book.rs:343:9 [INFO] [stdout] | [INFO] [stdout] 343 | / if let (Some(b), Some(a)) = (self.best_bid(), self.best_ask()) { [INFO] [stdout] 344 | | if b.px >= a.px { [INFO] [stdout] 345 | | self.trim_asks_at_or_below(b.px); [INFO] [stdout] 346 | | self.trim_bids_at_or_above(a.px); [INFO] [stdout] 347 | | } [INFO] [stdout] 348 | | } [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] 343 ~ if let (Some(b), Some(a)) = (self.best_bid(), self.best_ask()) [INFO] [stdout] 344 ~ && b.px >= a.px { [INFO] [stdout] 345 | self.trim_asks_at_or_below(b.px); [INFO] [stdout] 346 | self.trim_bids_at_or_above(a.px); [INFO] [stdout] 347 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/base_classes/orderbook_trait.rs:9:47 [INFO] [stdout] | [INFO] [stdout] 9 | fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>); [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: redundant closure [INFO] [stdout] --> src/collectors/okx.rs:178:19 [INFO] [stdout] | [INFO] [stdout] 178 | .and_then(|lvl| level_to_pair(lvl)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `level_to_pair` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/okx.rs:183:19 [INFO] [stdout] | [INFO] [stdout] 183 | .and_then(|lvl| level_to_pair(lvl)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `level_to_pair` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/okx.rs:196:19 [INFO] [stdout] | [INFO] [stdout] 196 | .and_then(|v| value_to_u64_raw(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `value_to_u64_raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/okx.rs:351:9 [INFO] [stdout] | [INFO] [stdout] 351 | / if let Some(entry) = value.get(*key) { [INFO] [stdout] 352 | | if let Some(v) = value_to_f64_raw(entry) { [INFO] [stdout] 353 | | return Some(v); [INFO] [stdout] 354 | | } [INFO] [stdout] 355 | | } [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] 351 ~ if let Some(entry) = value.get(*key) [INFO] [stdout] 352 ~ && let Some(v) = value_to_f64_raw(entry) { [INFO] [stdout] 353 | return Some(v); [INFO] [stdout] 354 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/okx.rs:393:9 [INFO] [stdout] | [INFO] [stdout] 393 | / if let Some(entry) = value.get(*key) { [INFO] [stdout] 394 | | if let Some(v) = value_to_u64_raw(entry) { [INFO] [stdout] 395 | | return Some(v); [INFO] [stdout] 396 | | } [INFO] [stdout] 397 | | } [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] 393 ~ if let Some(entry) = value.get(*key) [INFO] [stdout] 394 ~ && let Some(v) = value_to_u64_raw(entry) { [INFO] [stdout] 395 | return Some(v); [INFO] [stdout] 396 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `arr.get(0)` [INFO] [stdout] --> src/collectors/okx.rs:424:18 [INFO] [stdout] | [INFO] [stdout] 424 | let px_str = arr.get(0)?.as_str()?; [INFO] [stdout] | ^^^^^^^^^^ help: try: `arr.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/binance/orderbook.rs:105:51 [INFO] [stdout] | [INFO] [stdout] 105 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/binance/orderbook.rs:259:9 [INFO] [stdout] | [INFO] [stdout] 259 | / if let Some(last) = self.last_resync { [INFO] [stdout] 260 | | if now.duration_since(last) < Self::RESYNC_COOLDOWN { [INFO] [stdout] 261 | | return; // throttle resync attempts [INFO] [stdout] 262 | | } [INFO] [stdout] 263 | | } [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] 259 ~ if let Some(last) = self.last_resync [INFO] [stdout] 260 ~ && now.duration_since(last) < Self::RESYNC_COOLDOWN { [INFO] [stdout] 261 | return; // throttle resync attempts [INFO] [stdout] 262 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/binance/parser.rs:213:13 [INFO] [stdout] | [INFO] [stdout] 213 | / if let Some(i) = s.find("\"e\"") { [INFO] [stdout] 214 | | if let Some(j) = s[i..].find(':') { [INFO] [stdout] 215 | | let rest = &s[i + j + 1..]; [INFO] [stdout] 216 | | if let Some(start) = rest.find('"') { [INFO] [stdout] ... | [INFO] [stdout] 223 | | } [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 Some(i) = s.find("\"e\"") [INFO] [stdout] 214 ~ && let Some(j) = s[i..].find(':') { [INFO] [stdout] 215 | let rest = &s[i + j + 1..]; [INFO] [stdout] ... [INFO] [stdout] 221 | } [INFO] [stdout] 222 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Producer` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/base_classes/ring_buffer.rs:99:5 [INFO] [stdout] | [INFO] [stdout] 99 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/base_classes/ring_buffer.rs:109:5 [INFO] [stdout] | [INFO] [stdout] 109 | pub fn try_pop(&self) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Consumer` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/base_classes/ring_buffer.rs:137:5 [INFO] [stdout] | [INFO] [stdout] 137 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/base_classes/ws.rs:164:17 [INFO] [stdout] | [INFO] [stdout] 164 | return; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 163 - run_ws_tungstenite(handler, producer, producer_signal); [INFO] [stdout] 164 - return; [INFO] [stdout] 163 + run_ws_tungstenite(handler, producer, producer_signal); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant guard [INFO] [stdout] --> src/base_classes/ws.rs:212:25 [INFO] [stdout] | [INFO] [stdout] 212 | Some(ev) if ev == "ping" => {} [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards [INFO] [stdout] = note: `#[warn(clippy::redundant_guards)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 212 - Some(ev) if ev == "ping" => {} [INFO] [stdout] 212 + Some("ping") => {} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/ws.rs:449:20 [INFO] [stdout] | [INFO] [stdout] 449 | } else if let Some(hb) = &static_app_hb { [INFO] [stdout] | ____________________^ [INFO] [stdout] 450 | | if last_app_hb.elapsed() >= Duration::from_secs(hb.interval_secs) { [INFO] [stdout] 451 | | let ok = match &hb.payload { [INFO] [stdout] 452 | | HeartbeatPayload::Text(s) => send_tungstenite_message( [INFO] [stdout] ... | [INFO] [stdout] 473 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 449 ~ } else if let Some(hb) = &static_app_hb [INFO] [stdout] 450 ~ && last_app_hb.elapsed() >= Duration::from_secs(hb.interval_secs) { [INFO] [stdout] 451 | let ok = match &hb.payload { [INFO] [stdout] ... [INFO] [stdout] 471 | last_app_hb = Instant::now(); [INFO] [stdout] 472 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/base_classes/ws.rs:522:29 [INFO] [stdout] | [INFO] [stdout] 522 | / ... if !send_tungstenite_message( [INFO] [stdout] 523 | | ... &mut socket, [INFO] [stdout] 524 | | ... Message::Pong(p), [INFO] [stdout] 525 | | ... &label, [INFO] [stdout] ... | [INFO] [stdout] 531 | | ... break; [INFO] [stdout] 532 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 521 ~ Message::Ping(p) [INFO] [stdout] 522 | if !send_tungstenite_message( [INFO] [stdout] ... [INFO] [stdout] 526 | "pong reply", [INFO] [stdout] 527 ~ ) => { [INFO] [stdout] 528 | std::thread::sleep(backoff); [INFO] [stdout] ... [INFO] [stdout] 531 | break; [INFO] [stdout] 532 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/ws.rs:494:29 [INFO] [stdout] | [INFO] [stdout] 494 | / ... if let Some((k, s)) = handler.sequence_key_text(&txt) { [INFO] [stdout] 495 | | ... if !seq_gate.accept(k, s) { [INFO] [stdout] 496 | | ... continue; [INFO] [stdout] 497 | | ... } [INFO] [stdout] 498 | | ... } [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] 494 ~ if let Some((k, s)) = handler.sequence_key_text(&txt) [INFO] [stdout] 495 ~ && !seq_gate.accept(k, s) { [INFO] [stdout] 496 | continue; [INFO] [stdout] 497 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/base_classes/ws.rs:508:29 [INFO] [stdout] | [INFO] [stdout] 508 | / ... if let Some((k, s)) = handler.sequence_key_binary(&bin) { [INFO] [stdout] 509 | | ... if !seq_gate.accept(k, s) { [INFO] [stdout] 510 | | ... continue; [INFO] [stdout] 511 | | ... } [INFO] [stdout] 512 | | ... } [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] 508 ~ if let Some((k, s)) = handler.sequence_key_binary(&bin) [INFO] [stdout] 509 ~ && !seq_gate.accept(k, s) { [INFO] [stdout] 510 | continue; [INFO] [stdout] 511 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/binance/parsed.rs:130:9 [INFO] [stdout] | [INFO] [stdout] 130 | / if let Ok(v) = serde_json::from_slice::(bytes) { [INFO] [stdout] 131 | | if v.get("result").is_some() { [INFO] [stdout] 132 | | return Some(BinanceEvent::Ack); [INFO] [stdout] 133 | | } [INFO] [stdout] 134 | | } [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] 130 ~ if let Ok(v) = serde_json::from_slice::(bytes) [INFO] [stdout] 131 ~ && v.get("result").is_some() { [INFO] [stdout] 132 | return Some(BinanceEvent::Ack); [INFO] [stdout] 133 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/binance/parsed.rs:136:9 [INFO] [stdout] | [INFO] [stdout] 136 | / if let Ok(tag) = serde_json::from_slice::(bytes) { [INFO] [stdout] 137 | | if let Some(e) = tag.e.as_deref() { [INFO] [stdout] 138 | | match e { [INFO] [stdout] 139 | | "bookTicker" => { [INFO] [stdout] ... | [INFO] [stdout] 163 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 136 ~ if let Ok(tag) = serde_json::from_slice::(bytes) [INFO] [stdout] 137 ~ && let Some(e) = tag.e.as_deref() { [INFO] [stdout] 138 | match e { [INFO] [stdout] ... [INFO] [stdout] 161 | return Some(BinanceEvent::Other(bytes.to_vec())); [INFO] [stdout] 162 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/collectors/binance.rs:73:18 [INFO] [stdout] | [INFO] [stdout] 73 | fn event_payload<'a>(root: &'a Value) -> &'a Value { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 73 - fn event_payload<'a>(root: &'a Value) -> &'a Value { [INFO] [stdout] 73 + fn event_payload(root: &Value) -> &Value { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/binance.rs:229:13 [INFO] [stdout] | [INFO] [stdout] 229 | / if book.apply_depth_update(&evt) { [INFO] [stdout] 230 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 231 | | return Some(("orderbook", mid)); [INFO] [stdout] 232 | | } [INFO] [stdout] 233 | | } [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] 229 ~ if book.apply_depth_update(&evt) [INFO] [stdout] 230 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 231 | return Some(("orderbook", mid)); [INFO] [stdout] 232 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/collectors/bitget.rs:252:1 [INFO] [stdout] | [INFO] [stdout] 252 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 386 | pub fn update_bbo_store(s: &str, store: &mut BboStore) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 498 | pub fn update_trades(s: &str, trades: &mut FixedTrades) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = note: `#[warn(clippy::items_after_test_module)]` on by default [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bitget.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | / if book.apply_bbo(&msg) { [INFO] [stdout] 33 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 34 | | out.push(("orderbook", mid)); [INFO] [stdout] 35 | | } [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] 32 ~ if book.apply_bbo(&msg) [INFO] [stdout] 33 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 34 | out.push(("orderbook", mid)); [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bitget.rs:45:25 [INFO] [stdout] | [INFO] [stdout] 45 | / if book.apply(&msg) { [INFO] [stdout] 46 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 47 | | out.push(("orderbook", mid)); [INFO] [stdout] 48 | | } [INFO] [stdout] 49 | | } [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] 45 ~ if book.apply(&msg) [INFO] [stdout] 46 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 47 | out.push(("orderbook", mid)); [INFO] [stdout] 48 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bitget.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | / if let Some(entry) = value.get(*key) { [INFO] [stdout] 119 | | if let Some(v) = as_f64(entry) { [INFO] [stdout] 120 | | return Some(v); [INFO] [stdout] 121 | | } [INFO] [stdout] 122 | | } [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] 118 ~ if let Some(entry) = value.get(*key) [INFO] [stdout] 119 ~ && let Some(v) = as_f64(entry) { [INFO] [stdout] 120 | return Some(v); [INFO] [stdout] 121 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bitget.rs:129:9 [INFO] [stdout] | [INFO] [stdout] 129 | / if let Some(entry) = value.get(*key) { [INFO] [stdout] 130 | | if let Some(v) = as_u64(entry) { [INFO] [stdout] 131 | | return Some(v); [INFO] [stdout] 132 | | } [INFO] [stdout] 133 | | } [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 Some(entry) = value.get(*key) [INFO] [stdout] 130 ~ && let Some(v) = as_u64(entry) { [INFO] [stdout] 131 | return Some(v); [INFO] [stdout] 132 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bitget.rs:163:5 [INFO] [stdout] | [INFO] [stdout] 163 | / if let Some(action) = raw.get("action").and_then(|v| v.as_str()) { [INFO] [stdout] 164 | | if action != "snapshot" && action != "update" { [INFO] [stdout] 165 | | return None; [INFO] [stdout] 166 | | } [INFO] [stdout] 167 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 163 ~ if let Some(action) = raw.get("action").and_then(|v| v.as_str()) [INFO] [stdout] 164 ~ && action != "snapshot" && action != "update" { [INFO] [stdout] 165 | return None; [INFO] [stdout] 166 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `entry.get(0)` [INFO] [stdout] --> src/exchanges/bitget/orderbook.rs:110:30 [INFO] [stdout] | [INFO] [stdout] 110 | let px_str = entry.get(0)?; [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `entry.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/bitget/orderbook.rs:199:13 [INFO] [stdout] | [INFO] [stdout] 199 | / if let Some(prev) = prev_seq { [INFO] [stdout] 200 | | if prev != self.last_seq { [INFO] [stdout] 201 | | return false; [INFO] [stdout] 202 | | } [INFO] [stdout] 203 | | } [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] 199 ~ if let Some(prev) = prev_seq [INFO] [stdout] 200 ~ && prev != self.last_seq { [INFO] [stdout] 201 | return false; [INFO] [stdout] 202 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/bitget/orderbook.rs:236:9 [INFO] [stdout] | [INFO] [stdout] 236 | / if let Some(prev) = Self::extract_prev_seq(d) { [INFO] [stdout] 237 | | if prev != self.last_seq { [INFO] [stdout] 238 | | return false; [INFO] [stdout] 239 | | } [INFO] [stdout] 240 | | } [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] 236 ~ if let Some(prev) = Self::extract_prev_seq(d) [INFO] [stdout] 237 ~ && prev != self.last_seq { [INFO] [stdout] 238 | return false; [INFO] [stdout] 239 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `lvl.get(0)` [INFO] [stdout] --> src/exchanges/bitget/orderbook.rs:255:26 [INFO] [stdout] | [INFO] [stdout] 255 | let px_str = lvl.get(0)?; [INFO] [stdout] | ^^^^^^^^^^ help: try: `lvl.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `lvl.get(0)` [INFO] [stdout] --> src/exchanges/bitget/orderbook.rs:292:26 [INFO] [stdout] | [INFO] [stdout] 292 | let px_str = lvl.get(0)?; [INFO] [stdout] | ^^^^^^^^^^ help: try: `lvl.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/bitget/orderbook.rs:384:51 [INFO] [stdout] | [INFO] [stdout] 384 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bitget.rs:405:9 [INFO] [stdout] | [INFO] [stdout] 405 | / if let Some(action) = raw.get("action").and_then(|v| v.as_str()) { [INFO] [stdout] 406 | | if action != "snapshot" && action != "update" { [INFO] [stdout] 407 | | return false; [INFO] [stdout] 408 | | } [INFO] [stdout] 409 | | } [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] 405 ~ if let Some(action) = raw.get("action").and_then(|v| v.as_str()) [INFO] [stdout] 406 ~ && action != "snapshot" && action != "update" { [INFO] [stdout] 407 | return false; [INFO] [stdout] 408 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bybit.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | / if let Some(topic) = find_json_string(s, "topic") { [INFO] [stdout] 16 | | if topic.starts_with("orderbook.") { [INFO] [stdout] 17 | | match serde_json::from_str::(s) { [INFO] [stdout] 18 | | Ok(msg) => { [INFO] [stdout] ... | [INFO] [stdout] 130 | | } [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] 15 ~ if let Some(topic) = find_json_string(s, "topic") [INFO] [stdout] 16 ~ && topic.starts_with("orderbook.") { [INFO] [stdout] 17 | match serde_json::from_str::(s) { [INFO] [stdout] ... [INFO] [stdout] 128 | } [INFO] [stdout] 129 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `v.get(0)` [INFO] [stdout] --> src/collectors/bybit.rs:24:54 [INFO] [stdout] | [INFO] [stdout] 24 | ... BybitDataCont::Arr(v) => v.get(0).cloned(), [INFO] [stdout] | ^^^^^^^^ help: try: `v.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bybit.rs:26:25 [INFO] [stdout] | [INFO] [stdout] 26 | / if let Some(d) = dopt { [INFO] [stdout] 27 | | if let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] 28 | | let bid = match b[0].parse::() { [INFO] [stdout] 29 | | Ok(v) if v.is_finite() => v, [INFO] [stdout] ... | [INFO] [stdout] 115 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 26 ~ if let Some(d) = dopt [INFO] [stdout] 27 ~ && let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] 28 | let bid = match b[0].parse::() { [INFO] [stdout] ... [INFO] [stdout] 113 | } [INFO] [stdout] 114 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `d.b.get(0)` [INFO] [stdout] --> src/collectors/bybit.rs:27:58 [INFO] [stdout] | [INFO] [stdout] 27 | ... if let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `d.b.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `d.a.get(0)` [INFO] [stdout] --> src/collectors/bybit.rs:27:70 [INFO] [stdout] | [INFO] [stdout] 27 | ... if let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `d.a.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bybit.rs:101:33 [INFO] [stdout] | [INFO] [stdout] 101 | / ... if book.apply_bbo( [INFO] [stdout] 102 | | ... bid, [INFO] [stdout] 103 | | ... bid_qty, [INFO] [stdout] 104 | | ... ask, [INFO] [stdout] ... | [INFO] [stdout] 113 | | ... } [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] 109 ~ ) [INFO] [stdout] 110 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 111 | out.push(("bbo", mid)); [INFO] [stdout] 112 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bybit.rs:118:25 [INFO] [stdout] | [INFO] [stdout] 118 | / if book.apply(&msg) { [INFO] [stdout] 119 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 120 | | out.push(("orderbook", mid)); [INFO] [stdout] 121 | | } [INFO] [stdout] 122 | | } [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] 118 ~ if book.apply(&msg) [INFO] [stdout] 119 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 120 | out.push(("orderbook", mid)); [INFO] [stdout] 121 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bybit.rs:136:5 [INFO] [stdout] | [INFO] [stdout] 136 | / if let Some(topic) = find_json_string(s, "topic") { [INFO] [stdout] 137 | | if topic.starts_with("orderbook.1.") { [INFO] [stdout] 138 | | match serde_json::from_str::(s) { [INFO] [stdout] 139 | | Ok(msg) => { [INFO] [stdout] ... | [INFO] [stdout] 239 | | } [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] 136 ~ if let Some(topic) = find_json_string(s, "topic") [INFO] [stdout] 137 ~ && topic.starts_with("orderbook.1.") { [INFO] [stdout] 138 | match serde_json::from_str::(s) { [INFO] [stdout] ... [INFO] [stdout] 237 | } [INFO] [stdout] 238 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `v.get(0)` [INFO] [stdout] --> src/collectors/bybit.rs:142:50 [INFO] [stdout] | [INFO] [stdout] 142 | BybitDataCont::Arr(v) => v.get(0).cloned(), [INFO] [stdout] | ^^^^^^^^ help: try: `v.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/bybit.rs:144:21 [INFO] [stdout] | [INFO] [stdout] 144 | / if let Some(d) = dopt { [INFO] [stdout] 145 | | if let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] 146 | | let bid = match b[0].parse::() { [INFO] [stdout] 147 | | Ok(v) if v.is_finite() => v, [INFO] [stdout] ... | [INFO] [stdout] 232 | | } [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] 144 ~ if let Some(d) = dopt [INFO] [stdout] 145 ~ && let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] 146 | let bid = match b[0].parse::() { [INFO] [stdout] ... [INFO] [stdout] 230 | } [INFO] [stdout] 231 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `d.b.get(0)` [INFO] [stdout] --> src/collectors/bybit.rs:145:54 [INFO] [stdout] | [INFO] [stdout] 145 | if let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `d.b.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `d.a.get(0)` [INFO] [stdout] --> src/collectors/bybit.rs:145:66 [INFO] [stdout] | [INFO] [stdout] 145 | if let (Some(b), Some(a)) = (d.b.get(0), d.a.get(0)) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `d.a.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `v.get(0)` [INFO] [stdout] --> src/exchanges/bybit/orderbook.rs:84:44 [INFO] [stdout] | [INFO] [stdout] 84 | BybitDataCont::Arr(v) => match v.get(0) { [INFO] [stdout] | ^^^^^^^^ help: try: `v.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/bybit/orderbook.rs:183:51 [INFO] [stdout] | [INFO] [stdout] 183 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/exchanges/bybit/orderbook.rs:207:5 [INFO] [stdout] | [INFO] [stdout] 207 | / pub fn apply_bbo( [INFO] [stdout] 208 | | &mut self, [INFO] [stdout] 209 | | bid_px: f64, [INFO] [stdout] 210 | | bid_sz: f64, [INFO] [stdout] ... | [INFO] [stdout] 215 | | system_ts_ms: u64, [INFO] [stdout] 216 | | ) -> bool { [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: items after a test module [INFO] [stdout] --> src/collectors/gate.rs:219:1 [INFO] [stdout] | [INFO] [stdout] 219 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 440 | pub fn update_bbo_store(s: &str, store: &mut BboStore, qty_multiplier: f64) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 535 | / pub fn update_trades( [INFO] [stdout] 536 | | s: &str, [INFO] [stdout] 537 | | trades: &mut FixedTrades, [INFO] [stdout] 538 | | qty_multiplier: f64, [INFO] [stdout] 539 | | ) -> usize { [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/gate.rs:24:21 [INFO] [stdout] | [INFO] [stdout] 24 | / if book.apply(&msg) { [INFO] [stdout] 25 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 26 | | out.push(("orderbook", mid)); [INFO] [stdout] 27 | | } [INFO] [stdout] 28 | | } [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] 24 ~ if book.apply(&msg) [INFO] [stdout] 25 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 26 | out.push(("orderbook", mid)); [INFO] [stdout] 27 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/collectors/gate.rs:109:17 [INFO] [stdout] | [INFO] [stdout] 109 | fn value_to_f64<'a>(value: &'a Value, keys: &[&str]) -> Option { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 109 - fn value_to_f64<'a>(value: &'a Value, keys: &[&str]) -> Option { [INFO] [stdout] 109 + fn value_to_f64(value: &Value, keys: &[&str]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/gate.rs:111:9 [INFO] [stdout] | [INFO] [stdout] 111 | / if let Some(v) = value.get(*key) { [INFO] [stdout] 112 | | if let Some(num) = as_f64(v) { [INFO] [stdout] 113 | | return Some(num); [INFO] [stdout] 114 | | } [INFO] [stdout] 115 | | } [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] 111 ~ if let Some(v) = value.get(*key) [INFO] [stdout] 112 ~ && let Some(num) = as_f64(v) { [INFO] [stdout] 113 | return Some(num); [INFO] [stdout] 114 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/collectors/gate.rs:120:17 [INFO] [stdout] | [INFO] [stdout] 120 | fn value_to_u64<'a>(value: &'a Value, keys: &[&str]) -> Option { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 120 - fn value_to_u64<'a>(value: &'a Value, keys: &[&str]) -> Option { [INFO] [stdout] 120 + fn value_to_u64(value: &Value, keys: &[&str]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/gate.rs:122:9 [INFO] [stdout] | [INFO] [stdout] 122 | / if let Some(v) = value.get(*key) { [INFO] [stdout] 123 | | if let Some(num) = as_u64(v) { [INFO] [stdout] 124 | | return Some(num); [INFO] [stdout] 125 | | } [INFO] [stdout] 126 | | } [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] 122 ~ if let Some(v) = value.get(*key) [INFO] [stdout] 123 ~ && let Some(num) = as_u64(v) { [INFO] [stdout] 124 | return Some(num); [INFO] [stdout] 125 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/gate.rs:146:5 [INFO] [stdout] | [INFO] [stdout] 146 | / if let Some(event) = event_name(&raw) { [INFO] [stdout] 147 | | if event != "update" { [INFO] [stdout] 148 | | return None; [INFO] [stdout] 149 | | } [INFO] [stdout] 150 | | } [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] 146 ~ if let Some(event) = event_name(&raw) [INFO] [stdout] 147 ~ && event != "update" { [INFO] [stdout] 148 | return None; [INFO] [stdout] 149 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/bybit/parser.rs:231:9 [INFO] [stdout] | [INFO] [stdout] 231 | / if let Some(i) = s.find("\"topic\"") { [INFO] [stdout] 232 | | if let Some(j) = s[i..].find(':') { [INFO] [stdout] 233 | | let rest = &s[i + j + 1..]; [INFO] [stdout] 234 | | let start = rest.find('"')? + 1; [INFO] [stdout] ... | [INFO] [stdout] 239 | | } [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] 231 ~ if let Some(i) = s.find("\"topic\"") [INFO] [stdout] 232 ~ && let Some(j) = s[i..].find(':') { [INFO] [stdout] 233 | let rest = &s[i + j + 1..]; [INFO] [stdout] ... [INFO] [stdout] 237 | return Some(&rest2[..end]); [INFO] [stdout] 238 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/gate.rs:449:9 [INFO] [stdout] | [INFO] [stdout] 449 | / if let Some(event) = event_name(&raw) { [INFO] [stdout] 450 | | if event != "update" { [INFO] [stdout] 451 | | return false; [INFO] [stdout] 452 | | } [INFO] [stdout] 453 | | } [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] 449 ~ if let Some(event) = event_name(&raw) [INFO] [stdout] 450 ~ && event != "update" { [INFO] [stdout] 451 | return false; [INFO] [stdout] 452 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/gate.rs:548:9 [INFO] [stdout] | [INFO] [stdout] 548 | / if let Some(event) = event_name(&raw) { [INFO] [stdout] 549 | | if event != "update" { [INFO] [stdout] 550 | | return 0; [INFO] [stdout] 551 | | } [INFO] [stdout] 552 | | } [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] 548 ~ if let Some(event) = event_name(&raw) [INFO] [stdout] 549 ~ && event != "update" { [INFO] [stdout] 550 | return 0; [INFO] [stdout] 551 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/helpers.rs:24:21 [INFO] [stdout] | [INFO] [stdout] 24 | / if let Some(end) = rest2.find('\"') { [INFO] [stdout] 25 | | if let Ok(v) = rest2[..end].parse::() { [INFO] [stdout] 26 | | return Some(v); [INFO] [stdout] 27 | | } [INFO] [stdout] 28 | | } [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] 24 ~ if let Some(end) = rest2.find('\"') [INFO] [stdout] 25 ~ && let Ok(v) = rest2[..end].parse::() { [INFO] [stdout] 26 | return Some(v); [INFO] [stdout] 27 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/lighter.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | / if book.apply(msg) { [INFO] [stdout] 59 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 60 | | out.push(("orderbook", mid)); [INFO] [stdout] 61 | | } [INFO] [stdout] 62 | | } [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 book.apply(msg) [INFO] [stdout] 59 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 60 | out.push(("orderbook", mid)); [INFO] [stdout] 61 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/gate/orderbook.rs:66:9 [INFO] [stdout] | [INFO] [stdout] 66 | / if let Some(s) = self.s.as_deref() { [INFO] [stdout] 67 | | if let Some(rest) = s.strip_prefix("ob.") { [INFO] [stdout] 68 | | return Some(rest.split('.').next().unwrap_or(rest)); [INFO] [stdout] 69 | | } [INFO] [stdout] 70 | | } [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] 66 ~ if let Some(s) = self.s.as_deref() [INFO] [stdout] 67 ~ && let Some(rest) = s.strip_prefix("ob.") { [INFO] [stdout] 68 | return Some(rest.split('.').next().unwrap_or(rest)); [INFO] [stdout] 69 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/mexc.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / if matches!(frame.channel(), Some("push.depth")) { [INFO] [stdout] 19 | | if let Some(msg) = frame.depth_msg() { [INFO] [stdout] 20 | | if book.apply(msg) { [INFO] [stdout] 21 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] ... | [INFO] [stdout] 26 | | } [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] 18 ~ if matches!(frame.channel(), Some("push.depth")) [INFO] [stdout] 19 ~ && let Some(msg) = frame.depth_msg() { [INFO] [stdout] 20 | if book.apply(msg) { [INFO] [stdout] ... [INFO] [stdout] 24 | } [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/mexc.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | / if let Some(msg) = frame.depth_msg() { [INFO] [stdout] 20 | | if book.apply(msg) { [INFO] [stdout] 21 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 22 | | out.push(("orderbook", mid)); [INFO] [stdout] ... | [INFO] [stdout] 25 | | } [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 Some(msg) = frame.depth_msg() [INFO] [stdout] 20 ~ && book.apply(msg) { [INFO] [stdout] 21 | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 22 | out.push(("orderbook", mid)); [INFO] [stdout] 23 | } [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/mexc.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | / if book.apply(msg) { [INFO] [stdout] 21 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 22 | | out.push(("orderbook", mid)); [INFO] [stdout] 23 | | } [INFO] [stdout] 24 | | } [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] 20 ~ if book.apply(msg) [INFO] [stdout] 21 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 22 | out.push(("orderbook", mid)); [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/gate/orderbook.rs:200:9 [INFO] [stdout] | [INFO] [stdout] 200 | / if let Some(contract) = res.contract_name() { [INFO] [stdout] 201 | | if !contract.eq_ignore_ascii_case(&self.contract) { [INFO] [stdout] 202 | | return false; [INFO] [stdout] 203 | | } [INFO] [stdout] 204 | | } [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] 200 ~ if let Some(contract) = res.contract_name() [INFO] [stdout] 201 ~ && !contract.eq_ignore_ascii_case(&self.contract) { [INFO] [stdout] 202 | return false; [INFO] [stdout] 203 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/gate/orderbook.rs:329:51 [INFO] [stdout] | [INFO] [stdout] 329 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/okx.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | / if let Some(msg) = frame.orderbook_msg() { [INFO] [stdout] 18 | | if book.apply(msg) { [INFO] [stdout] 19 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 20 | | out.push(("orderbook", mid)); [INFO] [stdout] ... | [INFO] [stdout] 23 | | } [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] 17 ~ if let Some(msg) = frame.orderbook_msg() [INFO] [stdout] 18 ~ && book.apply(msg) { [INFO] [stdout] 19 | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 20 | out.push(("orderbook", mid)); [INFO] [stdout] 21 | } [INFO] [stdout] 22 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/okx.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | / if book.apply(msg) { [INFO] [stdout] 19 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 20 | | out.push(("orderbook", mid)); [INFO] [stdout] 21 | | } [INFO] [stdout] 22 | | } [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] 18 ~ if book.apply(msg) [INFO] [stdout] 19 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 20 | out.push(("orderbook", mid)); [INFO] [stdout] 21 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/okx.rs:26:13 [INFO] [stdout] | [INFO] [stdout] 26 | / if let Some(msg) = frame.orderbook_msg() { [INFO] [stdout] 27 | | if book.apply_bbo(msg) { [INFO] [stdout] 28 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 29 | | out.push(("orderbook", mid)); [INFO] [stdout] ... | [INFO] [stdout] 32 | | } [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(msg) = frame.orderbook_msg() [INFO] [stdout] 27 ~ && book.apply_bbo(msg) { [INFO] [stdout] 28 | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 29 | out.push(("orderbook", mid)); [INFO] [stdout] 30 | } [INFO] [stdout] 31 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/okx.rs:27:17 [INFO] [stdout] | [INFO] [stdout] 27 | / if book.apply_bbo(msg) { [INFO] [stdout] 28 | | if let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 29 | | out.push(("orderbook", mid)); [INFO] [stdout] 30 | | } [INFO] [stdout] 31 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 27 ~ if book.apply_bbo(msg) [INFO] [stdout] 28 ~ && let Some(mid) = book.mid_price_f64() { [INFO] [stdout] 29 | out.push(("orderbook", mid)); [INFO] [stdout] 30 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/gate/parser.rs:273:9 [INFO] [stdout] | [INFO] [stdout] 273 | / if let Ok(s) = core::str::from_utf8(&self.raw) { [INFO] [stdout] 274 | | if let Some(i) = s.find("\"channel\"") { [INFO] [stdout] 275 | | if let Some(j) = s[i..].find(':') { [INFO] [stdout] 276 | | let rest = &s[i + j + 1..]; [INFO] [stdout] ... | [INFO] [stdout] 285 | | } [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 Ok(s) = core::str::from_utf8(&self.raw) [INFO] [stdout] 274 ~ && let Some(i) = s.find("\"channel\"") { [INFO] [stdout] 275 | if let Some(j) = s[i..].find(':') { [INFO] [stdout] ... [INFO] [stdout] 283 | } [INFO] [stdout] 284 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/okx.rs:178:19 [INFO] [stdout] | [INFO] [stdout] 178 | .and_then(|lvl| level_to_pair(lvl)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `level_to_pair` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/okx.rs:183:19 [INFO] [stdout] | [INFO] [stdout] 183 | .and_then(|lvl| level_to_pair(lvl)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `level_to_pair` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/okx.rs:196:19 [INFO] [stdout] | [INFO] [stdout] 196 | .and_then(|v| value_to_u64_raw(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `value_to_u64_raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/gate/parser.rs:274:13 [INFO] [stdout] | [INFO] [stdout] 274 | / if let Some(i) = s.find("\"channel\"") { [INFO] [stdout] 275 | | if let Some(j) = s[i..].find(':') { [INFO] [stdout] 276 | | let rest = &s[i + j + 1..]; [INFO] [stdout] 277 | | if let Some(start) = rest.find('"') { [INFO] [stdout] ... | [INFO] [stdout] 284 | | } [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] 274 ~ if let Some(i) = s.find("\"channel\"") [INFO] [stdout] 275 ~ && let Some(j) = s[i..].find(':') { [INFO] [stdout] 276 | let rest = &s[i + j + 1..]; [INFO] [stdout] ... [INFO] [stdout] 282 | } [INFO] [stdout] 283 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/gate/parser.rs:290:9 [INFO] [stdout] | [INFO] [stdout] 290 | / if let Ok(s) = core::str::from_utf8(&self.raw) { [INFO] [stdout] 291 | | if let Some(i) = s.find("\"event\"") { [INFO] [stdout] 292 | | if let Some(j) = s[i..].find(':') { [INFO] [stdout] 293 | | let rest = &s[i + j + 1..]; [INFO] [stdout] ... | [INFO] [stdout] 302 | | } [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] 290 ~ if let Ok(s) = core::str::from_utf8(&self.raw) [INFO] [stdout] 291 ~ && let Some(i) = s.find("\"event\"") { [INFO] [stdout] 292 | if let Some(j) = s[i..].find(':') { [INFO] [stdout] ... [INFO] [stdout] 300 | } [INFO] [stdout] 301 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/gate/parser.rs:291:13 [INFO] [stdout] | [INFO] [stdout] 291 | / if let Some(i) = s.find("\"event\"") { [INFO] [stdout] 292 | | if let Some(j) = s[i..].find(':') { [INFO] [stdout] 293 | | let rest = &s[i + j + 1..]; [INFO] [stdout] 294 | | if let Some(start) = rest.find('"') { [INFO] [stdout] ... | [INFO] [stdout] 301 | | } [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] 291 ~ if let Some(i) = s.find("\"event\"") [INFO] [stdout] 292 ~ && let Some(j) = s[i..].find(':') { [INFO] [stdout] 293 | let rest = &s[i + j + 1..]; [INFO] [stdout] ... [INFO] [stdout] 299 | } [INFO] [stdout] 300 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/okx.rs:351:9 [INFO] [stdout] | [INFO] [stdout] 351 | / if let Some(entry) = value.get(*key) { [INFO] [stdout] 352 | | if let Some(v) = value_to_f64_raw(entry) { [INFO] [stdout] 353 | | return Some(v); [INFO] [stdout] 354 | | } [INFO] [stdout] 355 | | } [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] 351 ~ if let Some(entry) = value.get(*key) [INFO] [stdout] 352 ~ && let Some(v) = value_to_f64_raw(entry) { [INFO] [stdout] 353 | return Some(v); [INFO] [stdout] 354 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/collectors/okx.rs:393:9 [INFO] [stdout] | [INFO] [stdout] 393 | / if let Some(entry) = value.get(*key) { [INFO] [stdout] 394 | | if let Some(v) = value_to_u64_raw(entry) { [INFO] [stdout] 395 | | return Some(v); [INFO] [stdout] 396 | | } [INFO] [stdout] 397 | | } [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] 393 ~ if let Some(entry) = value.get(*key) [INFO] [stdout] 394 ~ && let Some(v) = value_to_u64_raw(entry) { [INFO] [stdout] 395 | return Some(v); [INFO] [stdout] 396 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `arr.get(0)` [INFO] [stdout] --> src/collectors/okx.rs:424:18 [INFO] [stdout] | [INFO] [stdout] 424 | let px_str = arr.get(0)?.as_str()?; [INFO] [stdout] | ^^^^^^^^^^ help: try: `arr.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/binance/orderbook.rs:105:51 [INFO] [stdout] | [INFO] [stdout] 105 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/binance/orderbook.rs:259:9 [INFO] [stdout] | [INFO] [stdout] 259 | / if let Some(last) = self.last_resync { [INFO] [stdout] 260 | | if now.duration_since(last) < Self::RESYNC_COOLDOWN { [INFO] [stdout] 261 | | return; // throttle resync attempts [INFO] [stdout] 262 | | } [INFO] [stdout] 263 | | } [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] 259 ~ if let Some(last) = self.last_resync [INFO] [stdout] 260 ~ && now.duration_since(last) < Self::RESYNC_COOLDOWN { [INFO] [stdout] 261 | return; // throttle resync attempts [INFO] [stdout] 262 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/binance/parser.rs:213:13 [INFO] [stdout] | [INFO] [stdout] 213 | / if let Some(i) = s.find("\"e\"") { [INFO] [stdout] 214 | | if let Some(j) = s[i..].find(':') { [INFO] [stdout] 215 | | let rest = &s[i + j + 1..]; [INFO] [stdout] 216 | | if let Some(start) = rest.find('"') { [INFO] [stdout] ... | [INFO] [stdout] 223 | | } [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 Some(i) = s.find("\"e\"") [INFO] [stdout] 214 ~ && let Some(j) = s[i..].find(':') { [INFO] [stdout] 215 | let rest = &s[i + j + 1..]; [INFO] [stdout] ... [INFO] [stdout] 221 | } [INFO] [stdout] 222 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/lighter/orderbook.rs:141:9 [INFO] [stdout] | [INFO] [stdout] 141 | / if let Some(mid) = Self::channel_market_id(&msg.channel) { [INFO] [stdout] 142 | | if mid != self.market_id { [INFO] [stdout] 143 | | return false; [INFO] [stdout] 144 | | } [INFO] [stdout] 145 | | } [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] 141 ~ if let Some(mid) = Self::channel_market_id(&msg.channel) [INFO] [stdout] 142 ~ && mid != self.market_id { [INFO] [stdout] 143 | return false; [INFO] [stdout] 144 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/lighter/orderbook.rs:169:13 [INFO] [stdout] | [INFO] [stdout] 169 | / if let Some(prev) = self.last_offset { [INFO] [stdout] 170 | | if seq <= prev { [INFO] [stdout] 171 | | return false; [INFO] [stdout] 172 | | } [INFO] [stdout] 173 | | } [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] 169 ~ if let Some(prev) = self.last_offset [INFO] [stdout] 170 ~ && seq <= prev { [INFO] [stdout] 171 | return false; [INFO] [stdout] 172 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/lighter/orderbook.rs:222:51 [INFO] [stdout] | [INFO] [stdout] 222 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/binance/parsed.rs:130:9 [INFO] [stdout] | [INFO] [stdout] 130 | / if let Ok(v) = serde_json::from_slice::(bytes) { [INFO] [stdout] 131 | | if v.get("result").is_some() { [INFO] [stdout] 132 | | return Some(BinanceEvent::Ack); [INFO] [stdout] 133 | | } [INFO] [stdout] 134 | | } [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] 130 ~ if let Ok(v) = serde_json::from_slice::(bytes) [INFO] [stdout] 131 ~ && v.get("result").is_some() { [INFO] [stdout] 132 | return Some(BinanceEvent::Ack); [INFO] [stdout] 133 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/binance/parsed.rs:136:9 [INFO] [stdout] | [INFO] [stdout] 136 | / if let Ok(tag) = serde_json::from_slice::(bytes) { [INFO] [stdout] 137 | | if let Some(e) = tag.e.as_deref() { [INFO] [stdout] 138 | | match e { [INFO] [stdout] 139 | | "bookTicker" => { [INFO] [stdout] ... | [INFO] [stdout] 163 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 136 ~ if let Ok(tag) = serde_json::from_slice::(bytes) [INFO] [stdout] 137 ~ && let Some(e) = tag.e.as_deref() { [INFO] [stdout] 138 | match e { [INFO] [stdout] ... [INFO] [stdout] 161 | return Some(BinanceEvent::Other(bytes.to_vec())); [INFO] [stdout] 162 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/exchanges/lighter/parser.rs:83:9 [INFO] [stdout] | [INFO] [stdout] 83 | / let mut subs = Vec::with_capacity(3); [INFO] [stdout] 84 | | subs.push(LighterWs::sub(LighterWs::ORDER_BOOK, meta.market_id)); [INFO] [stdout] 85 | | subs.push(LighterWs::sub(LighterWs::TRADE, meta.market_id)); [INFO] [stdout] 86 | | subs.push(LighterWs::sub(LighterWs::MARKET_STATS, meta.market_id)); [INFO] [stdout] | |___________________________________________________________________________^ help: consider using the `vec![]` macro: `let subs = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/lighter/parser.rs:193:12 [INFO] [stdout] | [INFO] [stdout] 193 | if self [INFO] [stdout] | ____________^ [INFO] [stdout] 194 | | .channel() [INFO] [stdout] 195 | | .map_or(false, |ch| ch.starts_with("order_book")) [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] 195 - .map_or(false, |ch| ch.starts_with("order_book")) [INFO] [stdout] 195 + .is_some_and(|ch| ch.starts_with("order_book")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/lighter/parser.rs:205:12 [INFO] [stdout] | [INFO] [stdout] 205 | if self.channel().map_or(false, |ch| ch.starts_with("trade")) && self.trades_cache.is_none() [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] 205 - if self.channel().map_or(false, |ch| ch.starts_with("trade")) && self.trades_cache.is_none() [INFO] [stdout] 205 + if self.channel().is_some_and(|ch| ch.starts_with("trade")) && self.trades_cache.is_none() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/lighter/parser.rs:214:12 [INFO] [stdout] | [INFO] [stdout] 214 | if self [INFO] [stdout] | ____________^ [INFO] [stdout] 215 | | .channel() [INFO] [stdout] 216 | | .map_or(false, |ch| ch.starts_with("market_stats")) [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] 216 - .map_or(false, |ch| ch.starts_with("market_stats")) [INFO] [stdout] 216 + .is_some_and(|ch| ch.starts_with("market_stats")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/lighter/parser.rs:283:16 [INFO] [stdout] | [INFO] [stdout] 283 | && self [INFO] [stdout] | ________________^ [INFO] [stdout] 284 | | .channel() [INFO] [stdout] 285 | | .map_or(false, |ch| ch.starts_with("order_book")) [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] 285 - .map_or(false, |ch| ch.starts_with("order_book")) [INFO] [stdout] 285 + .is_some_and(|ch| ch.starts_with("order_book")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/lighter/parser.rs:298:43 [INFO] [stdout] | [INFO] [stdout] 298 | if self.trades_cache.is_none() && self.channel().map_or(false, |ch| ch.starts_with("trade")) [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] 298 - if self.trades_cache.is_none() && self.channel().map_or(false, |ch| ch.starts_with("trade")) [INFO] [stdout] 298 + if self.trades_cache.is_none() && self.channel().is_some_and(|ch| ch.starts_with("trade")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/lighter/parser.rs:312:16 [INFO] [stdout] | [INFO] [stdout] 312 | && self [INFO] [stdout] | ________________^ [INFO] [stdout] 313 | | .channel() [INFO] [stdout] 314 | | .map_or(false, |ch| ch.starts_with("market_stats")) [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] 314 - .map_or(false, |ch| ch.starts_with("market_stats")) [INFO] [stdout] 314 + .is_some_and(|ch| ch.starts_with("market_stats")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `entry.get(0)` [INFO] [stdout] --> src/exchanges/bitget/orderbook.rs:110:30 [INFO] [stdout] | [INFO] [stdout] 110 | let px_str = entry.get(0)?; [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `entry.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/bitget/orderbook.rs:199:13 [INFO] [stdout] | [INFO] [stdout] 199 | / if let Some(prev) = prev_seq { [INFO] [stdout] 200 | | if prev != self.last_seq { [INFO] [stdout] 201 | | return false; [INFO] [stdout] 202 | | } [INFO] [stdout] 203 | | } [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] 199 ~ if let Some(prev) = prev_seq [INFO] [stdout] 200 ~ && prev != self.last_seq { [INFO] [stdout] 201 | return false; [INFO] [stdout] 202 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/bitget/orderbook.rs:236:9 [INFO] [stdout] | [INFO] [stdout] 236 | / if let Some(prev) = Self::extract_prev_seq(d) { [INFO] [stdout] 237 | | if prev != self.last_seq { [INFO] [stdout] 238 | | return false; [INFO] [stdout] 239 | | } [INFO] [stdout] 240 | | } [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] 236 ~ if let Some(prev) = Self::extract_prev_seq(d) [INFO] [stdout] 237 ~ && prev != self.last_seq { [INFO] [stdout] 238 | return false; [INFO] [stdout] 239 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `lvl.get(0)` [INFO] [stdout] --> src/exchanges/bitget/orderbook.rs:255:26 [INFO] [stdout] | [INFO] [stdout] 255 | let px_str = lvl.get(0)?; [INFO] [stdout] | ^^^^^^^^^^ help: try: `lvl.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `lvl.get(0)` [INFO] [stdout] --> src/exchanges/bitget/orderbook.rs:292:26 [INFO] [stdout] | [INFO] [stdout] 292 | let px_str = lvl.get(0)?; [INFO] [stdout] | ^^^^^^^^^^ help: try: `lvl.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/bitget/orderbook.rs:384:51 [INFO] [stdout] | [INFO] [stdout] 384 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [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: accessing first element with `entry.get(0)` [INFO] [stdout] --> src/exchanges/mexc/orderbook.rs:81:26 [INFO] [stdout] | [INFO] [stdout] 81 | let px = entry.get(0)?; [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `entry.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/mexc/orderbook.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | / if let Some(begin) = msg.data.begin { [INFO] [stdout] 116 | | if begin > 0 && begin != self.last_seq.saturating_add(1) { [INFO] [stdout] 117 | | // Gap detected; drop update until a fresh snapshot arrives. [INFO] [stdout] 118 | | return false; [INFO] [stdout] 119 | | } [INFO] [stdout] 120 | | } [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] 115 ~ if let Some(begin) = msg.data.begin [INFO] [stdout] 116 ~ && begin > 0 && begin != self.last_seq.saturating_add(1) { [INFO] [stdout] 117 | // Gap detected; drop update until a fresh snapshot arrives. [INFO] [stdout] 118 | return false; [INFO] [stdout] 119 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/mexc/orderbook.rs:149:51 [INFO] [stdout] | [INFO] [stdout] 149 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [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: calls to `push` immediately after creation [INFO] [stdout] --> src/exchanges/mexc/parser.rs:53:9 [INFO] [stdout] | [INFO] [stdout] 53 | / let mut subs = Vec::with_capacity(3); [INFO] [stdout] 54 | | subs.push(MexcWs::sub_depth(&normalized, None)); [INFO] [stdout] 55 | | subs.push(MexcWs::sub_ticker(&normalized)); [INFO] [stdout] 56 | | subs.push(MexcWs::sub_trades(&normalized)); [INFO] [stdout] | |___________________________________________________^ help: consider using the `vec![]` macro: `let subs = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/mexc/parser.rs:126:9 [INFO] [stdout] | [INFO] [stdout] 126 | / if self.channel_cache.is_none() { [INFO] [stdout] 127 | | if let Some(ch) = channel_opt { [INFO] [stdout] 128 | | self.channel_cache = Some(ch.to_string()); [INFO] [stdout] 129 | | } [INFO] [stdout] 130 | | } [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] 126 ~ if self.channel_cache.is_none() [INFO] [stdout] 127 ~ && let Some(ch) = channel_opt { [INFO] [stdout] 128 | self.channel_cache = Some(ch.to_string()); [INFO] [stdout] 129 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/mexc/parser.rs:172:9 [INFO] [stdout] | [INFO] [stdout] 172 | / if self.channel_cache.is_none() { [INFO] [stdout] 173 | | if let Some(ch) = channel_opt { [INFO] [stdout] 174 | | self.channel_cache = Some(ch.to_string()); [INFO] [stdout] 175 | | } [INFO] [stdout] 176 | | } [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] 172 ~ if self.channel_cache.is_none() [INFO] [stdout] 173 ~ && let Some(ch) = channel_opt { [INFO] [stdout] 174 | self.channel_cache = Some(ch.to_string()); [INFO] [stdout] 175 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/mexc/parser.rs:238:42 [INFO] [stdout] | [INFO] [stdout] 238 | if self.depth_cache.is_none() && self.channel().map_or(false, |ch| ch == "push.depth") { [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 a standard comparison instead [INFO] [stdout] | [INFO] [stdout] 238 - if self.depth_cache.is_none() && self.channel().map_or(false, |ch| ch == "push.depth") { [INFO] [stdout] 238 + if self.depth_cache.is_none() && (self.channel() == Some("push.depth")) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `v.get(0)` [INFO] [stdout] --> src/exchanges/bybit/orderbook.rs:84:44 [INFO] [stdout] | [INFO] [stdout] 84 | BybitDataCont::Arr(v) => match v.get(0) { [INFO] [stdout] | ^^^^^^^^ help: try: `v.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/bybit/orderbook.rs:183:51 [INFO] [stdout] | [INFO] [stdout] 183 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/exchanges/bybit/orderbook.rs:207:5 [INFO] [stdout] | [INFO] [stdout] 207 | / pub fn apply_bbo( [INFO] [stdout] 208 | | &mut self, [INFO] [stdout] 209 | | bid_px: f64, [INFO] [stdout] 210 | | bid_sz: f64, [INFO] [stdout] ... | [INFO] [stdout] 215 | | system_ts_ms: u64, [INFO] [stdout] 216 | | ) -> bool { [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/exchanges/bybit/parser.rs:231:9 [INFO] [stdout] | [INFO] [stdout] 231 | / if let Some(i) = s.find("\"topic\"") { [INFO] [stdout] 232 | | if let Some(j) = s[i..].find(':') { [INFO] [stdout] 233 | | let rest = &s[i + j + 1..]; [INFO] [stdout] 234 | | let start = rest.find('"')? + 1; [INFO] [stdout] ... | [INFO] [stdout] 239 | | } [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] 231 ~ if let Some(i) = s.find("\"topic\"") [INFO] [stdout] 232 ~ && let Some(j) = s[i..].find(':') { [INFO] [stdout] 233 | let rest = &s[i + j + 1..]; [INFO] [stdout] ... [INFO] [stdout] 237 | return Some(&rest2[..end]); [INFO] [stdout] 238 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `entry.get(0)` [INFO] [stdout] --> src/exchanges/okx/orderbook.rs:177:30 [INFO] [stdout] | [INFO] [stdout] 177 | let px_str = entry.get(0)?; [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `entry.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/okx/orderbook.rs:265:17 [INFO] [stdout] | [INFO] [stdout] 265 | / if let Some(prev) = Self::extract_prev_seq(datum) { [INFO] [stdout] 266 | | if prev != self.last_books_seq { [INFO] [stdout] 267 | | return false; [INFO] [stdout] 268 | | } [INFO] [stdout] 269 | | } [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] 265 ~ if let Some(prev) = Self::extract_prev_seq(datum) [INFO] [stdout] 266 ~ && prev != self.last_books_seq { [INFO] [stdout] 267 | return false; [INFO] [stdout] 268 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/okx/orderbook.rs:303:9 [INFO] [stdout] | [INFO] [stdout] 303 | / if let Some(prev) = Self::extract_prev_seq(datum) { [INFO] [stdout] 304 | | if prev != self.last_bbo_seq { [INFO] [stdout] 305 | | return false; [INFO] [stdout] 306 | | } [INFO] [stdout] 307 | | } [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] 303 ~ if let Some(prev) = Self::extract_prev_seq(datum) [INFO] [stdout] 304 ~ && prev != self.last_bbo_seq { [INFO] [stdout] 305 | return false; [INFO] [stdout] 306 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `lvl.get(0)` [INFO] [stdout] --> src/exchanges/okx/orderbook.rs:320:26 [INFO] [stdout] | [INFO] [stdout] 320 | let px_str = lvl.get(0)?; [INFO] [stdout] | ^^^^^^^^^^ help: try: `lvl.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `lvl.get(0)` [INFO] [stdout] --> src/exchanges/okx/orderbook.rs:352:26 [INFO] [stdout] | [INFO] [stdout] 352 | let px_str = lvl.get(0)?; [INFO] [stdout] | ^^^^^^^^^^ help: try: `lvl.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/okx/orderbook.rs:451:51 [INFO] [stdout] | [INFO] [stdout] 451 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/gate/orderbook.rs:66:9 [INFO] [stdout] | [INFO] [stdout] 66 | / if let Some(s) = self.s.as_deref() { [INFO] [stdout] 67 | | if let Some(rest) = s.strip_prefix("ob.") { [INFO] [stdout] 68 | | return Some(rest.split('.').next().unwrap_or(rest)); [INFO] [stdout] 69 | | } [INFO] [stdout] 70 | | } [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] 66 ~ if let Some(s) = self.s.as_deref() [INFO] [stdout] 67 ~ && let Some(rest) = s.strip_prefix("ob.") { [INFO] [stdout] 68 | return Some(rest.split('.').next().unwrap_or(rest)); [INFO] [stdout] 69 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used consecutive `str::replace` call [INFO] [stdout] --> src/exchanges/okx/parser.rs:238:28 [INFO] [stdout] | [INFO] [stdout] 238 | let replaced = trimmed.replace('/', "-").replace('_', "-"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['/', '_'], "-")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/gate/orderbook.rs:200:9 [INFO] [stdout] | [INFO] [stdout] 200 | / if let Some(contract) = res.contract_name() { [INFO] [stdout] 201 | | if !contract.eq_ignore_ascii_case(&self.contract) { [INFO] [stdout] 202 | | return false; [INFO] [stdout] 203 | | } [INFO] [stdout] 204 | | } [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] 200 ~ if let Some(contract) = res.contract_name() [INFO] [stdout] 201 ~ && !contract.eq_ignore_ascii_case(&self.contract) { [INFO] [stdout] 202 | return false; [INFO] [stdout] 203 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/gate/orderbook.rs:329:51 [INFO] [stdout] | [INFO] [stdout] 329 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [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: clamp-like pattern without using clamp function [INFO] [stdout] --> src/pricing/lighter_model.rs:116:9 [INFO] [stdout] | [INFO] [stdout] 116 | / ((value - self.mean) / self.mad.max(1e-10)) [INFO] [stdout] 117 | | .max(0.0) [INFO] [stdout] 118 | | .min(10.0) [INFO] [stdout] | |______________________^ help: replace with clamp: `((value - self.mean) / self.mad.max(1e-10)).clamp(0.0, 10.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/pricing/lighter_model.rs:127:9 [INFO] [stdout] | [INFO] [stdout] 127 | / ((self.mean - value) / self.mad.max(1e-10)) [INFO] [stdout] 128 | | .max(0.0) [INFO] [stdout] 129 | | .min(10.0) [INFO] [stdout] | |______________________^ help: replace with clamp: `((self.mean - value) / self.mad.max(1e-10)).clamp(0.0, 10.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/gate/parser.rs:273:9 [INFO] [stdout] | [INFO] [stdout] 273 | / if let Ok(s) = core::str::from_utf8(&self.raw) { [INFO] [stdout] 274 | | if let Some(i) = s.find("\"channel\"") { [INFO] [stdout] 275 | | if let Some(j) = s[i..].find(':') { [INFO] [stdout] 276 | | let rest = &s[i + j + 1..]; [INFO] [stdout] ... | [INFO] [stdout] 285 | | } [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 Ok(s) = core::str::from_utf8(&self.raw) [INFO] [stdout] 274 ~ && let Some(i) = s.find("\"channel\"") { [INFO] [stdout] 275 | if let Some(j) = s[i..].find(':') { [INFO] [stdout] ... [INFO] [stdout] 283 | } [INFO] [stdout] 284 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/gate/parser.rs:274:13 [INFO] [stdout] | [INFO] [stdout] 274 | / if let Some(i) = s.find("\"channel\"") { [INFO] [stdout] 275 | | if let Some(j) = s[i..].find(':') { [INFO] [stdout] 276 | | let rest = &s[i + j + 1..]; [INFO] [stdout] 277 | | if let Some(start) = rest.find('"') { [INFO] [stdout] ... | [INFO] [stdout] 284 | | } [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] 274 ~ if let Some(i) = s.find("\"channel\"") [INFO] [stdout] 275 ~ && let Some(j) = s[i..].find(':') { [INFO] [stdout] 276 | let rest = &s[i + j + 1..]; [INFO] [stdout] ... [INFO] [stdout] 282 | } [INFO] [stdout] 283 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/gate/parser.rs:290:9 [INFO] [stdout] | [INFO] [stdout] 290 | / if let Ok(s) = core::str::from_utf8(&self.raw) { [INFO] [stdout] 291 | | if let Some(i) = s.find("\"event\"") { [INFO] [stdout] 292 | | if let Some(j) = s[i..].find(':') { [INFO] [stdout] 293 | | let rest = &s[i + j + 1..]; [INFO] [stdout] ... | [INFO] [stdout] 302 | | } [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] 290 ~ if let Ok(s) = core::str::from_utf8(&self.raw) [INFO] [stdout] 291 ~ && let Some(i) = s.find("\"event\"") { [INFO] [stdout] 292 | if let Some(j) = s[i..].find(':') { [INFO] [stdout] ... [INFO] [stdout] 300 | } [INFO] [stdout] 301 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/gate/parser.rs:291:13 [INFO] [stdout] | [INFO] [stdout] 291 | / if let Some(i) = s.find("\"event\"") { [INFO] [stdout] 292 | | if let Some(j) = s[i..].find(':') { [INFO] [stdout] 293 | | let rest = &s[i + j + 1..]; [INFO] [stdout] 294 | | if let Some(start) = rest.find('"') { [INFO] [stdout] ... | [INFO] [stdout] 301 | | } [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] 291 ~ if let Some(i) = s.find("\"event\"") [INFO] [stdout] 292 ~ && let Some(j) = s[i..].find(':') { [INFO] [stdout] 293 | let rest = &s[i + j + 1..]; [INFO] [stdout] ... [INFO] [stdout] 299 | } [INFO] [stdout] 300 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/lighter/orderbook.rs:141:9 [INFO] [stdout] | [INFO] [stdout] 141 | / if let Some(mid) = Self::channel_market_id(&msg.channel) { [INFO] [stdout] 142 | | if mid != self.market_id { [INFO] [stdout] 143 | | return false; [INFO] [stdout] 144 | | } [INFO] [stdout] 145 | | } [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] 141 ~ if let Some(mid) = Self::channel_market_id(&msg.channel) [INFO] [stdout] 142 ~ && mid != self.market_id { [INFO] [stdout] 143 | return false; [INFO] [stdout] 144 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/lighter/orderbook.rs:169:13 [INFO] [stdout] | [INFO] [stdout] 169 | / if let Some(prev) = self.last_offset { [INFO] [stdout] 170 | | if seq <= prev { [INFO] [stdout] 171 | | return false; [INFO] [stdout] 172 | | } [INFO] [stdout] 173 | | } [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] 169 ~ if let Some(prev) = self.last_offset [INFO] [stdout] 170 ~ && seq <= prev { [INFO] [stdout] 171 | return false; [INFO] [stdout] 172 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/lighter/orderbook.rs:222:51 [INFO] [stdout] | [INFO] [stdout] 222 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [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: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/pricing/lighter_model.rs:742:21 [INFO] [stdout] | [INFO] [stdout] 742 | let z_obs = (obs_price.ln() - mu_log) as f64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(obs_price.ln() - mu_log)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/pricing/lighter_model.rs:757:9 [INFO] [stdout] | [INFO] [stdout] 757 | self.x = phi * self.x; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.x *= phi` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/pricing/lighter_model.rs:759:9 [INFO] [stdout] | [INFO] [stdout] 759 | self.x_c = phi * self.x_c; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.x_c *= phi` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pricing/lighter_model.rs:804:9 [INFO] [stdout] | [INFO] [stdout] 804 | / if !is_ref && self.cfg.tuning.latency_alpha > 0.0 { [INFO] [stdout] 805 | | if let Some(lat) = latency_us { [INFO] [stdout] 806 | | z_lat = self [INFO] [stdout] 807 | | .online_stats [INFO] [stdout] ... | [INFO] [stdout] 813 | | } [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] 804 ~ if !is_ref && self.cfg.tuning.latency_alpha > 0.0 [INFO] [stdout] 805 ~ && let Some(lat) = latency_us { [INFO] [stdout] 806 | z_lat = self [INFO] [stdout] ... [INFO] [stdout] 811 | r_eff *= 1.0 + self.cfg.tuning.latency_alpha * z_lat; [INFO] [stdout] 812 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/pricing/lighter_model.rs:872:9 [INFO] [stdout] | [INFO] [stdout] 872 | self.p = (1.0 - k_gain) * self.p; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.p *= (1.0 - k_gain)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/pricing/lighter_model.rs:877:13 [INFO] [stdout] | [INFO] [stdout] 877 | self.p_c = (1.0 - k_gain_c) * self.p_c; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.p_c *= (1.0 - k_gain_c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> src/pricing/lighter_model.rs:1041:19 [INFO] [stdout] | [INFO] [stdout] 1041 | fn to_seconds(&mut self, t_ns: i64) -> f64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pricing/lighter_model.rs:1114:13 [INFO] [stdout] | [INFO] [stdout] 1114 | / if let Some((px, sz)) = obs.bid_levels[level] { [INFO] [stdout] 1115 | | if px.is_finite() && sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1116 | | bid_px.push(px); [INFO] [stdout] 1117 | | bid_sz.push(sz); [INFO] [stdout] 1118 | | } [INFO] [stdout] 1119 | | } [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] 1114 ~ if let Some((px, sz)) = obs.bid_levels[level] [INFO] [stdout] 1115 ~ && px.is_finite() && sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1116 | bid_px.push(px); [INFO] [stdout] 1117 | bid_sz.push(sz); [INFO] [stdout] 1118 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pricing/lighter_model.rs:1120:13 [INFO] [stdout] | [INFO] [stdout] 1120 | / if let Some((px, sz)) = obs.ask_levels[level] { [INFO] [stdout] 1121 | | if px.is_finite() && sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1122 | | ask_px.push(px); [INFO] [stdout] 1123 | | ask_sz.push(sz); [INFO] [stdout] 1124 | | } [INFO] [stdout] 1125 | | } [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] 1120 ~ if let Some((px, sz)) = obs.ask_levels[level] [INFO] [stdout] 1121 ~ && px.is_finite() && sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1122 | ask_px.push(px); [INFO] [stdout] 1123 | ask_sz.push(sz); [INFO] [stdout] 1124 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pricing/lighter_model.rs:1169:13 [INFO] [stdout] | [INFO] [stdout] 1169 | / if let Some((_px, sz)) = obs.bid_levels[level] { [INFO] [stdout] 1170 | | if sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1171 | | bid_depth += sz; [INFO] [stdout] 1172 | | } [INFO] [stdout] 1173 | | } [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] 1169 ~ if let Some((_px, sz)) = obs.bid_levels[level] [INFO] [stdout] 1170 ~ && sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1171 | bid_depth += sz; [INFO] [stdout] 1172 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pricing/lighter_model.rs:1174:13 [INFO] [stdout] | [INFO] [stdout] 1174 | / if let Some((_px, sz)) = obs.ask_levels[level] { [INFO] [stdout] 1175 | | if sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1176 | | ask_depth += sz; [INFO] [stdout] 1177 | | } [INFO] [stdout] 1178 | | } [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] 1174 ~ if let Some((_px, sz)) = obs.ask_levels[level] [INFO] [stdout] 1175 ~ && sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1176 | ask_depth += sz; [INFO] [stdout] 1177 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/exchanges/lighter/parser.rs:83:9 [INFO] [stdout] | [INFO] [stdout] 83 | / let mut subs = Vec::with_capacity(3); [INFO] [stdout] 84 | | subs.push(LighterWs::sub(LighterWs::ORDER_BOOK, meta.market_id)); [INFO] [stdout] 85 | | subs.push(LighterWs::sub(LighterWs::TRADE, meta.market_id)); [INFO] [stdout] 86 | | subs.push(LighterWs::sub(LighterWs::MARKET_STATS, meta.market_id)); [INFO] [stdout] | |___________________________________________________________________________^ help: consider using the `vec![]` macro: `let subs = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pricing/lighter_model.rs:1203:13 [INFO] [stdout] | [INFO] [stdout] 1203 | / if let Some(t_last) = self.last_t_by_exch.get(ex) { [INFO] [stdout] 1204 | | if t_last.is_finite() { [INFO] [stdout] 1205 | | if max_age_ms > 0.0 { [INFO] [stdout] 1206 | | let age_ms = (t_sec - t_last) * 1000.0; [INFO] [stdout] ... | [INFO] [stdout] 1213 | | } [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] 1203 ~ if let Some(t_last) = self.last_t_by_exch.get(ex) [INFO] [stdout] 1204 ~ && t_last.is_finite() { [INFO] [stdout] 1205 | if max_age_ms > 0.0 { [INFO] [stdout] ... [INFO] [stdout] 1211 | vals.push(*px); [INFO] [stdout] 1212 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/pricing/lighter_model.rs:1267:12 [INFO] [stdout] | [INFO] [stdout] 1267 | if !(bid_px.is_finite() && bid_px > 0.0) && !(ask_px.is_finite() && ask_px > 0.0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(bid_px.is_finite() && bid_px > 0.0 || ask_px.is_finite() && ask_px > 0.0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/lighter/parser.rs:193:12 [INFO] [stdout] | [INFO] [stdout] 193 | if self [INFO] [stdout] | ____________^ [INFO] [stdout] 194 | | .channel() [INFO] [stdout] 195 | | .map_or(false, |ch| ch.starts_with("order_book")) [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] 195 - .map_or(false, |ch| ch.starts_with("order_book")) [INFO] [stdout] 195 + .is_some_and(|ch| ch.starts_with("order_book")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/lighter/parser.rs:205:12 [INFO] [stdout] | [INFO] [stdout] 205 | if self.channel().map_or(false, |ch| ch.starts_with("trade")) && self.trades_cache.is_none() [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] 205 - if self.channel().map_or(false, |ch| ch.starts_with("trade")) && self.trades_cache.is_none() [INFO] [stdout] 205 + if self.channel().is_some_and(|ch| ch.starts_with("trade")) && self.trades_cache.is_none() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/lighter/parser.rs:214:12 [INFO] [stdout] | [INFO] [stdout] 214 | if self [INFO] [stdout] | ____________^ [INFO] [stdout] 215 | | .channel() [INFO] [stdout] 216 | | .map_or(false, |ch| ch.starts_with("market_stats")) [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] 216 - .map_or(false, |ch| ch.starts_with("market_stats")) [INFO] [stdout] 216 + .is_some_and(|ch| ch.starts_with("market_stats")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/lighter/parser.rs:283:16 [INFO] [stdout] | [INFO] [stdout] 283 | && self [INFO] [stdout] | ________________^ [INFO] [stdout] 284 | | .channel() [INFO] [stdout] 285 | | .map_or(false, |ch| ch.starts_with("order_book")) [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] 285 - .map_or(false, |ch| ch.starts_with("order_book")) [INFO] [stdout] 285 + .is_some_and(|ch| ch.starts_with("order_book")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/lighter/parser.rs:298:43 [INFO] [stdout] | [INFO] [stdout] 298 | if self.trades_cache.is_none() && self.channel().map_or(false, |ch| ch.starts_with("trade")) [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] 298 - if self.trades_cache.is_none() && self.channel().map_or(false, |ch| ch.starts_with("trade")) [INFO] [stdout] 298 + if self.trades_cache.is_none() && self.channel().is_some_and(|ch| ch.starts_with("trade")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/lighter/parser.rs:312:16 [INFO] [stdout] | [INFO] [stdout] 312 | && self [INFO] [stdout] | ________________^ [INFO] [stdout] 313 | | .channel() [INFO] [stdout] 314 | | .map_or(false, |ch| ch.starts_with("market_stats")) [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] 314 - .map_or(false, |ch| ch.starts_with("market_stats")) [INFO] [stdout] 314 + .is_some_and(|ch| ch.starts_with("market_stats")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/pricing/lighter_model.rs:1717:9 [INFO] [stdout] | [INFO] [stdout] 1717 | streams.sort_by(|(a, _), (b, _)| a.cmp(b)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1717 - streams.sort_by(|(a, _), (b, _)| a.cmp(b)); [INFO] [stdout] 1717 + streams.sort_by_key(|(a, _)| *a); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/pricing/lighter_model.rs:1737:27 [INFO] [stdout] | [INFO] [stdout] 1737 | if count <= 20 || count % 1000 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace with: `count.is_multiple_of(1000)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/utils/parsing.rs:47:22 [INFO] [stdout] | [INFO] [stdout] 47 | if count == 1 || count % PARSE_LOG_EVERY == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `count.is_multiple_of(PARSE_LOG_EVERY)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `entry.get(0)` [INFO] [stdout] --> src/exchanges/mexc/orderbook.rs:81:26 [INFO] [stdout] | [INFO] [stdout] 81 | let px = entry.get(0)?; [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `entry.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/mexc/orderbook.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | / if let Some(begin) = msg.data.begin { [INFO] [stdout] 116 | | if begin > 0 && begin != self.last_seq.saturating_add(1) { [INFO] [stdout] 117 | | // Gap detected; drop update until a fresh snapshot arrives. [INFO] [stdout] 118 | | return false; [INFO] [stdout] 119 | | } [INFO] [stdout] 120 | | } [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] 115 ~ if let Some(begin) = msg.data.begin [INFO] [stdout] 116 ~ && begin > 0 && begin != self.last_seq.saturating_add(1) { [INFO] [stdout] 117 | // Gap detected; drop update until a fresh snapshot arrives. [INFO] [stdout] 118 | return false; [INFO] [stdout] 119 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/mexc/orderbook.rs:149:51 [INFO] [stdout] | [INFO] [stdout] 149 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [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: calls to `push` immediately after creation [INFO] [stdout] --> src/exchanges/mexc/parser.rs:53:9 [INFO] [stdout] | [INFO] [stdout] 53 | / let mut subs = Vec::with_capacity(3); [INFO] [stdout] 54 | | subs.push(MexcWs::sub_depth(&normalized, None)); [INFO] [stdout] 55 | | subs.push(MexcWs::sub_ticker(&normalized)); [INFO] [stdout] 56 | | subs.push(MexcWs::sub_trades(&normalized)); [INFO] [stdout] | |___________________________________________________^ help: consider using the `vec![]` macro: `let subs = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/mexc/parser.rs:126:9 [INFO] [stdout] | [INFO] [stdout] 126 | / if self.channel_cache.is_none() { [INFO] [stdout] 127 | | if let Some(ch) = channel_opt { [INFO] [stdout] 128 | | self.channel_cache = Some(ch.to_string()); [INFO] [stdout] 129 | | } [INFO] [stdout] 130 | | } [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] 126 ~ if self.channel_cache.is_none() [INFO] [stdout] 127 ~ && let Some(ch) = channel_opt { [INFO] [stdout] 128 | self.channel_cache = Some(ch.to_string()); [INFO] [stdout] 129 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/mexc/parser.rs:172:9 [INFO] [stdout] | [INFO] [stdout] 172 | / if self.channel_cache.is_none() { [INFO] [stdout] 173 | | if let Some(ch) = channel_opt { [INFO] [stdout] 174 | | self.channel_cache = Some(ch.to_string()); [INFO] [stdout] 175 | | } [INFO] [stdout] 176 | | } [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] 172 ~ if self.channel_cache.is_none() [INFO] [stdout] 173 ~ && let Some(ch) = channel_opt { [INFO] [stdout] 174 | self.channel_cache = Some(ch.to_string()); [INFO] [stdout] 175 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/exchanges/mexc/parser.rs:238:42 [INFO] [stdout] | [INFO] [stdout] 238 | if self.depth_cache.is_none() && self.channel().map_or(false, |ch| ch == "push.depth") { [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 a standard comparison instead [INFO] [stdout] | [INFO] [stdout] 238 - if self.depth_cache.is_none() && self.channel().map_or(false, |ch| ch == "push.depth") { [INFO] [stdout] 238 + if self.depth_cache.is_none() && (self.channel() == Some("push.depth")) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `entry.get(0)` [INFO] [stdout] --> src/exchanges/okx/orderbook.rs:177:30 [INFO] [stdout] | [INFO] [stdout] 177 | let px_str = entry.get(0)?; [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `entry.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/okx/orderbook.rs:265:17 [INFO] [stdout] | [INFO] [stdout] 265 | / if let Some(prev) = Self::extract_prev_seq(datum) { [INFO] [stdout] 266 | | if prev != self.last_books_seq { [INFO] [stdout] 267 | | return false; [INFO] [stdout] 268 | | } [INFO] [stdout] 269 | | } [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] 265 ~ if let Some(prev) = Self::extract_prev_seq(datum) [INFO] [stdout] 266 ~ && prev != self.last_books_seq { [INFO] [stdout] 267 | return false; [INFO] [stdout] 268 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/exchanges/okx/orderbook.rs:303:9 [INFO] [stdout] | [INFO] [stdout] 303 | / if let Some(prev) = Self::extract_prev_seq(datum) { [INFO] [stdout] 304 | | if prev != self.last_bbo_seq { [INFO] [stdout] 305 | | return false; [INFO] [stdout] 306 | | } [INFO] [stdout] 307 | | } [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] 303 ~ if let Some(prev) = Self::extract_prev_seq(datum) [INFO] [stdout] 304 ~ && prev != self.last_bbo_seq { [INFO] [stdout] 305 | return false; [INFO] [stdout] 306 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `lvl.get(0)` [INFO] [stdout] --> src/exchanges/okx/orderbook.rs:320:26 [INFO] [stdout] | [INFO] [stdout] 320 | let px_str = lvl.get(0)?; [INFO] [stdout] | ^^^^^^^^^^ help: try: `lvl.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `lvl.get(0)` [INFO] [stdout] --> src/exchanges/okx/orderbook.rs:352:26 [INFO] [stdout] | [INFO] [stdout] 352 | let px_str = lvl.get(0)?; [INFO] [stdout] | ^^^^^^^^^^ help: try: `lvl.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/exchanges/okx/orderbook.rs:451:51 [INFO] [stdout] | [INFO] [stdout] 451 | pub fn top_levels_f64(&self, depth: usize) -> (Vec<(f64, f64)>, Vec<(f64, f64)>) { [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: used consecutive `str::replace` call [INFO] [stdout] --> src/exchanges/okx/parser.rs:238:28 [INFO] [stdout] | [INFO] [stdout] 238 | let replaced = trimmed.replace('/', "-").replace('_', "-"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['/', '_'], "-")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/pricing/lighter_model.rs:116:9 [INFO] [stdout] | [INFO] [stdout] 116 | / ((value - self.mean) / self.mad.max(1e-10)) [INFO] [stdout] 117 | | .max(0.0) [INFO] [stdout] 118 | | .min(10.0) [INFO] [stdout] | |______________________^ help: replace with clamp: `((value - self.mean) / self.mad.max(1e-10)).clamp(0.0, 10.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/pricing/lighter_model.rs:127:9 [INFO] [stdout] | [INFO] [stdout] 127 | / ((self.mean - value) / self.mad.max(1e-10)) [INFO] [stdout] 128 | | .max(0.0) [INFO] [stdout] 129 | | .min(10.0) [INFO] [stdout] | |______________________^ help: replace with clamp: `((self.mean - value) / self.mad.max(1e-10)).clamp(0.0, 10.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/pricing/lighter_model.rs:742:21 [INFO] [stdout] | [INFO] [stdout] 742 | let z_obs = (obs_price.ln() - mu_log) as f64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(obs_price.ln() - mu_log)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/pricing/lighter_model.rs:757:9 [INFO] [stdout] | [INFO] [stdout] 757 | self.x = phi * self.x; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.x *= phi` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/pricing/lighter_model.rs:759:9 [INFO] [stdout] | [INFO] [stdout] 759 | self.x_c = phi * self.x_c; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.x_c *= phi` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pricing/lighter_model.rs:804:9 [INFO] [stdout] | [INFO] [stdout] 804 | / if !is_ref && self.cfg.tuning.latency_alpha > 0.0 { [INFO] [stdout] 805 | | if let Some(lat) = latency_us { [INFO] [stdout] 806 | | z_lat = self [INFO] [stdout] 807 | | .online_stats [INFO] [stdout] ... | [INFO] [stdout] 813 | | } [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] 804 ~ if !is_ref && self.cfg.tuning.latency_alpha > 0.0 [INFO] [stdout] 805 ~ && let Some(lat) = latency_us { [INFO] [stdout] 806 | z_lat = self [INFO] [stdout] ... [INFO] [stdout] 811 | r_eff *= 1.0 + self.cfg.tuning.latency_alpha * z_lat; [INFO] [stdout] 812 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/pricing/lighter_model.rs:872:9 [INFO] [stdout] | [INFO] [stdout] 872 | self.p = (1.0 - k_gain) * self.p; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.p *= (1.0 - k_gain)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/pricing/lighter_model.rs:877:13 [INFO] [stdout] | [INFO] [stdout] 877 | self.p_c = (1.0 - k_gain_c) * self.p_c; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.p_c *= (1.0 - k_gain_c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> src/pricing/lighter_model.rs:1041:19 [INFO] [stdout] | [INFO] [stdout] 1041 | fn to_seconds(&mut self, t_ns: i64) -> f64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pricing/lighter_model.rs:1114:13 [INFO] [stdout] | [INFO] [stdout] 1114 | / if let Some((px, sz)) = obs.bid_levels[level] { [INFO] [stdout] 1115 | | if px.is_finite() && sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1116 | | bid_px.push(px); [INFO] [stdout] 1117 | | bid_sz.push(sz); [INFO] [stdout] 1118 | | } [INFO] [stdout] 1119 | | } [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] 1114 ~ if let Some((px, sz)) = obs.bid_levels[level] [INFO] [stdout] 1115 ~ && px.is_finite() && sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1116 | bid_px.push(px); [INFO] [stdout] 1117 | bid_sz.push(sz); [INFO] [stdout] 1118 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pricing/lighter_model.rs:1120:13 [INFO] [stdout] | [INFO] [stdout] 1120 | / if let Some((px, sz)) = obs.ask_levels[level] { [INFO] [stdout] 1121 | | if px.is_finite() && sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1122 | | ask_px.push(px); [INFO] [stdout] 1123 | | ask_sz.push(sz); [INFO] [stdout] 1124 | | } [INFO] [stdout] 1125 | | } [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] 1120 ~ if let Some((px, sz)) = obs.ask_levels[level] [INFO] [stdout] 1121 ~ && px.is_finite() && sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1122 | ask_px.push(px); [INFO] [stdout] 1123 | ask_sz.push(sz); [INFO] [stdout] 1124 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pricing/lighter_model.rs:1169:13 [INFO] [stdout] | [INFO] [stdout] 1169 | / if let Some((_px, sz)) = obs.bid_levels[level] { [INFO] [stdout] 1170 | | if sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1171 | | bid_depth += sz; [INFO] [stdout] 1172 | | } [INFO] [stdout] 1173 | | } [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] 1169 ~ if let Some((_px, sz)) = obs.bid_levels[level] [INFO] [stdout] 1170 ~ && sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1171 | bid_depth += sz; [INFO] [stdout] 1172 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pricing/lighter_model.rs:1174:13 [INFO] [stdout] | [INFO] [stdout] 1174 | / if let Some((_px, sz)) = obs.ask_levels[level] { [INFO] [stdout] 1175 | | if sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1176 | | ask_depth += sz; [INFO] [stdout] 1177 | | } [INFO] [stdout] 1178 | | } [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] 1174 ~ if let Some((_px, sz)) = obs.ask_levels[level] [INFO] [stdout] 1175 ~ && sz.is_finite() && sz > 0.0 { [INFO] [stdout] 1176 | ask_depth += sz; [INFO] [stdout] 1177 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pricing/lighter_model.rs:1203:13 [INFO] [stdout] | [INFO] [stdout] 1203 | / if let Some(t_last) = self.last_t_by_exch.get(ex) { [INFO] [stdout] 1204 | | if t_last.is_finite() { [INFO] [stdout] 1205 | | if max_age_ms > 0.0 { [INFO] [stdout] 1206 | | let age_ms = (t_sec - t_last) * 1000.0; [INFO] [stdout] ... | [INFO] [stdout] 1213 | | } [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] 1203 ~ if let Some(t_last) = self.last_t_by_exch.get(ex) [INFO] [stdout] 1204 ~ && t_last.is_finite() { [INFO] [stdout] 1205 | if max_age_ms > 0.0 { [INFO] [stdout] ... [INFO] [stdout] 1211 | vals.push(*px); [INFO] [stdout] 1212 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/pricing/lighter_model.rs:1267:12 [INFO] [stdout] | [INFO] [stdout] 1267 | if !(bid_px.is_finite() && bid_px > 0.0) && !(ask_px.is_finite() && ask_px > 0.0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(bid_px.is_finite() && bid_px > 0.0 || ask_px.is_finite() && ask_px > 0.0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/pricing/lighter_model.rs:1717:9 [INFO] [stdout] | [INFO] [stdout] 1717 | streams.sort_by(|(a, _), (b, _)| a.cmp(b)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1717 - streams.sort_by(|(a, _), (b, _)| a.cmp(b)); [INFO] [stdout] 1717 + streams.sort_by_key(|(a, _)| *a); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/pricing/lighter_model.rs:1737:27 [INFO] [stdout] | [INFO] [stdout] 1737 | if count <= 20 || count % 1000 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace with: `count.is_multiple_of(1000)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/mexc_raw_dump.rs:30:19 [INFO] [stdout] | [INFO] [stdout] 30 | if let Ok(mut frame) = mexc_c.try_pop() { [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/utils/parsing.rs:47:22 [INFO] [stdout] | [INFO] [stdout] 47 | if count == 1 || count % PARSE_LOG_EVERY == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `count.is_multiple_of(PARSE_LOG_EVERY)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/mexc_raw_dump.rs:30:19 [INFO] [stdout] | [INFO] [stdout] 30 | if let Ok(mut frame) = mexc_c.try_pop() { [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | / if let Ok(f) = bybit_c.try_pop() { [INFO] [stdout] 45 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 46 | | if let Some((fi, label)) = detect_feed_bybit(s) { [INFO] [stdout] 47 | | if bybit_cnt[fi] < per_feed { [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 44 ~ if let Ok(f) = bybit_c.try_pop() [INFO] [stdout] 45 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 46 | if let Some((fi, label)) = detect_feed_bybit(s) { [INFO] [stdout] ... [INFO] [stdout] 52 | } [INFO] [stdout] 53 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | / if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 46 | | if let Some((fi, label)) = detect_feed_bybit(s) { [INFO] [stdout] 47 | | if bybit_cnt[fi] < per_feed { [INFO] [stdout] 48 | | bybit_cnt[fi] += 1; [INFO] [stdout] ... | [INFO] [stdout] 53 | | } [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] 45 ~ if let Ok(s) = std::str::from_utf8(&f.raw) [INFO] [stdout] 46 ~ && let Some((fi, label)) = detect_feed_bybit(s) { [INFO] [stdout] 47 | if bybit_cnt[fi] < per_feed { [INFO] [stdout] ... [INFO] [stdout] 51 | } [INFO] [stdout] 52 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:46:17 [INFO] [stdout] | [INFO] [stdout] 46 | / if let Some((fi, label)) = detect_feed_bybit(s) { [INFO] [stdout] 47 | | if bybit_cnt[fi] < per_feed { [INFO] [stdout] 48 | | bybit_cnt[fi] += 1; [INFO] [stdout] 49 | | progressed = true; [INFO] [stdout] ... | [INFO] [stdout] 52 | | } [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] 46 ~ if let Some((fi, label)) = detect_feed_bybit(s) [INFO] [stdout] 47 ~ && bybit_cnt[fi] < per_feed { [INFO] [stdout] 48 | bybit_cnt[fi] += 1; [INFO] [stdout] 49 | progressed = true; [INFO] [stdout] 50 | println!("BYBIT [{} {}/{}]: {}", label, bybit_cnt[fi], per_feed, s); [INFO] [stdout] 51 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | / if let Ok(f) = bin_c.try_pop() { [INFO] [stdout] 57 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 58 | | if let Some((fi, label)) = detect_feed_binance(s) { [INFO] [stdout] 59 | | if bin_cnt[fi] < per_feed { [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] 56 ~ if let Ok(f) = bin_c.try_pop() [INFO] [stdout] 57 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 58 | if let Some((fi, label)) = detect_feed_binance(s) { [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/bin/dump_examples.rs:57:13 [INFO] [stdout] | [INFO] [stdout] 57 | / if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 58 | | if let Some((fi, label)) = detect_feed_binance(s) { [INFO] [stdout] 59 | | if bin_cnt[fi] < per_feed { [INFO] [stdout] 60 | | bin_cnt[fi] += 1; [INFO] [stdout] ... | [INFO] [stdout] 65 | | } [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] 57 ~ if let Ok(s) = std::str::from_utf8(&f.raw) [INFO] [stdout] 58 ~ && let Some((fi, label)) = detect_feed_binance(s) { [INFO] [stdout] 59 | if bin_cnt[fi] < per_feed { [INFO] [stdout] ... [INFO] [stdout] 63 | } [INFO] [stdout] 64 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:58:17 [INFO] [stdout] | [INFO] [stdout] 58 | / if let Some((fi, label)) = detect_feed_binance(s) { [INFO] [stdout] 59 | | if bin_cnt[fi] < per_feed { [INFO] [stdout] 60 | | bin_cnt[fi] += 1; [INFO] [stdout] 61 | | progressed = true; [INFO] [stdout] ... | [INFO] [stdout] 64 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 58 ~ if let Some((fi, label)) = detect_feed_binance(s) [INFO] [stdout] 59 ~ && bin_cnt[fi] < per_feed { [INFO] [stdout] 60 | bin_cnt[fi] += 1; [INFO] [stdout] 61 | progressed = true; [INFO] [stdout] 62 | println!("BINANCE [{} {}/{}]: {}", label, bin_cnt[fi], per_feed, s); [INFO] [stdout] 63 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:68:9 [INFO] [stdout] | [INFO] [stdout] 68 | / if let Ok(f) = gate_c.try_pop() { [INFO] [stdout] 69 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 70 | | if let Some((fi, label)) = detect_feed_gate(s) { [INFO] [stdout] 71 | | if gate_cnt[fi] < per_feed { [INFO] [stdout] ... | [INFO] [stdout] 78 | | } [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] 68 ~ if let Ok(f) = gate_c.try_pop() [INFO] [stdout] 69 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 70 | if let Some((fi, label)) = detect_feed_gate(s) { [INFO] [stdout] ... [INFO] [stdout] 76 | } [INFO] [stdout] 77 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:69:13 [INFO] [stdout] | [INFO] [stdout] 69 | / if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 70 | | if let Some((fi, label)) = detect_feed_gate(s) { [INFO] [stdout] 71 | | if gate_cnt[fi] < per_feed { [INFO] [stdout] 72 | | gate_cnt[fi] += 1; [INFO] [stdout] ... | [INFO] [stdout] 77 | | } [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] 69 ~ if let Ok(s) = std::str::from_utf8(&f.raw) [INFO] [stdout] 70 ~ && let Some((fi, label)) = detect_feed_gate(s) { [INFO] [stdout] 71 | if gate_cnt[fi] < per_feed { [INFO] [stdout] ... [INFO] [stdout] 75 | } [INFO] [stdout] 76 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:70:17 [INFO] [stdout] | [INFO] [stdout] 70 | / if let Some((fi, label)) = detect_feed_gate(s) { [INFO] [stdout] 71 | | if gate_cnt[fi] < per_feed { [INFO] [stdout] 72 | | gate_cnt[fi] += 1; [INFO] [stdout] 73 | | progressed = true; [INFO] [stdout] ... | [INFO] [stdout] 76 | | } [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] 70 ~ if let Some((fi, label)) = detect_feed_gate(s) [INFO] [stdout] 71 ~ && gate_cnt[fi] < per_feed { [INFO] [stdout] 72 | gate_cnt[fi] += 1; [INFO] [stdout] 73 | progressed = true; [INFO] [stdout] 74 | println!("GATE [{} {}/{}]: {}", label, gate_cnt[fi], per_feed, s); [INFO] [stdout] 75 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:80:9 [INFO] [stdout] | [INFO] [stdout] 80 | / if let Ok(f) = bit_c.try_pop() { [INFO] [stdout] 81 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 82 | | if let Some((fi, label)) = detect_feed_bitget(s) { [INFO] [stdout] 83 | | if bit_cnt[fi] < per_feed { [INFO] [stdout] ... | [INFO] [stdout] 90 | | } [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] 80 ~ if let Ok(f) = bit_c.try_pop() [INFO] [stdout] 81 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 82 | if let Some((fi, label)) = detect_feed_bitget(s) { [INFO] [stdout] ... [INFO] [stdout] 88 | } [INFO] [stdout] 89 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:81:13 [INFO] [stdout] | [INFO] [stdout] 81 | / if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 82 | | if let Some((fi, label)) = detect_feed_bitget(s) { [INFO] [stdout] 83 | | if bit_cnt[fi] < per_feed { [INFO] [stdout] 84 | | bit_cnt[fi] += 1; [INFO] [stdout] ... | [INFO] [stdout] 89 | | } [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] 81 ~ if let Ok(s) = std::str::from_utf8(&f.raw) [INFO] [stdout] 82 ~ && let Some((fi, label)) = detect_feed_bitget(s) { [INFO] [stdout] 83 | if bit_cnt[fi] < per_feed { [INFO] [stdout] ... [INFO] [stdout] 87 | } [INFO] [stdout] 88 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:82:17 [INFO] [stdout] | [INFO] [stdout] 82 | / if let Some((fi, label)) = detect_feed_bitget(s) { [INFO] [stdout] 83 | | if bit_cnt[fi] < per_feed { [INFO] [stdout] 84 | | bit_cnt[fi] += 1; [INFO] [stdout] 85 | | progressed = true; [INFO] [stdout] ... | [INFO] [stdout] 88 | | } [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] 82 ~ if let Some((fi, label)) = detect_feed_bitget(s) [INFO] [stdout] 83 ~ && bit_cnt[fi] < per_feed { [INFO] [stdout] 84 | bit_cnt[fi] += 1; [INFO] [stdout] 85 | progressed = true; [INFO] [stdout] 86 | println!("BITGET [{} {}/{}]: {}", label, bit_cnt[fi], per_feed, s); [INFO] [stdout] 87 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/bybit_collect_csv.rs:49:17 [INFO] [stdout] | [INFO] [stdout] 49 | / if topic.starts_with("orderbook.") { [INFO] [stdout] 50 | | if let Some((bid, ask)) = extract_top_prices(s) { [INFO] [stdout] 51 | | let feed = if topic.starts_with("orderbook.1.") { [INFO] [stdout] 52 | | "bbo" [INFO] [stdout] ... | [INFO] [stdout] 69 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 49 ~ if topic.starts_with("orderbook.") [INFO] [stdout] 50 ~ && let Some((bid, ask)) = extract_top_prices(s) { [INFO] [stdout] 51 | let feed = if topic.starts_with("orderbook.1.") { [INFO] [stdout] ... [INFO] [stdout] 67 | } [INFO] [stdout] 68 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/bybit_collect_csv.rs:62:25 [INFO] [stdout] | [INFO] [stdout] 62 | / if n % 256 == 0 { [INFO] [stdout] 63 | | if let Err(err) = w.flush() { [INFO] [stdout] 64 | | eprintln!("ERROR: failed to flush CSV: {err}"); [INFO] [stdout] 65 | | break; [INFO] [stdout] 66 | | } [INFO] [stdout] 67 | | } [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] 62 ~ if n % 256 == 0 [INFO] [stdout] 63 ~ && let Err(err) = w.flush() { [INFO] [stdout] 64 | eprintln!("ERROR: failed to flush CSV: {err}"); [INFO] [stdout] 65 | break; [INFO] [stdout] 66 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/bybit_collect_csv.rs:62:28 [INFO] [stdout] | [INFO] [stdout] 62 | if n % 256 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `n.is_multiple_of(256)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/bin/collect_all_csv.rs:19:1 [INFO] [stdout] | [INFO] [stdout] 19 | / fn write_csv_row( [INFO] [stdout] 20 | | writer: &mut BufWriter, [INFO] [stdout] 21 | | ts: u64, [INFO] [stdout] 22 | | exchange: &str, [INFO] [stdout] ... | [INFO] [stdout] 28 | | info: Option<&str>, [INFO] [stdout] 29 | | ) { [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: use of `unwrap_or_else` to construct default value [INFO] [stdout] --> src/bin/collect_all_csv.rs:33:10 [INFO] [stdout] | [INFO] [stdout] 33 | .unwrap_or_else(String::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | / if st.bybit.orderbook.seq != last_bybit.0 { [INFO] [stdout] 96 | | if let Some(p) = restore_price(st.bybit.orderbook.price, &st.demean.bybit) { [INFO] [stdout] 97 | | let ts = st.bybit.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] 98 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 111 | | } [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] 95 ~ if st.bybit.orderbook.seq != last_bybit.0 [INFO] [stdout] 96 ~ && let Some(p) = restore_price(st.bybit.orderbook.price, &st.demean.bybit) { [INFO] [stdout] 97 | let ts = st.bybit.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 109 | last_bybit.0 = st.bybit.orderbook.seq; [INFO] [stdout] 110 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:112:9 [INFO] [stdout] | [INFO] [stdout] 112 | / if st.bybit.bbo.seq != last_bybit.1 { [INFO] [stdout] 113 | | if let Some(p) = restore_price(st.bybit.bbo.price, &st.demean.bybit) { [INFO] [stdout] 114 | | let ts = st.bybit.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] 115 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 128 | | } [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] 112 ~ if st.bybit.bbo.seq != last_bybit.1 [INFO] [stdout] 113 ~ && let Some(p) = restore_price(st.bybit.bbo.price, &st.demean.bybit) { [INFO] [stdout] 114 | let ts = st.bybit.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 126 | last_bybit.1 = st.bybit.bbo.seq; [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:146:9 [INFO] [stdout] | [INFO] [stdout] 146 | / if st.binance.orderbook.seq != last_binance.0 { [INFO] [stdout] 147 | | if let Some(p) = restore_price(st.binance.orderbook.price, &st.demean.binance) { [INFO] [stdout] 148 | | let ts = st.binance.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] 149 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 162 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 146 ~ if st.binance.orderbook.seq != last_binance.0 [INFO] [stdout] 147 ~ && let Some(p) = restore_price(st.binance.orderbook.price, &st.demean.binance) { [INFO] [stdout] 148 | let ts = st.binance.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 160 | last_binance.0 = st.binance.orderbook.seq; [INFO] [stdout] 161 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:163:9 [INFO] [stdout] | [INFO] [stdout] 163 | / if st.binance.bbo.seq != last_binance.1 { [INFO] [stdout] 164 | | if let Some(p) = restore_price(st.binance.bbo.price, &st.demean.binance) { [INFO] [stdout] 165 | | let ts = st.binance.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] 166 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 179 | | } [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] 163 ~ if st.binance.bbo.seq != last_binance.1 [INFO] [stdout] 164 ~ && let Some(p) = restore_price(st.binance.bbo.price, &st.demean.binance) { [INFO] [stdout] 165 | let ts = st.binance.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 177 | last_binance.1 = st.binance.bbo.seq; [INFO] [stdout] 178 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | / if st.gate.orderbook.seq != last_gate.0 { [INFO] [stdout] 198 | | if let Some(p) = st.gate.orderbook.price { [INFO] [stdout] 199 | | let ts = st.gate.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] 200 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 213 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 197 ~ if st.gate.orderbook.seq != last_gate.0 [INFO] [stdout] 198 ~ && let Some(p) = st.gate.orderbook.price { [INFO] [stdout] 199 | let ts = st.gate.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 211 | last_gate.0 = st.gate.orderbook.seq; [INFO] [stdout] 212 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:214:9 [INFO] [stdout] | [INFO] [stdout] 214 | / if st.gate.bbo.seq != last_gate.1 { [INFO] [stdout] 215 | | if let Some(p) = st.gate.bbo.price { [INFO] [stdout] 216 | | let ts = st.gate.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] 217 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 230 | | } [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] 214 ~ if st.gate.bbo.seq != last_gate.1 [INFO] [stdout] 215 ~ && let Some(p) = st.gate.bbo.price { [INFO] [stdout] 216 | let ts = st.gate.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 228 | last_gate.1 = st.gate.bbo.seq; [INFO] [stdout] 229 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:265:9 [INFO] [stdout] | [INFO] [stdout] 265 | / if st.bitget.orderbook.seq != last_bitget.0 { [INFO] [stdout] 266 | | if let Some(p) = restore_price(st.bitget.orderbook.price, &st.demean.bitget) { [INFO] [stdout] 267 | | let ts = st.bitget.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] 268 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 281 | | } [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] 265 ~ if st.bitget.orderbook.seq != last_bitget.0 [INFO] [stdout] 266 ~ && let Some(p) = restore_price(st.bitget.orderbook.price, &st.demean.bitget) { [INFO] [stdout] 267 | let ts = st.bitget.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 279 | last_bitget.0 = st.bitget.orderbook.seq; [INFO] [stdout] 280 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:282:9 [INFO] [stdout] | [INFO] [stdout] 282 | / if st.bitget.bbo.seq != last_bitget.1 { [INFO] [stdout] 283 | | if let Some(p) = restore_price(st.bitget.bbo.price, &st.demean.bitget) { [INFO] [stdout] 284 | | let ts = st.bitget.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] 285 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 298 | | } [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] 282 ~ if st.bitget.bbo.seq != last_bitget.1 [INFO] [stdout] 283 ~ && let Some(p) = restore_price(st.bitget.bbo.price, &st.demean.bitget) { [INFO] [stdout] 284 | let ts = st.bitget.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 296 | last_bitget.1 = st.bitget.bbo.seq; [INFO] [stdout] 297 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:317:9 [INFO] [stdout] | [INFO] [stdout] 317 | / if st.mexc.orderbook.seq != last_mexc.0 { [INFO] [stdout] 318 | | if let Some(p) = restore_price(st.mexc.orderbook.price, &st.demean.mexc) { [INFO] [stdout] 319 | | let ts = st.mexc.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] 320 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 333 | | } [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] 317 ~ if st.mexc.orderbook.seq != last_mexc.0 [INFO] [stdout] 318 ~ && let Some(p) = restore_price(st.mexc.orderbook.price, &st.demean.mexc) { [INFO] [stdout] 319 | let ts = st.mexc.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 331 | last_mexc.0 = st.mexc.orderbook.seq; [INFO] [stdout] 332 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:334:9 [INFO] [stdout] | [INFO] [stdout] 334 | / if st.mexc.bbo.seq != last_mexc.1 { [INFO] [stdout] 335 | | if let Some(p) = restore_price(st.mexc.bbo.price, &st.demean.mexc) { [INFO] [stdout] 336 | | let ts = st.mexc.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] 337 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 350 | | } [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] 334 ~ if st.mexc.bbo.seq != last_mexc.1 [INFO] [stdout] 335 ~ && let Some(p) = restore_price(st.mexc.bbo.price, &st.demean.mexc) { [INFO] [stdout] 336 | let ts = st.mexc.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 348 | last_mexc.1 = st.mexc.bbo.seq; [INFO] [stdout] 349 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/bybit_collect_csv.rs:49:17 [INFO] [stdout] | [INFO] [stdout] 49 | / if topic.starts_with("orderbook.") { [INFO] [stdout] 50 | | if let Some((bid, ask)) = extract_top_prices(s) { [INFO] [stdout] 51 | | let feed = if topic.starts_with("orderbook.1.") { [INFO] [stdout] 52 | | "bbo" [INFO] [stdout] ... | [INFO] [stdout] 69 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 49 ~ if topic.starts_with("orderbook.") [INFO] [stdout] 50 ~ && let Some((bid, ask)) = extract_top_prices(s) { [INFO] [stdout] 51 | let feed = if topic.starts_with("orderbook.1.") { [INFO] [stdout] ... [INFO] [stdout] 67 | } [INFO] [stdout] 68 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/bybit_collect_csv.rs:62:25 [INFO] [stdout] | [INFO] [stdout] 62 | / if n % 256 == 0 { [INFO] [stdout] 63 | | if let Err(err) = w.flush() { [INFO] [stdout] 64 | | eprintln!("ERROR: failed to flush CSV: {err}"); [INFO] [stdout] 65 | | break; [INFO] [stdout] 66 | | } [INFO] [stdout] 67 | | } [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] 62 ~ if n % 256 == 0 [INFO] [stdout] 63 ~ && let Err(err) = w.flush() { [INFO] [stdout] 64 | eprintln!("ERROR: failed to flush CSV: {err}"); [INFO] [stdout] 65 | break; [INFO] [stdout] 66 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/bybit_collect_csv.rs:62:28 [INFO] [stdout] | [INFO] [stdout] 62 | if n % 256 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `n.is_multiple_of(256)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:62:12 [INFO] [stdout] | [INFO] [stdout] 62 | if limit.map_or(true, |cap| counts[0] < cap) { [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_none_or` instead [INFO] [stdout] | [INFO] [stdout] 62 - if limit.map_or(true, |cap| counts[0] < cap) { [INFO] [stdout] 62 + if limit.is_none_or(|cap| counts[0] < cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:72:20 [INFO] [stdout] | [INFO] [stdout] 72 | if limit.map_or(false, |cap| counts[0] >= cap) { [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] 72 - if limit.map_or(false, |cap| counts[0] >= cap) { [INFO] [stdout] 72 + if limit.is_some_and(|cap| counts[0] >= cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:78:12 [INFO] [stdout] | [INFO] [stdout] 78 | if limit.map_or(true, |cap| counts[1] < cap) { [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] 78 - if limit.map_or(true, |cap| counts[1] < cap) { [INFO] [stdout] 78 + if limit.is_none_or(|cap| counts[1] < cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:88:20 [INFO] [stdout] | [INFO] [stdout] 88 | if limit.map_or(false, |cap| counts[1] >= cap) { [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] 88 - if limit.map_or(false, |cap| counts[1] >= cap) { [INFO] [stdout] 88 + if limit.is_some_and(|cap| counts[1] >= cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:94:12 [INFO] [stdout] | [INFO] [stdout] 94 | if limit.map_or(true, |cap| counts[2] < cap) { [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] 94 - if limit.map_or(true, |cap| counts[2] < cap) { [INFO] [stdout] 94 + if limit.is_none_or(|cap| counts[2] < cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:104:20 [INFO] [stdout] | [INFO] [stdout] 104 | if limit.map_or(false, |cap| counts[2] >= cap) { [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] 104 - if limit.map_or(false, |cap| counts[2] >= cap) { [INFO] [stdout] 104 + if limit.is_some_and(|cap| counts[2] >= cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:110:12 [INFO] [stdout] | [INFO] [stdout] 110 | if limit.map_or(true, |cap| counts[3] < cap) { [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] 110 - if limit.map_or(true, |cap| counts[3] < cap) { [INFO] [stdout] 110 + if limit.is_none_or(|cap| counts[3] < cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:120:20 [INFO] [stdout] | [INFO] [stdout] 120 | if limit.map_or(false, |cap| counts[3] >= cap) { [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] 120 - if limit.map_or(false, |cap| counts[3] >= cap) { [INFO] [stdout] 120 + if limit.is_some_and(|cap| counts[3] >= cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_trade_frames.rs:126:9 [INFO] [stdout] | [INFO] [stdout] 126 | / if let Some(cap) = limit { [INFO] [stdout] 127 | | if counts.iter().all(|&c| c >= cap) { [INFO] [stdout] 128 | | break; [INFO] [stdout] 129 | | } [INFO] [stdout] 130 | | } [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] 126 ~ if let Some(cap) = limit [INFO] [stdout] 127 ~ && counts.iter().all(|&c| c >= cap) { [INFO] [stdout] 128 | break; [INFO] [stdout] 129 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | / if left[0] > 0 { [INFO] [stdout] 33 | | if let Ok(f) = bybit_c.try_pop() { [INFO] [stdout] 34 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 35 | | println!("BYBIT: {}", s); [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] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if left[0] > 0 [INFO] [stdout] 33 ~ && let Ok(f) = bybit_c.try_pop() { [INFO] [stdout] 34 | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] ... [INFO] [stdout] 38 | } [INFO] [stdout] 39 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | / if let Ok(f) = bybit_c.try_pop() { [INFO] [stdout] 34 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 35 | | println!("BYBIT: {}", s); [INFO] [stdout] 36 | | left[0] -= 1; [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] 33 ~ if let Ok(f) = bybit_c.try_pop() [INFO] [stdout] 34 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 35 | println!("BYBIT: {}", s); [INFO] [stdout] 36 | left[0] -= 1; [INFO] [stdout] 37 | wrote = true; [INFO] [stdout] 38 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | / if left[1] > 0 { [INFO] [stdout] 42 | | if let Ok(f) = bin_c.try_pop() { [INFO] [stdout] 43 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 44 | | println!("BINANCE: {}", s); [INFO] [stdout] ... | [INFO] [stdout] 49 | | } [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] 41 ~ if left[1] > 0 [INFO] [stdout] 42 ~ && let Ok(f) = bin_c.try_pop() { [INFO] [stdout] 43 | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] ... [INFO] [stdout] 47 | } [INFO] [stdout] 48 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:42:13 [INFO] [stdout] | [INFO] [stdout] 42 | / if let Ok(f) = bin_c.try_pop() { [INFO] [stdout] 43 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 44 | | println!("BINANCE: {}", s); [INFO] [stdout] 45 | | left[1] -= 1; [INFO] [stdout] ... | [INFO] [stdout] 48 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 42 ~ if let Ok(f) = bin_c.try_pop() [INFO] [stdout] 43 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 44 | println!("BINANCE: {}", s); [INFO] [stdout] 45 | left[1] -= 1; [INFO] [stdout] 46 | wrote = true; [INFO] [stdout] 47 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | / if left[2] > 0 { [INFO] [stdout] 51 | | if let Ok(f) = gate_c.try_pop() { [INFO] [stdout] 52 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 53 | | println!("GATE: {}", s); [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#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 50 ~ if left[2] > 0 [INFO] [stdout] 51 ~ && let Ok(f) = gate_c.try_pop() { [INFO] [stdout] 52 | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] ... [INFO] [stdout] 56 | } [INFO] [stdout] 57 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | / if let Ok(f) = gate_c.try_pop() { [INFO] [stdout] 52 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 53 | | println!("GATE: {}", s); [INFO] [stdout] 54 | | left[2] -= 1; [INFO] [stdout] ... | [INFO] [stdout] 57 | | } [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] 51 ~ if let Ok(f) = gate_c.try_pop() [INFO] [stdout] 52 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 53 | println!("GATE: {}", s); [INFO] [stdout] 54 | left[2] -= 1; [INFO] [stdout] 55 | wrote = true; [INFO] [stdout] 56 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 59 | / if left[3] > 0 { [INFO] [stdout] 60 | | if let Ok(f) = bit_c.try_pop() { [INFO] [stdout] 61 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 62 | | println!("BITGET: {}", s); [INFO] [stdout] ... | [INFO] [stdout] 67 | | } [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 left[3] > 0 [INFO] [stdout] 60 ~ && let Ok(f) = bit_c.try_pop() { [INFO] [stdout] 61 | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] ... [INFO] [stdout] 65 | } [INFO] [stdout] 66 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:60:13 [INFO] [stdout] | [INFO] [stdout] 60 | / if let Ok(f) = bit_c.try_pop() { [INFO] [stdout] 61 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 62 | | println!("BITGET: {}", s); [INFO] [stdout] 63 | | left[3] -= 1; [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] 60 ~ if let Ok(f) = bit_c.try_pop() [INFO] [stdout] 61 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 62 | println!("BITGET: {}", s); [INFO] [stdout] 63 | left[3] -= 1; [INFO] [stdout] 64 | wrote = true; [INFO] [stdout] 65 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:110:21 [INFO] [stdout] | [INFO] [stdout] 110 | snap.price = Some(price); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `rust_test::base_classes::state::FeedSnap { price: Some(price), ts_ns: Some(event.ts_ns), direction: event.direction, size: event.quantity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:109:21 [INFO] [stdout] | [INFO] [stdout] 109 | let mut snap = FeedSnap::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:130:21 [INFO] [stdout] | [INFO] [stdout] 130 | snap.price = Some(price); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `rust_test::base_classes::state::FeedSnap { price: Some(price), ts_ns: Some(event.ts_ns), direction: event.direction, size: event.quantity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:129:21 [INFO] [stdout] | [INFO] [stdout] 129 | let mut snap = FeedSnap::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:149:17 [INFO] [stdout] | [INFO] [stdout] 149 | snap.price = Some(event.price); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `rust_test::base_classes::state::FeedSnap { price: Some(event.price), ts_ns: Some(event.ts_ns), direction: event.direction, size: event.quantity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:148:17 [INFO] [stdout] | [INFO] [stdout] 148 | let mut snap = FeedSnap::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:168:21 [INFO] [stdout] | [INFO] [stdout] 168 | snap.price = Some(price); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `rust_test::base_classes::state::FeedSnap { price: Some(price), ts_ns: Some(event.ts_ns), direction: event.direction, size: event.quantity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:167:21 [INFO] [stdout] | [INFO] [stdout] 167 | let mut snap = FeedSnap::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:188:21 [INFO] [stdout] | [INFO] [stdout] 188 | snap.price = Some(price); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `rust_test::base_classes::state::FeedSnap { price: Some(price), ts_ns: Some(event.ts_ns), direction: event.direction, size: event.quantity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:187:21 [INFO] [stdout] | [INFO] [stdout] 187 | let mut snap = FeedSnap::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:62:12 [INFO] [stdout] | [INFO] [stdout] 62 | if limit.map_or(true, |cap| counts[0] < cap) { [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_none_or` instead [INFO] [stdout] | [INFO] [stdout] 62 - if limit.map_or(true, |cap| counts[0] < cap) { [INFO] [stdout] 62 + if limit.is_none_or(|cap| counts[0] < cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:72:20 [INFO] [stdout] | [INFO] [stdout] 72 | if limit.map_or(false, |cap| counts[0] >= cap) { [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] 72 - if limit.map_or(false, |cap| counts[0] >= cap) { [INFO] [stdout] 72 + if limit.is_some_and(|cap| counts[0] >= cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:78:12 [INFO] [stdout] | [INFO] [stdout] 78 | if limit.map_or(true, |cap| counts[1] < cap) { [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] 78 - if limit.map_or(true, |cap| counts[1] < cap) { [INFO] [stdout] 78 + if limit.is_none_or(|cap| counts[1] < cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:88:20 [INFO] [stdout] | [INFO] [stdout] 88 | if limit.map_or(false, |cap| counts[1] >= cap) { [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] 88 - if limit.map_or(false, |cap| counts[1] >= cap) { [INFO] [stdout] 88 + if limit.is_some_and(|cap| counts[1] >= cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:94:12 [INFO] [stdout] | [INFO] [stdout] 94 | if limit.map_or(true, |cap| counts[2] < cap) { [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] 94 - if limit.map_or(true, |cap| counts[2] < cap) { [INFO] [stdout] 94 + if limit.is_none_or(|cap| counts[2] < cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:104:20 [INFO] [stdout] | [INFO] [stdout] 104 | if limit.map_or(false, |cap| counts[2] >= cap) { [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] 104 - if limit.map_or(false, |cap| counts[2] >= cap) { [INFO] [stdout] 104 + if limit.is_some_and(|cap| counts[2] >= cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:110:12 [INFO] [stdout] | [INFO] [stdout] 110 | if limit.map_or(true, |cap| counts[3] < cap) { [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] 110 - if limit.map_or(true, |cap| counts[3] < cap) { [INFO] [stdout] 110 + if limit.is_none_or(|cap| counts[3] < cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/dump_trade_frames.rs:120:20 [INFO] [stdout] | [INFO] [stdout] 120 | if limit.map_or(false, |cap| counts[3] >= cap) { [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] 120 - if limit.map_or(false, |cap| counts[3] >= cap) { [INFO] [stdout] 120 + if limit.is_some_and(|cap| counts[3] >= cap) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_trade_frames.rs:126:9 [INFO] [stdout] | [INFO] [stdout] 126 | / if let Some(cap) = limit { [INFO] [stdout] 127 | | if counts.iter().all(|&c| c >= cap) { [INFO] [stdout] 128 | | break; [INFO] [stdout] 129 | | } [INFO] [stdout] 130 | | } [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] 126 ~ if let Some(cap) = limit [INFO] [stdout] 127 ~ && counts.iter().all(|&c| c >= cap) { [INFO] [stdout] 128 | break; [INFO] [stdout] 129 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/okx_orderbook_debug.rs:72:17 [INFO] [stdout] | [INFO] [stdout] 72 | / if book.apply(&msg) { [INFO] [stdout] 73 | | log_book_state(book, inst_id, "books"); [INFO] [stdout] 74 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 71 ~ "books" [INFO] [stdout] 72 ~ if book.apply(&msg) => { [INFO] [stdout] 73 | log_book_state(book, inst_id, "books"); [INFO] [stdout] 74 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/okx_orderbook_debug.rs:77:17 [INFO] [stdout] | [INFO] [stdout] 77 | / if book.apply_bbo(&msg) { [INFO] [stdout] 78 | | log_book_state(book, inst_id, "bbo-tbt"); [INFO] [stdout] 79 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 76 ~ "bbo-tbt" [INFO] [stdout] 77 ~ if book.apply_bbo(&msg) => { [INFO] [stdout] 78 | log_book_state(book, inst_id, "bbo-tbt"); [INFO] [stdout] 79 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | / if let Ok(f) = bybit_c.try_pop() { [INFO] [stdout] 45 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 46 | | if let Some((fi, label)) = detect_feed_bybit(s) { [INFO] [stdout] 47 | | if bybit_cnt[fi] < per_feed { [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 44 ~ if let Ok(f) = bybit_c.try_pop() [INFO] [stdout] 45 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 46 | if let Some((fi, label)) = detect_feed_bybit(s) { [INFO] [stdout] ... [INFO] [stdout] 52 | } [INFO] [stdout] 53 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | / if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 46 | | if let Some((fi, label)) = detect_feed_bybit(s) { [INFO] [stdout] 47 | | if bybit_cnt[fi] < per_feed { [INFO] [stdout] 48 | | bybit_cnt[fi] += 1; [INFO] [stdout] ... | [INFO] [stdout] 53 | | } [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] 45 ~ if let Ok(s) = std::str::from_utf8(&f.raw) [INFO] [stdout] 46 ~ && let Some((fi, label)) = detect_feed_bybit(s) { [INFO] [stdout] 47 | if bybit_cnt[fi] < per_feed { [INFO] [stdout] ... [INFO] [stdout] 51 | } [INFO] [stdout] 52 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:46:17 [INFO] [stdout] | [INFO] [stdout] 46 | / if let Some((fi, label)) = detect_feed_bybit(s) { [INFO] [stdout] 47 | | if bybit_cnt[fi] < per_feed { [INFO] [stdout] 48 | | bybit_cnt[fi] += 1; [INFO] [stdout] 49 | | progressed = true; [INFO] [stdout] ... | [INFO] [stdout] 52 | | } [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] 46 ~ if let Some((fi, label)) = detect_feed_bybit(s) [INFO] [stdout] 47 ~ && bybit_cnt[fi] < per_feed { [INFO] [stdout] 48 | bybit_cnt[fi] += 1; [INFO] [stdout] 49 | progressed = true; [INFO] [stdout] 50 | println!("BYBIT [{} {}/{}]: {}", label, bybit_cnt[fi], per_feed, s); [INFO] [stdout] 51 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | / if let Ok(f) = bin_c.try_pop() { [INFO] [stdout] 57 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 58 | | if let Some((fi, label)) = detect_feed_binance(s) { [INFO] [stdout] 59 | | if bin_cnt[fi] < per_feed { [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] 56 ~ if let Ok(f) = bin_c.try_pop() [INFO] [stdout] 57 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 58 | if let Some((fi, label)) = detect_feed_binance(s) { [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/bin/dump_examples.rs:57:13 [INFO] [stdout] | [INFO] [stdout] 57 | / if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 58 | | if let Some((fi, label)) = detect_feed_binance(s) { [INFO] [stdout] 59 | | if bin_cnt[fi] < per_feed { [INFO] [stdout] 60 | | bin_cnt[fi] += 1; [INFO] [stdout] ... | [INFO] [stdout] 65 | | } [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] 57 ~ if let Ok(s) = std::str::from_utf8(&f.raw) [INFO] [stdout] 58 ~ && let Some((fi, label)) = detect_feed_binance(s) { [INFO] [stdout] 59 | if bin_cnt[fi] < per_feed { [INFO] [stdout] ... [INFO] [stdout] 63 | } [INFO] [stdout] 64 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:58:17 [INFO] [stdout] | [INFO] [stdout] 58 | / if let Some((fi, label)) = detect_feed_binance(s) { [INFO] [stdout] 59 | | if bin_cnt[fi] < per_feed { [INFO] [stdout] 60 | | bin_cnt[fi] += 1; [INFO] [stdout] 61 | | progressed = true; [INFO] [stdout] ... | [INFO] [stdout] 64 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 58 ~ if let Some((fi, label)) = detect_feed_binance(s) [INFO] [stdout] 59 ~ && bin_cnt[fi] < per_feed { [INFO] [stdout] 60 | bin_cnt[fi] += 1; [INFO] [stdout] 61 | progressed = true; [INFO] [stdout] 62 | println!("BINANCE [{} {}/{}]: {}", label, bin_cnt[fi], per_feed, s); [INFO] [stdout] 63 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:68:9 [INFO] [stdout] | [INFO] [stdout] 68 | / if let Ok(f) = gate_c.try_pop() { [INFO] [stdout] 69 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 70 | | if let Some((fi, label)) = detect_feed_gate(s) { [INFO] [stdout] 71 | | if gate_cnt[fi] < per_feed { [INFO] [stdout] ... | [INFO] [stdout] 78 | | } [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] 68 ~ if let Ok(f) = gate_c.try_pop() [INFO] [stdout] 69 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 70 | if let Some((fi, label)) = detect_feed_gate(s) { [INFO] [stdout] ... [INFO] [stdout] 76 | } [INFO] [stdout] 77 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:69:13 [INFO] [stdout] | [INFO] [stdout] 69 | / if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 70 | | if let Some((fi, label)) = detect_feed_gate(s) { [INFO] [stdout] 71 | | if gate_cnt[fi] < per_feed { [INFO] [stdout] 72 | | gate_cnt[fi] += 1; [INFO] [stdout] ... | [INFO] [stdout] 77 | | } [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] 69 ~ if let Ok(s) = std::str::from_utf8(&f.raw) [INFO] [stdout] 70 ~ && let Some((fi, label)) = detect_feed_gate(s) { [INFO] [stdout] 71 | if gate_cnt[fi] < per_feed { [INFO] [stdout] ... [INFO] [stdout] 75 | } [INFO] [stdout] 76 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:70:17 [INFO] [stdout] | [INFO] [stdout] 70 | / if let Some((fi, label)) = detect_feed_gate(s) { [INFO] [stdout] 71 | | if gate_cnt[fi] < per_feed { [INFO] [stdout] 72 | | gate_cnt[fi] += 1; [INFO] [stdout] 73 | | progressed = true; [INFO] [stdout] ... | [INFO] [stdout] 76 | | } [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] 70 ~ if let Some((fi, label)) = detect_feed_gate(s) [INFO] [stdout] 71 ~ && gate_cnt[fi] < per_feed { [INFO] [stdout] 72 | gate_cnt[fi] += 1; [INFO] [stdout] 73 | progressed = true; [INFO] [stdout] 74 | println!("GATE [{} {}/{}]: {}", label, gate_cnt[fi], per_feed, s); [INFO] [stdout] 75 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:80:9 [INFO] [stdout] | [INFO] [stdout] 80 | / if let Ok(f) = bit_c.try_pop() { [INFO] [stdout] 81 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 82 | | if let Some((fi, label)) = detect_feed_bitget(s) { [INFO] [stdout] 83 | | if bit_cnt[fi] < per_feed { [INFO] [stdout] ... | [INFO] [stdout] 90 | | } [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] 80 ~ if let Ok(f) = bit_c.try_pop() [INFO] [stdout] 81 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 82 | if let Some((fi, label)) = detect_feed_bitget(s) { [INFO] [stdout] ... [INFO] [stdout] 88 | } [INFO] [stdout] 89 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:81:13 [INFO] [stdout] | [INFO] [stdout] 81 | / if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 82 | | if let Some((fi, label)) = detect_feed_bitget(s) { [INFO] [stdout] 83 | | if bit_cnt[fi] < per_feed { [INFO] [stdout] 84 | | bit_cnt[fi] += 1; [INFO] [stdout] ... | [INFO] [stdout] 89 | | } [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] 81 ~ if let Ok(s) = std::str::from_utf8(&f.raw) [INFO] [stdout] 82 ~ && let Some((fi, label)) = detect_feed_bitget(s) { [INFO] [stdout] 83 | if bit_cnt[fi] < per_feed { [INFO] [stdout] ... [INFO] [stdout] 87 | } [INFO] [stdout] 88 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_examples.rs:82:17 [INFO] [stdout] | [INFO] [stdout] 82 | / if let Some((fi, label)) = detect_feed_bitget(s) { [INFO] [stdout] 83 | | if bit_cnt[fi] < per_feed { [INFO] [stdout] 84 | | bit_cnt[fi] += 1; [INFO] [stdout] 85 | | progressed = true; [INFO] [stdout] ... | [INFO] [stdout] 88 | | } [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] 82 ~ if let Some((fi, label)) = detect_feed_bitget(s) [INFO] [stdout] 83 ~ && bit_cnt[fi] < per_feed { [INFO] [stdout] 84 | bit_cnt[fi] += 1; [INFO] [stdout] 85 | progressed = true; [INFO] [stdout] 86 | println!("BITGET [{} {}/{}]: {}", label, bit_cnt[fi], per_feed, s); [INFO] [stdout] 87 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | / if left[0] > 0 { [INFO] [stdout] 33 | | if let Ok(f) = bybit_c.try_pop() { [INFO] [stdout] 34 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 35 | | println!("BYBIT: {}", s); [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] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if left[0] > 0 [INFO] [stdout] 33 ~ && let Ok(f) = bybit_c.try_pop() { [INFO] [stdout] 34 | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] ... [INFO] [stdout] 38 | } [INFO] [stdout] 39 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | / if let Ok(f) = bybit_c.try_pop() { [INFO] [stdout] 34 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 35 | | println!("BYBIT: {}", s); [INFO] [stdout] 36 | | left[0] -= 1; [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] 33 ~ if let Ok(f) = bybit_c.try_pop() [INFO] [stdout] 34 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 35 | println!("BYBIT: {}", s); [INFO] [stdout] 36 | left[0] -= 1; [INFO] [stdout] 37 | wrote = true; [INFO] [stdout] 38 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | / if left[1] > 0 { [INFO] [stdout] 42 | | if let Ok(f) = bin_c.try_pop() { [INFO] [stdout] 43 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 44 | | println!("BINANCE: {}", s); [INFO] [stdout] ... | [INFO] [stdout] 49 | | } [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] 41 ~ if left[1] > 0 [INFO] [stdout] 42 ~ && let Ok(f) = bin_c.try_pop() { [INFO] [stdout] 43 | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] ... [INFO] [stdout] 47 | } [INFO] [stdout] 48 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:42:13 [INFO] [stdout] | [INFO] [stdout] 42 | / if let Ok(f) = bin_c.try_pop() { [INFO] [stdout] 43 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 44 | | println!("BINANCE: {}", s); [INFO] [stdout] 45 | | left[1] -= 1; [INFO] [stdout] ... | [INFO] [stdout] 48 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 42 ~ if let Ok(f) = bin_c.try_pop() [INFO] [stdout] 43 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 44 | println!("BINANCE: {}", s); [INFO] [stdout] 45 | left[1] -= 1; [INFO] [stdout] 46 | wrote = true; [INFO] [stdout] 47 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | / if left[2] > 0 { [INFO] [stdout] 51 | | if let Ok(f) = gate_c.try_pop() { [INFO] [stdout] 52 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 53 | | println!("GATE: {}", s); [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#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 50 ~ if left[2] > 0 [INFO] [stdout] 51 ~ && let Ok(f) = gate_c.try_pop() { [INFO] [stdout] 52 | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] ... [INFO] [stdout] 56 | } [INFO] [stdout] 57 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | / if let Ok(f) = gate_c.try_pop() { [INFO] [stdout] 52 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 53 | | println!("GATE: {}", s); [INFO] [stdout] 54 | | left[2] -= 1; [INFO] [stdout] ... | [INFO] [stdout] 57 | | } [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] 51 ~ if let Ok(f) = gate_c.try_pop() [INFO] [stdout] 52 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 53 | println!("GATE: {}", s); [INFO] [stdout] 54 | left[2] -= 1; [INFO] [stdout] 55 | wrote = true; [INFO] [stdout] 56 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 59 | / if left[3] > 0 { [INFO] [stdout] 60 | | if let Ok(f) = bit_c.try_pop() { [INFO] [stdout] 61 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 62 | | println!("BITGET: {}", s); [INFO] [stdout] ... | [INFO] [stdout] 67 | | } [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 left[3] > 0 [INFO] [stdout] 60 ~ && let Ok(f) = bit_c.try_pop() { [INFO] [stdout] 61 | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] ... [INFO] [stdout] 65 | } [INFO] [stdout] 66 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/dump_ws.rs:60:13 [INFO] [stdout] | [INFO] [stdout] 60 | / if let Ok(f) = bit_c.try_pop() { [INFO] [stdout] 61 | | if let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 62 | | println!("BITGET: {}", s); [INFO] [stdout] 63 | | left[3] -= 1; [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] 60 ~ if let Ok(f) = bit_c.try_pop() [INFO] [stdout] 61 ~ && let Ok(s) = std::str::from_utf8(&f.raw) { [INFO] [stdout] 62 | println!("BITGET: {}", s); [INFO] [stdout] 63 | left[3] -= 1; [INFO] [stdout] 64 | wrote = true; [INFO] [stdout] 65 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/okx_orderbook_debug.rs:72:17 [INFO] [stdout] | [INFO] [stdout] 72 | / if book.apply(&msg) { [INFO] [stdout] 73 | | log_book_state(book, inst_id, "books"); [INFO] [stdout] 74 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 71 ~ "books" [INFO] [stdout] 72 ~ if book.apply(&msg) => { [INFO] [stdout] 73 | log_book_state(book, inst_id, "books"); [INFO] [stdout] 74 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/okx_orderbook_debug.rs:77:17 [INFO] [stdout] | [INFO] [stdout] 77 | / if book.apply_bbo(&msg) { [INFO] [stdout] 78 | | log_book_state(book, inst_id, "bbo-tbt"); [INFO] [stdout] 79 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 76 ~ "bbo-tbt" [INFO] [stdout] 77 ~ if book.apply_bbo(&msg) => { [INFO] [stdout] 78 | log_book_state(book, inst_id, "bbo-tbt"); [INFO] [stdout] 79 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/bin/collect_all_csv.rs:19:1 [INFO] [stdout] | [INFO] [stdout] 19 | / fn write_csv_row( [INFO] [stdout] 20 | | writer: &mut BufWriter, [INFO] [stdout] 21 | | ts: u64, [INFO] [stdout] 22 | | exchange: &str, [INFO] [stdout] ... | [INFO] [stdout] 28 | | info: Option<&str>, [INFO] [stdout] 29 | | ) { [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: use of `unwrap_or_else` to construct default value [INFO] [stdout] --> src/bin/collect_all_csv.rs:33:10 [INFO] [stdout] | [INFO] [stdout] 33 | .unwrap_or_else(String::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:110:21 [INFO] [stdout] | [INFO] [stdout] 110 | snap.price = Some(price); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `rust_test::base_classes::state::FeedSnap { price: Some(price), ts_ns: Some(event.ts_ns), direction: event.direction, size: event.quantity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:109:21 [INFO] [stdout] | [INFO] [stdout] 109 | let mut snap = FeedSnap::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | / if st.bybit.orderbook.seq != last_bybit.0 { [INFO] [stdout] 96 | | if let Some(p) = restore_price(st.bybit.orderbook.price, &st.demean.bybit) { [INFO] [stdout] 97 | | let ts = st.bybit.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] 98 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 111 | | } [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] 95 ~ if st.bybit.orderbook.seq != last_bybit.0 [INFO] [stdout] 96 ~ && let Some(p) = restore_price(st.bybit.orderbook.price, &st.demean.bybit) { [INFO] [stdout] 97 | let ts = st.bybit.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 109 | last_bybit.0 = st.bybit.orderbook.seq; [INFO] [stdout] 110 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:112:9 [INFO] [stdout] | [INFO] [stdout] 112 | / if st.bybit.bbo.seq != last_bybit.1 { [INFO] [stdout] 113 | | if let Some(p) = restore_price(st.bybit.bbo.price, &st.demean.bybit) { [INFO] [stdout] 114 | | let ts = st.bybit.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] 115 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 128 | | } [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] 112 ~ if st.bybit.bbo.seq != last_bybit.1 [INFO] [stdout] 113 ~ && let Some(p) = restore_price(st.bybit.bbo.price, &st.demean.bybit) { [INFO] [stdout] 114 | let ts = st.bybit.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 126 | last_bybit.1 = st.bybit.bbo.seq; [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 35.40s [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:146:9 [INFO] [stdout] | [INFO] [stdout] 146 | / if st.binance.orderbook.seq != last_binance.0 { [INFO] [stdout] 147 | | if let Some(p) = restore_price(st.binance.orderbook.price, &st.demean.binance) { [INFO] [stdout] 148 | | let ts = st.binance.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] 149 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 162 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 146 ~ if st.binance.orderbook.seq != last_binance.0 [INFO] [stdout] 147 ~ && let Some(p) = restore_price(st.binance.orderbook.price, &st.demean.binance) { [INFO] [stdout] 148 | let ts = st.binance.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 160 | last_binance.0 = st.binance.orderbook.seq; [INFO] [stdout] 161 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:163:9 [INFO] [stdout] | [INFO] [stdout] 163 | / if st.binance.bbo.seq != last_binance.1 { [INFO] [stdout] 164 | | if let Some(p) = restore_price(st.binance.bbo.price, &st.demean.binance) { [INFO] [stdout] 165 | | let ts = st.binance.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] 166 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 179 | | } [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] 163 ~ if st.binance.bbo.seq != last_binance.1 [INFO] [stdout] 164 ~ && let Some(p) = restore_price(st.binance.bbo.price, &st.demean.binance) { [INFO] [stdout] 165 | let ts = st.binance.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 177 | last_binance.1 = st.binance.bbo.seq; [INFO] [stdout] 178 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:130:21 [INFO] [stdout] | [INFO] [stdout] 130 | snap.price = Some(price); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `rust_test::base_classes::state::FeedSnap { price: Some(price), ts_ns: Some(event.ts_ns), direction: event.direction, size: event.quantity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:129:21 [INFO] [stdout] | [INFO] [stdout] 129 | let mut snap = FeedSnap::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:149:17 [INFO] [stdout] | [INFO] [stdout] 149 | snap.price = Some(event.price); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `rust_test::base_classes::state::FeedSnap { price: Some(event.price), ts_ns: Some(event.ts_ns), direction: event.direction, size: event.quantity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:148:17 [INFO] [stdout] | [INFO] [stdout] 148 | let mut snap = FeedSnap::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | / if st.gate.orderbook.seq != last_gate.0 { [INFO] [stdout] 198 | | if let Some(p) = st.gate.orderbook.price { [INFO] [stdout] 199 | | let ts = st.gate.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] 200 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 213 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 197 ~ if st.gate.orderbook.seq != last_gate.0 [INFO] [stdout] 198 ~ && let Some(p) = st.gate.orderbook.price { [INFO] [stdout] 199 | let ts = st.gate.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 211 | last_gate.0 = st.gate.orderbook.seq; [INFO] [stdout] 212 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:214:9 [INFO] [stdout] | [INFO] [stdout] 214 | / if st.gate.bbo.seq != last_gate.1 { [INFO] [stdout] 215 | | if let Some(p) = st.gate.bbo.price { [INFO] [stdout] 216 | | let ts = st.gate.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] 217 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 230 | | } [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] 214 ~ if st.gate.bbo.seq != last_gate.1 [INFO] [stdout] 215 ~ && let Some(p) = st.gate.bbo.price { [INFO] [stdout] 216 | let ts = st.gate.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 228 | last_gate.1 = st.gate.bbo.seq; [INFO] [stdout] 229 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:168:21 [INFO] [stdout] | [INFO] [stdout] 168 | snap.price = Some(price); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `rust_test::base_classes::state::FeedSnap { price: Some(price), ts_ns: Some(event.ts_ns), direction: event.direction, size: event.quantity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:167:21 [INFO] [stdout] | [INFO] [stdout] 167 | let mut snap = FeedSnap::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:265:9 [INFO] [stdout] | [INFO] [stdout] 265 | / if st.bitget.orderbook.seq != last_bitget.0 { [INFO] [stdout] 266 | | if let Some(p) = restore_price(st.bitget.orderbook.price, &st.demean.bitget) { [INFO] [stdout] 267 | | let ts = st.bitget.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] 268 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 281 | | } [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] 265 ~ if st.bitget.orderbook.seq != last_bitget.0 [INFO] [stdout] 266 ~ && let Some(p) = restore_price(st.bitget.orderbook.price, &st.demean.bitget) { [INFO] [stdout] 267 | let ts = st.bitget.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 279 | last_bitget.0 = st.bitget.orderbook.seq; [INFO] [stdout] 280 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:188:21 [INFO] [stdout] | [INFO] [stdout] 188 | snap.price = Some(price); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `rust_test::base_classes::state::FeedSnap { price: Some(price), ts_ns: Some(event.ts_ns), direction: event.direction, size: event.quantity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/bin/collect_all_csv_levels.rs:187:21 [INFO] [stdout] | [INFO] [stdout] 187 | let mut snap = FeedSnap::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:282:9 [INFO] [stdout] | [INFO] [stdout] 282 | / if st.bitget.bbo.seq != last_bitget.1 { [INFO] [stdout] 283 | | if let Some(p) = restore_price(st.bitget.bbo.price, &st.demean.bitget) { [INFO] [stdout] 284 | | let ts = st.bitget.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] 285 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 298 | | } [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] 282 ~ if st.bitget.bbo.seq != last_bitget.1 [INFO] [stdout] 283 ~ && let Some(p) = restore_price(st.bitget.bbo.price, &st.demean.bitget) { [INFO] [stdout] 284 | let ts = st.bitget.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 296 | last_bitget.1 = st.bitget.bbo.seq; [INFO] [stdout] 297 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:317:9 [INFO] [stdout] | [INFO] [stdout] 317 | / if st.mexc.orderbook.seq != last_mexc.0 { [INFO] [stdout] 318 | | if let Some(p) = restore_price(st.mexc.orderbook.price, &st.demean.mexc) { [INFO] [stdout] 319 | | let ts = st.mexc.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] 320 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 333 | | } [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] 317 ~ if st.mexc.orderbook.seq != last_mexc.0 [INFO] [stdout] 318 ~ && let Some(p) = restore_price(st.mexc.orderbook.price, &st.demean.mexc) { [INFO] [stdout] 319 | let ts = st.mexc.orderbook.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 331 | last_mexc.0 = st.mexc.orderbook.seq; [INFO] [stdout] 332 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/collect_all_csv.rs:334:9 [INFO] [stdout] | [INFO] [stdout] 334 | / if st.mexc.bbo.seq != last_mexc.1 { [INFO] [stdout] 335 | | if let Some(p) = restore_price(st.mexc.bbo.price, &st.demean.mexc) { [INFO] [stdout] 336 | | let ts = st.mexc.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] 337 | | write_csv_row( [INFO] [stdout] ... | [INFO] [stdout] 350 | | } [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] 334 ~ if st.mexc.bbo.seq != last_mexc.1 [INFO] [stdout] 335 ~ && let Some(p) = restore_price(st.mexc.bbo.price, &st.demean.mexc) { [INFO] [stdout] 336 | let ts = st.mexc.bbo.ts_ns.unwrap_or(0); [INFO] [stdout] ... [INFO] [stdout] 348 | last_mexc.1 = st.mexc.bbo.seq; [INFO] [stdout] 349 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] running `Command { std: "docker" "inspect" "5b955961241cf6bbe1ba090bc235eb793255cc260ea699a4a8d592a166151210", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "5b955961241cf6bbe1ba090bc235eb793255cc260ea699a4a8d592a166151210", kill_on_drop: false }` [INFO] [stdout] 5b955961241cf6bbe1ba090bc235eb793255cc260ea699a4a8d592a166151210