[INFO] cloning repository https://github.com/quanhua92/aipriceaction-proxy [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/quanhua92/aipriceaction-proxy" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fquanhua92%2Faipriceaction-proxy", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fquanhua92%2Faipriceaction-proxy'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] c253d0a4c732e4db1531aa6346783d480302e114 [INFO] linting quanhua92/aipriceaction-proxy against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fquanhua92%2Faipriceaction-proxy" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/quanhua92/aipriceaction-proxy [INFO] removed 0 missing examples [INFO] finished tweaking git repo https://github.com/quanhua92/aipriceaction-proxy [INFO] tweaked toml for git repo https://github.com/quanhua92/aipriceaction-proxy written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/quanhua92/aipriceaction-proxy 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/quanhua92/aipriceaction-proxy 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 win32job v2.0.3 [INFO] [stderr] Downloaded proc-macro2 v1.0.97 [INFO] [stderr] Downloaded atomicwrites v0.4.4 [INFO] [stderr] Downloaded async-scoped v0.9.0 [INFO] [stderr] Downloaded swrite v0.1.0 [INFO] [stderr] Downloaded shared_thread v0.2.0 [INFO] [stderr] Downloaded serde_ignored v0.1.12 [INFO] [stderr] Downloaded serde-untagged v0.1.8 [INFO] [stderr] Downloaded camino-tempfile v1.4.1 [INFO] [stderr] Downloaded config v0.15.14 [INFO] [stderr] Downloaded axum-extra v0.10.1 [INFO] [stderr] Downloaded camino v1.1.11 [INFO] [stderr] Downloaded toml_edit v0.23.3 [INFO] [stderr] Downloaded miette v7.6.0 [INFO] [stderr] Downloaded iddqd v0.3.11 [INFO] [stderr] Downloaded tonic v0.14.1 [INFO] [stderr] Downloaded guppy v0.17.20 [INFO] [stderr] Downloaded governor v0.10.1 [INFO] [stderr] Downloaded uuid v1.18.0 [INFO] [stderr] Downloaded convert_case v0.7.1 [INFO] [stderr] Downloaded syn v2.0.105 [INFO] [stderr] Downloaded duct v1.1.0 [INFO] [stderr] Downloaded cargo-util-schemas v0.8.2 [INFO] [stderr] Downloaded nextest-runner v0.85.0 [INFO] [stderr] Downloaded quick-junit v0.5.1 [INFO] [stderr] Downloaded cfg-expr v0.20.2 [INFO] [stderr] Downloaded future-queue v0.4.0 [INFO] [stderr] Downloaded cargo_metadata v0.21.0 [INFO] [stderr] Downloaded nextest-filtering v0.16.0 [INFO] [stderr] Downloaded miette-derive v7.6.0 [INFO] [stderr] Downloaded target-spec v3.5.0 [INFO] [stderr] Downloaded toml_writer v1.0.2 [INFO] [stderr] Downloaded newtype-uuid v1.2.4 [INFO] [stderr] Downloaded target-spec-miette v0.4.4 [INFO] [stderr] Downloaded tower_governor v0.8.0 [INFO] [stderr] Downloaded thiserror-impl v2.0.14 [INFO] [stderr] Downloaded cargo-platform v0.2.0 [INFO] [stderr] Downloaded thiserror v2.0.14 [INFO] [stderr] Downloaded petgraph v0.8.2 [INFO] [stderr] Downloaded recursion v0.5.4 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 6deaac60bcb423fced95e71da6cb8e185bd261b122b2da5cf44e7c1026c59dfd [INFO] running `Command { std: "docker" "start" "-a" "6deaac60bcb423fced95e71da6cb8e185bd261b122b2da5cf44e7c1026c59dfd", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "6deaac60bcb423fced95e71da6cb8e185bd261b122b2da5cf44e7c1026c59dfd", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "6deaac60bcb423fced95e71da6cb8e185bd261b122b2da5cf44e7c1026c59dfd", kill_on_drop: false }` [INFO] [stdout] 6deaac60bcb423fced95e71da6cb8e185bd261b122b2da5cf44e7c1026c59dfd [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] bd87c7f2ee08705cf34cf2fb339c003cb1b9b562a1f0c8d5abc3a55550859d38 [INFO] running `Command { std: "docker" "start" "-a" "bd87c7f2ee08705cf34cf2fb339c003cb1b9b562a1f0c8d5abc3a55550859d38", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.97 [INFO] [stderr] Compiling libc v0.2.175 [INFO] [stderr] Checking memchr v2.7.5 [INFO] [stderr] Checking hashbrown v0.15.5 [INFO] [stderr] Compiling getrandom v0.3.3 [INFO] [stderr] Checking bitflags v2.9.1 [INFO] [stderr] Compiling serde_json v1.0.142 [INFO] [stderr] Checking http v1.3.1 [INFO] [stderr] Checking winnow v0.7.12 [INFO] [stderr] Compiling camino v1.1.11 [INFO] [stderr] Compiling target-lexicon v0.13.2 [INFO] [stderr] Compiling rustix v1.0.8 [INFO] [stderr] Compiling thiserror v2.0.14 [INFO] [stderr] Compiling typeid v1.0.3 [INFO] [stderr] Compiling guppy-workspace-hack v0.1.0 [INFO] [stderr] Compiling target-spec v3.5.0 [INFO] [stderr] Compiling semver v1.0.26 [INFO] [stderr] Checking rustls-pki-types v1.12.0 [INFO] [stderr] Checking ordered-float v2.10.1 [INFO] [stderr] Compiling portable-atomic v1.11.1 [INFO] [stderr] Compiling nextest-workspace-hack v0.1.0 [INFO] [stderr] Checking unicode-xid v0.2.6 [INFO] [stderr] Compiling rustls v0.23.31 [INFO] [stderr] Compiling convert_case v0.7.1 [INFO] [stderr] Checking debug-ignore v1.0.5 [INFO] [stderr] Compiling rustix v0.38.44 [INFO] [stderr] Compiling newtype-uuid v1.2.4 [INFO] [stderr] Compiling zstd-safe v7.2.4 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking cfg-expr v0.20.2 [INFO] [stderr] Checking vte v0.14.1 [INFO] [stderr] Checking http-body v1.0.1 [INFO] [stderr] Checking bstr v1.12.0 [INFO] [stderr] Compiling nix v0.30.1 [INFO] [stderr] Compiling quote v1.0.40 [INFO] [stderr] Compiling chrono-tz-build v0.2.1 [INFO] [stderr] Checking http-body-util v0.1.3 [INFO] [stderr] Checking raw-cpuid v11.5.0 [INFO] [stderr] Compiling litrs v0.4.2 [INFO] [stderr] Compiling owo-colors v4.2.2 [INFO] [stderr] Compiling syn v2.0.105 [INFO] [stderr] Checking nested v0.1.1 [INFO] [stderr] Checking strip-ansi-escapes v0.2.1 [INFO] [stderr] Checking webpki-roots v1.0.2 [INFO] [stderr] Checking quick-xml v0.37.5 [INFO] [stderr] Checking spinning_top v0.3.0 [INFO] [stderr] Compiling jobserver v0.1.33 [INFO] [stderr] Checking shared_thread v0.2.0 [INFO] [stderr] Checking iri-string v0.7.8 [INFO] [stderr] Checking recursion v0.5.4 [INFO] [stderr] Checking rustc-hash v2.1.1 [INFO] [stderr] Checking toml_writer v1.0.2 [INFO] [stderr] Checking nonzero_ext v0.3.0 [INFO] [stderr] Compiling chrono-tz v0.8.6 [INFO] [stderr] Checking nonempty v0.7.0 [INFO] [stderr] Checking unit-prefix v0.5.1 [INFO] [stderr] Checking web-time v1.1.0 [INFO] [stderr] Checking iddqd v0.3.11 [INFO] [stderr] Compiling cc v1.2.32 [INFO] [stderr] Checking tracing-log v0.2.0 [INFO] [stderr] Compiling document-features v0.2.11 [INFO] [stderr] Checking unsafe-libyaml v0.2.11 [INFO] [stderr] Checking supports-unicode v3.0.0 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking xxhash-rust v0.8.15 [INFO] [stderr] Checking is_ci v1.2.0 [INFO] [stderr] Checking home v0.5.11 [INFO] [stderr] Checking indent_write v2.2.0 [INFO] [stderr] Checking swrite v0.1.0 [INFO] [stderr] Checking signal-hook-registry v1.4.6 [INFO] [stderr] Checking parking_lot_core v0.9.11 [INFO] [stderr] Checking mio v1.0.4 [INFO] [stderr] Checking socket2 v0.6.0 [INFO] [stderr] Checking signal-hook v0.3.18 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Checking parking_lot v0.12.4 [INFO] [stderr] Checking os_pipe v1.2.2 [INFO] [stderr] Checking dashmap v6.1.0 [INFO] [stderr] Checking toml_parser v1.0.2 [INFO] [stderr] Checking rand_core v0.9.3 [INFO] [stderr] Checking uuid v1.18.0 [INFO] [stderr] Checking ahash v0.8.12 [INFO] [stderr] Checking tempfile v3.20.0 [INFO] [stderr] Checking xattr v1.5.1 [INFO] [stderr] Checking sigchld v0.2.4 [INFO] [stderr] Checking signal-hook-mio v0.2.4 [INFO] [stderr] Checking shared_child v1.1.1 [INFO] [stderr] Checking quanta v0.12.6 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Checking console v0.16.0 [INFO] [stderr] Checking filetime v0.2.25 [INFO] [stderr] Checking duct v1.1.0 [INFO] [stderr] Checking tar v0.4.44 [INFO] [stderr] Checking rand v0.9.2 [INFO] [stderr] Checking indicatif v0.18.0 [INFO] [stderr] Checking atomicwrites v0.4.4 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Compiling zstd-sys v2.0.15+zstd.1.5.7 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking globset v0.4.16 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.0 [INFO] [stderr] Compiling tokio-macros v2.5.0 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling zerovec-derive v0.11.1 [INFO] [stderr] Compiling tracing-attributes v0.1.30 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling thiserror-impl v2.0.14 [INFO] [stderr] Compiling pin-project-internal v1.1.10 [INFO] [stderr] Compiling miette-derive v7.6.0 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling derive_more-impl v2.0.1 [INFO] [stderr] Checking rustls-webpki v0.103.4 [INFO] [stderr] Compiling async-trait v0.1.89 [INFO] [stderr] Checking tokio v1.47.1 [INFO] [stderr] Checking derive_more v2.0.1 [INFO] [stderr] Checking crossterm v0.29.0 [INFO] [stderr] Compiling derive-where v1.6.0 [INFO] [stderr] Checking pin-project v1.1.10 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking yoke v0.8.0 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Checking miette v7.6.0 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Checking forwarded-header-value v0.1.1 [INFO] [stderr] Checking axum-core v0.5.2 [INFO] [stderr] Checking tracing-subscriber v0.3.19 [INFO] [stderr] Checking zerovec v0.11.4 [INFO] [stderr] Checking zerotrie v0.2.2 [INFO] [stderr] Checking zstd v0.13.3 [INFO] [stderr] Checking futures-executor v0.3.31 [INFO] [stderr] Checking governor v0.10.1 [INFO] [stderr] Checking future-queue v0.4.0 [INFO] [stderr] Checking serde v1.0.219 [INFO] [stderr] Checking futures v0.3.31 [INFO] [stderr] Checking tinystr v0.8.1 [INFO] [stderr] Checking potential_utf v0.1.2 [INFO] [stderr] Checking icu_collections v2.0.0 [INFO] [stderr] Checking icu_locale_core v2.0.0 [INFO] [stderr] Checking icu_provider v2.0.0 [INFO] [stderr] Checking icu_properties v2.0.1 [INFO] [stderr] Checking icu_normalizer v2.0.0 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.0.3 [INFO] [stderr] Checking tokio-util v0.7.16 [INFO] [stderr] Checking tokio-stream v0.1.17 [INFO] [stderr] Checking tokio-rustls v0.26.2 [INFO] [stderr] Checking async-compression v0.4.27 [INFO] [stderr] Checking async-scoped v0.9.0 [INFO] [stderr] Checking url v2.5.4 [INFO] [stderr] Checking indexmap v2.10.0 [INFO] [stderr] Checking toml_datetime v0.6.11 [INFO] [stderr] Checking serde_spanned v0.6.9 [INFO] [stderr] Checking erased-serde v0.4.6 [INFO] [stderr] Checking serde_path_to_error v0.1.17 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking serde-value v0.7.0 [INFO] [stderr] Checking serde_spanned v1.0.0 [INFO] [stderr] Checking toml_datetime v0.7.0 [INFO] [stderr] Checking cargo-platform v0.2.0 [INFO] [stderr] Checking chrono v0.4.41 [INFO] [stderr] Checking smol_str v0.3.2 [INFO] [stderr] Checking serde_ignored v0.1.12 [INFO] [stderr] Checking humantime-serde v1.1.1 [INFO] [stderr] Checking pathdiff v0.2.3 [INFO] [stderr] Checking camino-tempfile v1.4.1 [INFO] [stderr] Checking h2 v0.4.12 [INFO] [stderr] Checking toml_edit v0.22.27 [INFO] [stderr] Checking tower v0.5.2 [INFO] [stderr] Checking petgraph v0.8.2 [INFO] [stderr] Checking toml v0.9.5 [INFO] [stderr] Checking toml_edit v0.23.3 [INFO] [stderr] Checking serde_html_form v0.2.7 [INFO] [stderr] Checking serde_yaml v0.9.34+deprecated [INFO] [stderr] Checking serde-untagged v0.1.8 [INFO] [stderr] Checking quick-junit v0.5.1 [INFO] [stderr] Checking nextest-metadata v0.12.2 [INFO] [stderr] Checking target-spec-miette v0.4.4 [INFO] [stderr] Checking config v0.15.14 [INFO] [stderr] Checking toml v0.8.23 [INFO] [stderr] Checking tower-http v0.6.6 [INFO] [stderr] Checking cargo-util-schemas v0.8.2 [INFO] [stderr] Checking cargo_metadata v0.21.0 [INFO] [stderr] Checking hyper v1.6.0 [INFO] [stderr] Checking guppy v0.17.20 [INFO] [stderr] Checking hyper-util v0.1.16 [INFO] [stderr] Checking nextest-filtering v0.16.0 [INFO] [stderr] Checking axum v0.8.4 [INFO] [stderr] Checking hyper-timeout v0.5.2 [INFO] [stderr] Checking hyper-rustls v0.27.7 [INFO] [stderr] Checking reqwest v0.12.23 [INFO] [stderr] Checking nextest-runner v0.85.0 [INFO] [stderr] Checking tonic v0.14.1 [INFO] [stderr] Checking axum-extra v0.10.1 [INFO] [stderr] Checking tower_governor v0.8.0 [INFO] [stderr] Checking aipriceaction-proxy v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/api.rs:94:46 [INFO] [stdout] | [INFO] [stdout] 94 | let time_matches_start = start_date_filter.map_or(true, |start| ohlcv.time >= start); [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] 94 - let time_matches_start = start_date_filter.map_or(true, |start| ohlcv.time >= start); [INFO] [stdout] 94 + let time_matches_start = start_date_filter.is_none_or(|start| ohlcv.time >= start); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/api.rs:95:44 [INFO] [stdout] | [INFO] [stdout] 95 | let time_matches_end = end_date_filter.map_or(true, |end| ohlcv.time <= end); [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] 95 - let time_matches_end = end_date_filter.map_or(true, |end| ohlcv.time <= end); [INFO] [stdout] 95 + let time_matches_end = end_date_filter.is_none_or(|end| ohlcv.time <= end); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/api.rs:94:46 [INFO] [stdout] | [INFO] [stdout] 94 | let time_matches_start = start_date_filter.map_or(true, |start| ohlcv.time >= start); [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] 94 - let time_matches_start = start_date_filter.map_or(true, |start| ohlcv.time >= start); [INFO] [stdout] 94 + let time_matches_start = start_date_filter.is_none_or(|start| ohlcv.time >= start); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/api.rs:95:44 [INFO] [stdout] | [INFO] [stdout] 95 | let time_matches_end = end_date_filter.map_or(true, |end| ohlcv.time <= end); [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] 95 - let time_matches_end = end_date_filter.map_or(true, |end| ohlcv.time <= end); [INFO] [stdout] 95 + let time_matches_end = end_date_filter.is_none_or(|end| ohlcv.time <= end); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/api.rs:159:29 [INFO] [stdout] | [INFO] [stdout] 159 | let should_update = entry.last().map_or(true, |last| payload.time > last.time); [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] 159 - let should_update = entry.last().map_or(true, |last| payload.time > last.time); [INFO] [stdout] 159 + let should_update = entry.last().is_none_or(|last| payload.time > last.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/api.rs:159:29 [INFO] [stdout] | [INFO] [stdout] 159 | let should_update = entry.last().map_or(true, |last| payload.time > last.time); [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] 159 - let should_update = entry.last().map_or(true, |last| payload.time > last.time); [INFO] [stdout] 159 + let should_update = entry.last().is_none_or(|last| payload.time > last.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api.rs:212:9 [INFO] [stdout] | [INFO] [stdout] 212 | / if let Some(entry) = data_guard.get(symbol.as_str()) { [INFO] [stdout] 213 | | if let Some(last_data) = entry.last() { [INFO] [stdout] 214 | | let price_change_percent = (payload.close - last_data.close).abs() / last_data.close; [INFO] [stdout] 215 | | debug!( [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] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 212 ~ if let Some(entry) = data_guard.get(symbol.as_str()) [INFO] [stdout] 213 ~ && let Some(last_data) = entry.last() { [INFO] [stdout] 214 | let price_change_percent = (payload.close - last_data.close).abs() / last_data.close; [INFO] [stdout] ... [INFO] [stdout] 237 | } [INFO] [stdout] 238 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api.rs:212:9 [INFO] [stdout] | [INFO] [stdout] 212 | / if let Some(entry) = data_guard.get(symbol.as_str()) { [INFO] [stdout] 213 | | if let Some(last_data) = entry.last() { [INFO] [stdout] 214 | | let price_change_percent = (payload.close - last_data.close).abs() / last_data.close; [INFO] [stdout] 215 | | debug!( [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] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 212 ~ if let Some(entry) = data_guard.get(symbol.as_str()) [INFO] [stdout] 213 ~ && let Some(last_data) = entry.last() { [INFO] [stdout] 214 | let price_change_percent = (payload.close - last_data.close).abs() / last_data.close; [INFO] [stdout] ... [INFO] [stdout] 237 | } [INFO] [stdout] 238 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/api.rs:284:74 [INFO] [stdout] | [INFO] [stdout] 284 | let memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/api.rs:284:74 [INFO] [stdout] | [INFO] [stdout] 284 | let memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api.rs:344:5 [INFO] [stdout] | [INFO] [stdout] 344 | / if should_clear_cache { [INFO] [stdout] 345 | | if let Err(e) = cache::clear_cache(&path) { [INFO] [stdout] 346 | | warn!(path, ?e, "Failed to clear cache"); [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] 344 ~ if should_clear_cache [INFO] [stdout] 345 ~ && let Err(e) = cache::clear_cache(&path) { [INFO] [stdout] 346 | warn!(path, ?e, "Failed to clear cache"); [INFO] [stdout] 347 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api.rs:344:5 [INFO] [stdout] | [INFO] [stdout] 344 | / if should_clear_cache { [INFO] [stdout] 345 | | if let Err(e) = cache::clear_cache(&path) { [INFO] [stdout] 346 | | warn!(path, ?e, "Failed to clear cache"); [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] 344 ~ if should_clear_cache [INFO] [stdout] 345 ~ && let Err(e) = cache::clear_cache(&path) { [INFO] [stdout] 346 | warn!(path, ?e, "Failed to clear cache"); [INFO] [stdout] 347 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/config.rs:46:1 [INFO] [stdout] | [INFO] [stdout] 46 | / impl Default for OfficeHoursConfig { [INFO] [stdout] 47 | | fn default() -> Self { [INFO] [stdout] 48 | | Self { [INFO] [stdout] 49 | | default_office_hours: OfficeHours::default(), [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#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 41 + #[derive(Default)] [INFO] [stdout] 42 | pub struct OfficeHoursConfig { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/config.rs:46:1 [INFO] [stdout] | [INFO] [stdout] 46 | / impl Default for OfficeHoursConfig { [INFO] [stdout] 47 | | fn default() -> Self { [INFO] [stdout] 48 | | Self { [INFO] [stdout] 49 | | default_office_hours: OfficeHours::default(), [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#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 41 + #[derive(Default)] [INFO] [stdout] 42 | pub struct OfficeHoursConfig { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:79:13 [INFO] [stdout] | [INFO] [stdout] 79 | ohlcv_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [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] 79 - ohlcv_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [INFO] [stdout] 79 + ohlcv_vec.sort_by_key(|b| std::cmp::Reverse(b.time)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/data_structures.rs:177:5 [INFO] [stdout] | [INFO] [stdout] 138 | / let added_count = if dividend_detected { [INFO] [stdout] 139 | | // Dividend detected: completely replace existing data with new data [INFO] [stdout] 140 | | tracing::info!("Dividend detected - replacing all existing data with new data"); [INFO] [stdout] 141 | | let count = sorted_new_data.len(); [INFO] [stdout] ... | [INFO] [stdout] 174 | | added [INFO] [stdout] 175 | | }; [INFO] [stdout] | |______- unnecessary `let` binding [INFO] [stdout] 176 | [INFO] [stdout] 177 | added_count [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 138 ~ [INFO] [stdout] 139 | [INFO] [stdout] 140 ~ if dividend_detected { [INFO] [stdout] 141 + // Dividend detected: completely replace existing data with new data [INFO] [stdout] 142 + tracing::info!("Dividend detected - replacing all existing data with new data"); [INFO] [stdout] 143 + let count = sorted_new_data.len(); [INFO] [stdout] 144 + *existing_data = sorted_new_data; [INFO] [stdout] 145 + count [INFO] [stdout] 146 + } else { [INFO] [stdout] 147 + // No dividend: keep existing yesterday data and append/replace today's data [INFO] [stdout] 148 + tracing::debug!("No dividend detected - keeping existing data and updating today"); [INFO] [stdout] 149 + let mut added = 0; [INFO] [stdout] 150 + [INFO] [stdout] 151 + for new_point in sorted_new_data { [INFO] [stdout] 152 + let new_date = new_point.time.date_naive(); [INFO] [stdout] 153 + [INFO] [stdout] 154 + // Skip yesterday's data - keep existing yesterday [INFO] [stdout] 155 + if new_date == yesterday { [INFO] [stdout] 156 + continue; [INFO] [stdout] 157 + } [INFO] [stdout] 158 + [INFO] [stdout] 159 + // For latest date (today), always replace. For other dates, check timestamp [INFO] [stdout] 160 + let is_latest_date = Some(new_date) == latest_date; [INFO] [stdout] 161 + [INFO] [stdout] 162 + if let Some(existing_point) = existing_data.iter_mut().find(|p| p.time.date_naive() == new_date) { [INFO] [stdout] 163 + // Always replace if it's the latest date, or if new timestamp is more recent [INFO] [stdout] 164 + if is_latest_date || new_point.time > existing_point.time { [INFO] [stdout] 165 + *existing_point = new_point; [INFO] [stdout] 166 + } [INFO] [stdout] 167 + } else { [INFO] [stdout] 168 + // Add new data point for this date [INFO] [stdout] 169 + existing_data.push(new_point); [INFO] [stdout] 170 + added += 1; [INFO] [stdout] 171 + } [INFO] [stdout] 172 + } [INFO] [stdout] 173 + [INFO] [stdout] 174 + // Sort by time after merging [INFO] [stdout] 175 + existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 176 + added [INFO] [stdout] 177 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 94 - existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 94 + existing_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:103:5 [INFO] [stdout] | [INFO] [stdout] 103 | existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 103 - existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 103 + existing_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:105:5 [INFO] [stdout] | [INFO] [stdout] 105 | sorted_new_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 105 - sorted_new_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 105 + sorted_new_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:173:9 [INFO] [stdout] | [INFO] [stdout] 173 | existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 173 - existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 173 + existing_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:79:13 [INFO] [stdout] | [INFO] [stdout] 79 | ohlcv_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [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] 79 - ohlcv_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [INFO] [stdout] 79 + ohlcv_vec.sort_by_key(|b| std::cmp::Reverse(b.time)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/data_structures.rs:177:5 [INFO] [stdout] | [INFO] [stdout] 138 | / let added_count = if dividend_detected { [INFO] [stdout] 139 | | // Dividend detected: completely replace existing data with new data [INFO] [stdout] 140 | | tracing::info!("Dividend detected - replacing all existing data with new data"); [INFO] [stdout] 141 | | let count = sorted_new_data.len(); [INFO] [stdout] ... | [INFO] [stdout] 174 | | added [INFO] [stdout] 175 | | }; [INFO] [stdout] | |______- unnecessary `let` binding [INFO] [stdout] 176 | [INFO] [stdout] 177 | added_count [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 138 ~ [INFO] [stdout] 139 | [INFO] [stdout] 140 ~ if dividend_detected { [INFO] [stdout] 141 + // Dividend detected: completely replace existing data with new data [INFO] [stdout] 142 + tracing::info!("Dividend detected - replacing all existing data with new data"); [INFO] [stdout] 143 + let count = sorted_new_data.len(); [INFO] [stdout] 144 + *existing_data = sorted_new_data; [INFO] [stdout] 145 + count [INFO] [stdout] 146 + } else { [INFO] [stdout] 147 + // No dividend: keep existing yesterday data and append/replace today's data [INFO] [stdout] 148 + tracing::debug!("No dividend detected - keeping existing data and updating today"); [INFO] [stdout] 149 + let mut added = 0; [INFO] [stdout] 150 + [INFO] [stdout] 151 + for new_point in sorted_new_data { [INFO] [stdout] 152 + let new_date = new_point.time.date_naive(); [INFO] [stdout] 153 + [INFO] [stdout] 154 + // Skip yesterday's data - keep existing yesterday [INFO] [stdout] 155 + if new_date == yesterday { [INFO] [stdout] 156 + continue; [INFO] [stdout] 157 + } [INFO] [stdout] 158 + [INFO] [stdout] 159 + // For latest date (today), always replace. For other dates, check timestamp [INFO] [stdout] 160 + let is_latest_date = Some(new_date) == latest_date; [INFO] [stdout] 161 + [INFO] [stdout] 162 + if let Some(existing_point) = existing_data.iter_mut().find(|p| p.time.date_naive() == new_date) { [INFO] [stdout] 163 + // Always replace if it's the latest date, or if new timestamp is more recent [INFO] [stdout] 164 + if is_latest_date || new_point.time > existing_point.time { [INFO] [stdout] 165 + *existing_point = new_point; [INFO] [stdout] 166 + } [INFO] [stdout] 167 + } else { [INFO] [stdout] 168 + // Add new data point for this date [INFO] [stdout] 169 + existing_data.push(new_point); [INFO] [stdout] 170 + added += 1; [INFO] [stdout] 171 + } [INFO] [stdout] 172 + } [INFO] [stdout] 173 + [INFO] [stdout] 174 + // Sort by time after merging [INFO] [stdout] 175 + existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 176 + added [INFO] [stdout] 177 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 94 - existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 94 + existing_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:103:5 [INFO] [stdout] | [INFO] [stdout] 103 | existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 103 - existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 103 + existing_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:105:5 [INFO] [stdout] | [INFO] [stdout] 105 | sorted_new_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 105 - sorted_new_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 105 + sorted_new_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:173:9 [INFO] [stdout] | [INFO] [stdout] 173 | existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 173 - existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 173 + existing_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used consecutive `str::replace` call [INFO] [stdout] --> src/utils/cache.rs:27:10 [INFO] [stdout] | [INFO] [stdout] 27 | path.replace('/', "_").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: used consecutive `str::replace` call [INFO] [stdout] --> src/utils/cache.rs:27:10 [INFO] [stdout] | [INFO] [stdout] 27 | path.replace('/', "_").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: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | / if let Ok(metadata) = fs::metadata(&path) { [INFO] [stdout] 119 | | if let Ok(modified) = metadata.modified() { [INFO] [stdout] 120 | | if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | | if age > Duration::from_secs(CACHE_TTL_SECS) { [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] 118 ~ if let Ok(metadata) = fs::metadata(&path) [INFO] [stdout] 119 ~ && let Ok(modified) = metadata.modified() { [INFO] [stdout] 120 | if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] ... [INFO] [stdout] 126 | } [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:119:13 [INFO] [stdout] | [INFO] [stdout] 119 | / if let Ok(modified) = metadata.modified() { [INFO] [stdout] 120 | | if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | | if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | | if fs::remove_file(&path).is_ok() { [INFO] [stdout] ... | [INFO] [stdout] 127 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 119 ~ if let Ok(modified) = metadata.modified() [INFO] [stdout] 120 ~ && let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] ... [INFO] [stdout] 125 | } [INFO] [stdout] 126 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:120:17 [INFO] [stdout] | [INFO] [stdout] 120 | / if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | | if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | | if fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | | removed_count += 1; [INFO] [stdout] ... | [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] 120 ~ if let Ok(age) = now.duration_since(modified) [INFO] [stdout] 121 ~ && age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | if fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | removed_count += 1; [INFO] [stdout] 124 | } [INFO] [stdout] 125 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:121:21 [INFO] [stdout] | [INFO] [stdout] 121 | / if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | | if fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | | removed_count += 1; [INFO] [stdout] 124 | | } [INFO] [stdout] 125 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 121 ~ if age > Duration::from_secs(CACHE_TTL_SECS) [INFO] [stdout] 122 ~ && fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | removed_count += 1; [INFO] [stdout] 124 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | / if let Ok(metadata) = fs::metadata(&path) { [INFO] [stdout] 119 | | if let Ok(modified) = metadata.modified() { [INFO] [stdout] 120 | | if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | | if age > Duration::from_secs(CACHE_TTL_SECS) { [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] 118 ~ if let Ok(metadata) = fs::metadata(&path) [INFO] [stdout] 119 ~ && let Ok(modified) = metadata.modified() { [INFO] [stdout] 120 | if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] ... [INFO] [stdout] 126 | } [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:119:13 [INFO] [stdout] | [INFO] [stdout] 119 | / if let Ok(modified) = metadata.modified() { [INFO] [stdout] 120 | | if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | | if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | | if fs::remove_file(&path).is_ok() { [INFO] [stdout] ... | [INFO] [stdout] 127 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 119 ~ if let Ok(modified) = metadata.modified() [INFO] [stdout] 120 ~ && let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] ... [INFO] [stdout] 125 | } [INFO] [stdout] 126 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:120:17 [INFO] [stdout] | [INFO] [stdout] 120 | / if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | | if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | | if fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | | removed_count += 1; [INFO] [stdout] ... | [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] 120 ~ if let Ok(age) = now.duration_since(modified) [INFO] [stdout] 121 ~ && age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | if fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | removed_count += 1; [INFO] [stdout] 124 | } [INFO] [stdout] 125 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:121:21 [INFO] [stdout] | [INFO] [stdout] 121 | / if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | | if fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | | removed_count += 1; [INFO] [stdout] 124 | | } [INFO] [stdout] 125 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 121 ~ if age > Duration::from_secs(CACHE_TTL_SECS) [INFO] [stdout] 122 ~ && fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | removed_count += 1; [INFO] [stdout] 124 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/vci.rs:169:9 [INFO] [stdout] | [INFO] [stdout] 169 | / ... if self.request_timestamps.len() >= self.rate_limit_per_minute as usize { [INFO] [stdout] 170 | | ... if let Some(&oldest_request) = self.request_timestamps.first() { [INFO] [stdout] 171 | | ... let wait_time = StdDuration::from_secs(60) - current_time.duration_since(oldest_request).unwrap_or(StdDuration::fro... [INFO] [stdout] 172 | | ... if !wait_time.is_zero() { [INFO] [stdout] ... | [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] 169 ~ if self.request_timestamps.len() >= self.rate_limit_per_minute as usize [INFO] [stdout] 170 ~ && let Some(&oldest_request) = self.request_timestamps.first() { [INFO] [stdout] 171 | let wait_time = StdDuration::from_secs(60) - current_time.duration_since(oldest_request).unwrap_or(StdDuration::from_secs(0)); [INFO] [stdout] ... [INFO] [stdout] 174 | } [INFO] [stdout] 175 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/vci.rs:169:9 [INFO] [stdout] | [INFO] [stdout] 169 | / ... if self.request_timestamps.len() >= self.rate_limit_per_minute as usize { [INFO] [stdout] 170 | | ... if let Some(&oldest_request) = self.request_timestamps.first() { [INFO] [stdout] 171 | | ... let wait_time = StdDuration::from_secs(60) - current_time.duration_since(oldest_request).unwrap_or(StdDuration::fro... [INFO] [stdout] 172 | | ... if !wait_time.is_zero() { [INFO] [stdout] ... | [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] 169 ~ if self.request_timestamps.len() >= self.rate_limit_per_minute as usize [INFO] [stdout] 170 ~ && let Some(&oldest_request) = self.request_timestamps.first() { [INFO] [stdout] 171 | let wait_time = StdDuration::from_secs(60) - current_time.duration_since(oldest_request).unwrap_or(StdDuration::from_secs(0)); [INFO] [stdout] ... [INFO] [stdout] 174 | } [INFO] [stdout] 175 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/vci.rs:331:16 [INFO] [stdout] | [INFO] [stdout] 331 | if !data_item.get(key).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `data_item.get(key).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/vci.rs:331:16 [INFO] [stdout] | [INFO] [stdout] 331 | if !data_item.get(key).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `data_item.get(key).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:380:9 [INFO] [stdout] | [INFO] [stdout] 380 | result.sort_by(|a, b| a.time.cmp(&b.time)); [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] 380 - result.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 380 + result.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/vci.rs:466:20 [INFO] [stdout] | [INFO] [stdout] 466 | if !data_item.get(key).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `data_item.get(key).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:380:9 [INFO] [stdout] | [INFO] [stdout] 380 | result.sort_by(|a, b| a.time.cmp(&b.time)); [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] 380 - result.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 380 + result.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/vci.rs:466:20 [INFO] [stdout] | [INFO] [stdout] 466 | if !data_item.get(key).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `data_item.get(key).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/vci.rs:434:53 [INFO] [stdout] | [INFO] [stdout] 434 | for (_i, data_item) in response_array.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 434 - for (_i, data_item) in response_array.iter().enumerate() { [INFO] [stdout] 434 + for data_item in response_array.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/vci.rs:434:53 [INFO] [stdout] | [INFO] [stdout] 434 | for (_i, data_item) in response_array.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 434 - for (_i, data_item) in response_array.iter().enumerate() { [INFO] [stdout] 434 + for data_item in response_array.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `times` [INFO] [stdout] --> src/vci.rs:501:22 [INFO] [stdout] | [INFO] [stdout] 501 | for j in 0..length.min(10) { // Show first 10 timestamps [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 501 - for j in 0..length.min(10) { // Show first 10 timestamps [INFO] [stdout] 501 + for (j, ) in times.iter().enumerate().take(length.min(10)) { // Show first 10 timestamps [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `times` [INFO] [stdout] --> src/vci.rs:501:22 [INFO] [stdout] | [INFO] [stdout] 501 | for j in 0..length.min(10) { // Show first 10 timestamps [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 501 - for j in 0..length.min(10) { // Show first 10 timestamps [INFO] [stdout] 501 + for (j, ) in times.iter().enumerate().take(length.min(10)) { // Show first 10 timestamps [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:539:13 [INFO] [stdout] | [INFO] [stdout] 539 | symbol_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 539 - symbol_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 539 + symbol_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/vci.rs:542:13 [INFO] [stdout] | [INFO] [stdout] 542 | / if self.resample_map.contains_key(interval) && !["1m", "1H", "1D"].contains(&interval) { [INFO] [stdout] 543 | | if let Ok(resampled) = self.resample_ohlcv(symbol_data.clone(), interval) { [INFO] [stdout] 544 | | symbol_data = resampled; [INFO] [stdout] 545 | | } [INFO] [stdout] 546 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 542 ~ if self.resample_map.contains_key(interval) && !["1m", "1H", "1D"].contains(&interval) [INFO] [stdout] 543 ~ && let Ok(resampled) = self.resample_ohlcv(symbol_data.clone(), interval) { [INFO] [stdout] 544 | symbol_data = resampled; [INFO] [stdout] 545 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:539:13 [INFO] [stdout] | [INFO] [stdout] 539 | symbol_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 539 - symbol_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 539 + symbol_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/vci.rs:542:13 [INFO] [stdout] | [INFO] [stdout] 542 | / if self.resample_map.contains_key(interval) && !["1m", "1H", "1D"].contains(&interval) { [INFO] [stdout] 543 | | if let Ok(resampled) = self.resample_ohlcv(symbol_data.clone(), interval) { [INFO] [stdout] 544 | | symbol_data = resampled; [INFO] [stdout] 545 | | } [INFO] [stdout] 546 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 542 ~ if self.resample_map.contains_key(interval) && !["1m", "1H", "1D"].contains(&interval) [INFO] [stdout] 543 ~ && let Ok(resampled) = self.resample_ohlcv(symbol_data.clone(), interval) { [INFO] [stdout] 544 | symbol_data = resampled; [INFO] [stdout] 545 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:776:9 [INFO] [stdout] | [INFO] [stdout] 776 | result.sort_by(|a, b| a.time.cmp(&b.time)); [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] 776 - result.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 776 + result.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:807:9 [INFO] [stdout] | [INFO] [stdout] 807 | result.sort_by(|a, b| a.time.cmp(&b.time)); [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] 807 - result.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 807 + result.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:776:9 [INFO] [stdout] | [INFO] [stdout] 776 | result.sort_by(|a, b| a.time.cmp(&b.time)); [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] 776 - result.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 776 + result.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:807:9 [INFO] [stdout] | [INFO] [stdout] 807 | result.sort_by(|a, b| a.time.cmp(&b.time)); [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] 807 - result.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 807 + result.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:110:78 [INFO] [stdout] | [INFO] [stdout] 110 | let memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:110:78 [INFO] [stdout] | [INFO] [stdout] 110 | let memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/worker.rs:186:33 [INFO] [stdout] | [INFO] [stdout] 186 | ... limited_data_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [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] 186 - limited_data_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [INFO] [stdout] 186 + limited_data_vec.sort_by_key(|b| std::cmp::Reverse(b.time)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/worker.rs:186:33 [INFO] [stdout] | [INFO] [stdout] 186 | ... limited_data_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [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] 186 - limited_data_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [INFO] [stdout] 186 + limited_data_vec.sort_by_key(|b| std::cmp::Reverse(b.time)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:301:78 [INFO] [stdout] | [INFO] [stdout] 301 | let memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:311:103 [INFO] [stdout] | [INFO] [stdout] 311 | let (cleaned_symbols, cleaned_data_points) = crate::data_structures::cleanup_old_data(&mut *data_guard); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `&mut data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:312:86 [INFO] [stdout] | [INFO] [stdout] 312 | let new_memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:301:78 [INFO] [stdout] | [INFO] [stdout] 301 | let memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:311:103 [INFO] [stdout] | [INFO] [stdout] 311 | let (cleaned_symbols, cleaned_data_points) = crate::data_structures::cleanup_old_data(&mut *data_guard); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `&mut data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:312:86 [INFO] [stdout] | [INFO] [stdout] 312 | let new_memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/api.rs:94:46 [INFO] [stdout] | [INFO] [stdout] 94 | let time_matches_start = start_date_filter.map_or(true, |start| ohlcv.time >= start); [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] 94 - let time_matches_start = start_date_filter.map_or(true, |start| ohlcv.time >= start); [INFO] [stdout] 94 + let time_matches_start = start_date_filter.is_none_or(|start| ohlcv.time >= start); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/api.rs:95:44 [INFO] [stdout] | [INFO] [stdout] 95 | let time_matches_end = end_date_filter.map_or(true, |end| ohlcv.time <= end); [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] 95 - let time_matches_end = end_date_filter.map_or(true, |end| ohlcv.time <= end); [INFO] [stdout] 95 + let time_matches_end = end_date_filter.is_none_or(|end| ohlcv.time <= end); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/api.rs:159:29 [INFO] [stdout] | [INFO] [stdout] 159 | let should_update = entry.last().map_or(true, |last| payload.time > last.time); [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] 159 - let should_update = entry.last().map_or(true, |last| payload.time > last.time); [INFO] [stdout] 159 + let should_update = entry.last().is_none_or(|last| payload.time > last.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api.rs:212:9 [INFO] [stdout] | [INFO] [stdout] 212 | / if let Some(entry) = data_guard.get(symbol.as_str()) { [INFO] [stdout] 213 | | if let Some(last_data) = entry.last() { [INFO] [stdout] 214 | | let price_change_percent = (payload.close - last_data.close).abs() / last_data.close; [INFO] [stdout] 215 | | debug!( [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] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 212 ~ if let Some(entry) = data_guard.get(symbol.as_str()) [INFO] [stdout] 213 ~ && let Some(last_data) = entry.last() { [INFO] [stdout] 214 | let price_change_percent = (payload.close - last_data.close).abs() / last_data.close; [INFO] [stdout] ... [INFO] [stdout] 237 | } [INFO] [stdout] 238 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/api.rs:284:74 [INFO] [stdout] | [INFO] [stdout] 284 | let memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api.rs:344:5 [INFO] [stdout] | [INFO] [stdout] 344 | / if should_clear_cache { [INFO] [stdout] 345 | | if let Err(e) = cache::clear_cache(&path) { [INFO] [stdout] 346 | | warn!(path, ?e, "Failed to clear cache"); [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] 344 ~ if should_clear_cache [INFO] [stdout] 345 ~ && let Err(e) = cache::clear_cache(&path) { [INFO] [stdout] 346 | warn!(path, ?e, "Failed to clear cache"); [INFO] [stdout] 347 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/config.rs:46:1 [INFO] [stdout] | [INFO] [stdout] 46 | / impl Default for OfficeHoursConfig { [INFO] [stdout] 47 | | fn default() -> Self { [INFO] [stdout] 48 | | Self { [INFO] [stdout] 49 | | default_office_hours: OfficeHours::default(), [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#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 41 + #[derive(Default)] [INFO] [stdout] 42 | pub struct OfficeHoursConfig { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:79:13 [INFO] [stdout] | [INFO] [stdout] 79 | ohlcv_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [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] 79 - ohlcv_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [INFO] [stdout] 79 + ohlcv_vec.sort_by_key(|b| std::cmp::Reverse(b.time)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/data_structures.rs:177:5 [INFO] [stdout] | [INFO] [stdout] 138 | / let added_count = if dividend_detected { [INFO] [stdout] 139 | | // Dividend detected: completely replace existing data with new data [INFO] [stdout] 140 | | tracing::info!("Dividend detected - replacing all existing data with new data"); [INFO] [stdout] 141 | | let count = sorted_new_data.len(); [INFO] [stdout] ... | [INFO] [stdout] 174 | | added [INFO] [stdout] 175 | | }; [INFO] [stdout] | |______- unnecessary `let` binding [INFO] [stdout] 176 | [INFO] [stdout] 177 | added_count [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 138 ~ [INFO] [stdout] 139 | [INFO] [stdout] 140 ~ if dividend_detected { [INFO] [stdout] 141 + // Dividend detected: completely replace existing data with new data [INFO] [stdout] 142 + tracing::info!("Dividend detected - replacing all existing data with new data"); [INFO] [stdout] 143 + let count = sorted_new_data.len(); [INFO] [stdout] 144 + *existing_data = sorted_new_data; [INFO] [stdout] 145 + count [INFO] [stdout] 146 + } else { [INFO] [stdout] 147 + // No dividend: keep existing yesterday data and append/replace today's data [INFO] [stdout] 148 + tracing::debug!("No dividend detected - keeping existing data and updating today"); [INFO] [stdout] 149 + let mut added = 0; [INFO] [stdout] 150 + [INFO] [stdout] 151 + for new_point in sorted_new_data { [INFO] [stdout] 152 + let new_date = new_point.time.date_naive(); [INFO] [stdout] 153 + [INFO] [stdout] 154 + // Skip yesterday's data - keep existing yesterday [INFO] [stdout] 155 + if new_date == yesterday { [INFO] [stdout] 156 + continue; [INFO] [stdout] 157 + } [INFO] [stdout] 158 + [INFO] [stdout] 159 + // For latest date (today), always replace. For other dates, check timestamp [INFO] [stdout] 160 + let is_latest_date = Some(new_date) == latest_date; [INFO] [stdout] 161 + [INFO] [stdout] 162 + if let Some(existing_point) = existing_data.iter_mut().find(|p| p.time.date_naive() == new_date) { [INFO] [stdout] 163 + // Always replace if it's the latest date, or if new timestamp is more recent [INFO] [stdout] 164 + if is_latest_date || new_point.time > existing_point.time { [INFO] [stdout] 165 + *existing_point = new_point; [INFO] [stdout] 166 + } [INFO] [stdout] 167 + } else { [INFO] [stdout] 168 + // Add new data point for this date [INFO] [stdout] 169 + existing_data.push(new_point); [INFO] [stdout] 170 + added += 1; [INFO] [stdout] 171 + } [INFO] [stdout] 172 + } [INFO] [stdout] 173 + [INFO] [stdout] 174 + // Sort by time after merging [INFO] [stdout] 175 + existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 176 + added [INFO] [stdout] 177 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 94 - existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 94 + existing_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:103:5 [INFO] [stdout] | [INFO] [stdout] 103 | existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 103 - existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 103 + existing_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:105:5 [INFO] [stdout] | [INFO] [stdout] 105 | sorted_new_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 105 - sorted_new_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 105 + sorted_new_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:173:9 [INFO] [stdout] | [INFO] [stdout] 173 | existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 173 - existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 173 + existing_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used consecutive `str::replace` call [INFO] [stdout] --> src/utils/cache.rs:27:10 [INFO] [stdout] | [INFO] [stdout] 27 | path.replace('/', "_").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: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | / if let Ok(metadata) = fs::metadata(&path) { [INFO] [stdout] 119 | | if let Ok(modified) = metadata.modified() { [INFO] [stdout] 120 | | if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | | if age > Duration::from_secs(CACHE_TTL_SECS) { [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] 118 ~ if let Ok(metadata) = fs::metadata(&path) [INFO] [stdout] 119 ~ && let Ok(modified) = metadata.modified() { [INFO] [stdout] 120 | if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] ... [INFO] [stdout] 126 | } [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:119:13 [INFO] [stdout] | [INFO] [stdout] 119 | / if let Ok(modified) = metadata.modified() { [INFO] [stdout] 120 | | if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | | if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | | if fs::remove_file(&path).is_ok() { [INFO] [stdout] ... | [INFO] [stdout] 127 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 119 ~ if let Ok(modified) = metadata.modified() [INFO] [stdout] 120 ~ && let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] ... [INFO] [stdout] 125 | } [INFO] [stdout] 126 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:120:17 [INFO] [stdout] | [INFO] [stdout] 120 | / if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | | if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | | if fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | | removed_count += 1; [INFO] [stdout] ... | [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] 120 ~ if let Ok(age) = now.duration_since(modified) [INFO] [stdout] 121 ~ && age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | if fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | removed_count += 1; [INFO] [stdout] 124 | } [INFO] [stdout] 125 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:121:21 [INFO] [stdout] | [INFO] [stdout] 121 | / if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | | if fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | | removed_count += 1; [INFO] [stdout] 124 | | } [INFO] [stdout] 125 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 121 ~ if age > Duration::from_secs(CACHE_TTL_SECS) [INFO] [stdout] 122 ~ && fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | removed_count += 1; [INFO] [stdout] 124 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/vci.rs:169:9 [INFO] [stdout] | [INFO] [stdout] 169 | / ... if self.request_timestamps.len() >= self.rate_limit_per_minute as usize { [INFO] [stdout] 170 | | ... if let Some(&oldest_request) = self.request_timestamps.first() { [INFO] [stdout] 171 | | ... let wait_time = StdDuration::from_secs(60) - current_time.duration_since(oldest_request).unwrap_or(StdDuration::fro... [INFO] [stdout] 172 | | ... if !wait_time.is_zero() { [INFO] [stdout] ... | [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] 169 ~ if self.request_timestamps.len() >= self.rate_limit_per_minute as usize [INFO] [stdout] 170 ~ && let Some(&oldest_request) = self.request_timestamps.first() { [INFO] [stdout] 171 | let wait_time = StdDuration::from_secs(60) - current_time.duration_since(oldest_request).unwrap_or(StdDuration::from_secs(0)); [INFO] [stdout] ... [INFO] [stdout] 174 | } [INFO] [stdout] 175 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/vci.rs:331:16 [INFO] [stdout] | [INFO] [stdout] 331 | if !data_item.get(key).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `data_item.get(key).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:380:9 [INFO] [stdout] | [INFO] [stdout] 380 | result.sort_by(|a, b| a.time.cmp(&b.time)); [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] 380 - result.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 380 + result.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/vci.rs:466:20 [INFO] [stdout] | [INFO] [stdout] 466 | if !data_item.get(key).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `data_item.get(key).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/vci.rs:434:53 [INFO] [stdout] | [INFO] [stdout] 434 | for (_i, data_item) in response_array.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 434 - for (_i, data_item) in response_array.iter().enumerate() { [INFO] [stdout] 434 + for data_item in response_array.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `times` [INFO] [stdout] --> src/vci.rs:501:22 [INFO] [stdout] | [INFO] [stdout] 501 | for j in 0..length.min(10) { // Show first 10 timestamps [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 501 - for j in 0..length.min(10) { // Show first 10 timestamps [INFO] [stdout] 501 + for (j, ) in times.iter().enumerate().take(length.min(10)) { // Show first 10 timestamps [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:539:13 [INFO] [stdout] | [INFO] [stdout] 539 | symbol_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 539 - symbol_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 539 + symbol_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/vci.rs:542:13 [INFO] [stdout] | [INFO] [stdout] 542 | / if self.resample_map.contains_key(interval) && !["1m", "1H", "1D"].contains(&interval) { [INFO] [stdout] 543 | | if let Ok(resampled) = self.resample_ohlcv(symbol_data.clone(), interval) { [INFO] [stdout] 544 | | symbol_data = resampled; [INFO] [stdout] 545 | | } [INFO] [stdout] 546 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 542 ~ if self.resample_map.contains_key(interval) && !["1m", "1H", "1D"].contains(&interval) [INFO] [stdout] 543 ~ && let Ok(resampled) = self.resample_ohlcv(symbol_data.clone(), interval) { [INFO] [stdout] 544 | symbol_data = resampled; [INFO] [stdout] 545 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:776:9 [INFO] [stdout] | [INFO] [stdout] 776 | result.sort_by(|a, b| a.time.cmp(&b.time)); [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] 776 - result.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 776 + result.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:807:9 [INFO] [stdout] | [INFO] [stdout] 807 | result.sort_by(|a, b| a.time.cmp(&b.time)); [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] 807 - result.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 807 + result.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:110:78 [INFO] [stdout] | [INFO] [stdout] 110 | let memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/worker.rs:186:33 [INFO] [stdout] | [INFO] [stdout] 186 | ... limited_data_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [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] 186 - limited_data_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [INFO] [stdout] 186 + limited_data_vec.sort_by_key(|b| std::cmp::Reverse(b.time)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/api.rs:94:46 [INFO] [stdout] | [INFO] [stdout] 94 | let time_matches_start = start_date_filter.map_or(true, |start| ohlcv.time >= start); [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] 94 - let time_matches_start = start_date_filter.map_or(true, |start| ohlcv.time >= start); [INFO] [stdout] 94 + let time_matches_start = start_date_filter.is_none_or(|start| ohlcv.time >= start); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/api.rs:95:44 [INFO] [stdout] | [INFO] [stdout] 95 | let time_matches_end = end_date_filter.map_or(true, |end| ohlcv.time <= end); [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] 95 - let time_matches_end = end_date_filter.map_or(true, |end| ohlcv.time <= end); [INFO] [stdout] 95 + let time_matches_end = end_date_filter.is_none_or(|end| ohlcv.time <= end); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:301:78 [INFO] [stdout] | [INFO] [stdout] 301 | let memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:311:103 [INFO] [stdout] | [INFO] [stdout] 311 | let (cleaned_symbols, cleaned_data_points) = crate::data_structures::cleanup_old_data(&mut *data_guard); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `&mut data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:312:86 [INFO] [stdout] | [INFO] [stdout] 312 | let new_memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/api.rs:159:29 [INFO] [stdout] | [INFO] [stdout] 159 | let should_update = entry.last().map_or(true, |last| payload.time > last.time); [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] 159 - let should_update = entry.last().map_or(true, |last| payload.time > last.time); [INFO] [stdout] 159 + let should_update = entry.last().is_none_or(|last| payload.time > last.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api.rs:212:9 [INFO] [stdout] | [INFO] [stdout] 212 | / if let Some(entry) = data_guard.get(symbol.as_str()) { [INFO] [stdout] 213 | | if let Some(last_data) = entry.last() { [INFO] [stdout] 214 | | let price_change_percent = (payload.close - last_data.close).abs() / last_data.close; [INFO] [stdout] 215 | | debug!( [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] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 212 ~ if let Some(entry) = data_guard.get(symbol.as_str()) [INFO] [stdout] 213 ~ && let Some(last_data) = entry.last() { [INFO] [stdout] 214 | let price_change_percent = (payload.close - last_data.close).abs() / last_data.close; [INFO] [stdout] ... [INFO] [stdout] 237 | } [INFO] [stdout] 238 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/api.rs:284:74 [INFO] [stdout] | [INFO] [stdout] 284 | let memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api.rs:344:5 [INFO] [stdout] | [INFO] [stdout] 344 | / if should_clear_cache { [INFO] [stdout] 345 | | if let Err(e) = cache::clear_cache(&path) { [INFO] [stdout] 346 | | warn!(path, ?e, "Failed to clear cache"); [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] 344 ~ if should_clear_cache [INFO] [stdout] 345 ~ && let Err(e) = cache::clear_cache(&path) { [INFO] [stdout] 346 | warn!(path, ?e, "Failed to clear cache"); [INFO] [stdout] 347 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/config.rs:46:1 [INFO] [stdout] | [INFO] [stdout] 46 | / impl Default for OfficeHoursConfig { [INFO] [stdout] 47 | | fn default() -> Self { [INFO] [stdout] 48 | | Self { [INFO] [stdout] 49 | | default_office_hours: OfficeHours::default(), [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#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 41 + #[derive(Default)] [INFO] [stdout] 42 | pub struct OfficeHoursConfig { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:79:13 [INFO] [stdout] | [INFO] [stdout] 79 | ohlcv_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [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] 79 - ohlcv_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [INFO] [stdout] 79 + ohlcv_vec.sort_by_key(|b| std::cmp::Reverse(b.time)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/data_structures.rs:177:5 [INFO] [stdout] | [INFO] [stdout] 138 | / let added_count = if dividend_detected { [INFO] [stdout] 139 | | // Dividend detected: completely replace existing data with new data [INFO] [stdout] 140 | | tracing::info!("Dividend detected - replacing all existing data with new data"); [INFO] [stdout] 141 | | let count = sorted_new_data.len(); [INFO] [stdout] ... | [INFO] [stdout] 174 | | added [INFO] [stdout] 175 | | }; [INFO] [stdout] | |______- unnecessary `let` binding [INFO] [stdout] 176 | [INFO] [stdout] 177 | added_count [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 138 ~ [INFO] [stdout] 139 | [INFO] [stdout] 140 ~ if dividend_detected { [INFO] [stdout] 141 + // Dividend detected: completely replace existing data with new data [INFO] [stdout] 142 + tracing::info!("Dividend detected - replacing all existing data with new data"); [INFO] [stdout] 143 + let count = sorted_new_data.len(); [INFO] [stdout] 144 + *existing_data = sorted_new_data; [INFO] [stdout] 145 + count [INFO] [stdout] 146 + } else { [INFO] [stdout] 147 + // No dividend: keep existing yesterday data and append/replace today's data [INFO] [stdout] 148 + tracing::debug!("No dividend detected - keeping existing data and updating today"); [INFO] [stdout] 149 + let mut added = 0; [INFO] [stdout] 150 + [INFO] [stdout] 151 + for new_point in sorted_new_data { [INFO] [stdout] 152 + let new_date = new_point.time.date_naive(); [INFO] [stdout] 153 + [INFO] [stdout] 154 + // Skip yesterday's data - keep existing yesterday [INFO] [stdout] 155 + if new_date == yesterday { [INFO] [stdout] 156 + continue; [INFO] [stdout] 157 + } [INFO] [stdout] 158 + [INFO] [stdout] 159 + // For latest date (today), always replace. For other dates, check timestamp [INFO] [stdout] 160 + let is_latest_date = Some(new_date) == latest_date; [INFO] [stdout] 161 + [INFO] [stdout] 162 + if let Some(existing_point) = existing_data.iter_mut().find(|p| p.time.date_naive() == new_date) { [INFO] [stdout] 163 + // Always replace if it's the latest date, or if new timestamp is more recent [INFO] [stdout] 164 + if is_latest_date || new_point.time > existing_point.time { [INFO] [stdout] 165 + *existing_point = new_point; [INFO] [stdout] 166 + } [INFO] [stdout] 167 + } else { [INFO] [stdout] 168 + // Add new data point for this date [INFO] [stdout] 169 + existing_data.push(new_point); [INFO] [stdout] 170 + added += 1; [INFO] [stdout] 171 + } [INFO] [stdout] 172 + } [INFO] [stdout] 173 + [INFO] [stdout] 174 + // Sort by time after merging [INFO] [stdout] 175 + existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 176 + added [INFO] [stdout] 177 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 94 - existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 94 + existing_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:103:5 [INFO] [stdout] | [INFO] [stdout] 103 | existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 103 - existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 103 + existing_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:105:5 [INFO] [stdout] | [INFO] [stdout] 105 | sorted_new_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 105 - sorted_new_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 105 + sorted_new_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/data_structures.rs:173:9 [INFO] [stdout] | [INFO] [stdout] 173 | existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 173 - existing_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 173 + existing_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used consecutive `str::replace` call [INFO] [stdout] --> src/utils/cache.rs:27:10 [INFO] [stdout] | [INFO] [stdout] 27 | path.replace('/', "_").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: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | / if let Ok(metadata) = fs::metadata(&path) { [INFO] [stdout] 119 | | if let Ok(modified) = metadata.modified() { [INFO] [stdout] 120 | | if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | | if age > Duration::from_secs(CACHE_TTL_SECS) { [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] 118 ~ if let Ok(metadata) = fs::metadata(&path) [INFO] [stdout] 119 ~ && let Ok(modified) = metadata.modified() { [INFO] [stdout] 120 | if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] ... [INFO] [stdout] 126 | } [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:119:13 [INFO] [stdout] | [INFO] [stdout] 119 | / if let Ok(modified) = metadata.modified() { [INFO] [stdout] 120 | | if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | | if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | | if fs::remove_file(&path).is_ok() { [INFO] [stdout] ... | [INFO] [stdout] 127 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 119 ~ if let Ok(modified) = metadata.modified() [INFO] [stdout] 120 ~ && let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] ... [INFO] [stdout] 125 | } [INFO] [stdout] 126 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:120:17 [INFO] [stdout] | [INFO] [stdout] 120 | / if let Ok(age) = now.duration_since(modified) { [INFO] [stdout] 121 | | if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | | if fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | | removed_count += 1; [INFO] [stdout] ... | [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] 120 ~ if let Ok(age) = now.duration_since(modified) [INFO] [stdout] 121 ~ && age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | if fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | removed_count += 1; [INFO] [stdout] 124 | } [INFO] [stdout] 125 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/cache.rs:121:21 [INFO] [stdout] | [INFO] [stdout] 121 | / if age > Duration::from_secs(CACHE_TTL_SECS) { [INFO] [stdout] 122 | | if fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | | removed_count += 1; [INFO] [stdout] 124 | | } [INFO] [stdout] 125 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 121 ~ if age > Duration::from_secs(CACHE_TTL_SECS) [INFO] [stdout] 122 ~ && fs::remove_file(&path).is_ok() { [INFO] [stdout] 123 | removed_count += 1; [INFO] [stdout] 124 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/vci.rs:169:9 [INFO] [stdout] | [INFO] [stdout] 169 | / ... if self.request_timestamps.len() >= self.rate_limit_per_minute as usize { [INFO] [stdout] 170 | | ... if let Some(&oldest_request) = self.request_timestamps.first() { [INFO] [stdout] 171 | | ... let wait_time = StdDuration::from_secs(60) - current_time.duration_since(oldest_request).unwrap_or(StdDuration::fro... [INFO] [stdout] 172 | | ... if !wait_time.is_zero() { [INFO] [stdout] ... | [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] 169 ~ if self.request_timestamps.len() >= self.rate_limit_per_minute as usize [INFO] [stdout] 170 ~ && let Some(&oldest_request) = self.request_timestamps.first() { [INFO] [stdout] 171 | let wait_time = StdDuration::from_secs(60) - current_time.duration_since(oldest_request).unwrap_or(StdDuration::from_secs(0)); [INFO] [stdout] ... [INFO] [stdout] 174 | } [INFO] [stdout] 175 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/vci.rs:331:16 [INFO] [stdout] | [INFO] [stdout] 331 | if !data_item.get(key).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `data_item.get(key).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:380:9 [INFO] [stdout] | [INFO] [stdout] 380 | result.sort_by(|a, b| a.time.cmp(&b.time)); [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] 380 - result.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 380 + result.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/vci.rs:466:20 [INFO] [stdout] | [INFO] [stdout] 466 | if !data_item.get(key).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `data_item.get(key).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/vci.rs:434:53 [INFO] [stdout] | [INFO] [stdout] 434 | for (_i, data_item) in response_array.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 434 - for (_i, data_item) in response_array.iter().enumerate() { [INFO] [stdout] 434 + for data_item in response_array.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `times` [INFO] [stdout] --> src/vci.rs:501:22 [INFO] [stdout] | [INFO] [stdout] 501 | for j in 0..length.min(10) { // Show first 10 timestamps [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 501 - for j in 0..length.min(10) { // Show first 10 timestamps [INFO] [stdout] 501 + for (j, ) in times.iter().enumerate().take(length.min(10)) { // Show first 10 timestamps [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:539:13 [INFO] [stdout] | [INFO] [stdout] 539 | symbol_data.sort_by(|a, b| a.time.cmp(&b.time)); [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] 539 - symbol_data.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 539 + symbol_data.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/vci.rs:542:13 [INFO] [stdout] | [INFO] [stdout] 542 | / if self.resample_map.contains_key(interval) && !["1m", "1H", "1D"].contains(&interval) { [INFO] [stdout] 543 | | if let Ok(resampled) = self.resample_ohlcv(symbol_data.clone(), interval) { [INFO] [stdout] 544 | | symbol_data = resampled; [INFO] [stdout] 545 | | } [INFO] [stdout] 546 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 542 ~ if self.resample_map.contains_key(interval) && !["1m", "1H", "1D"].contains(&interval) [INFO] [stdout] 543 ~ && let Ok(resampled) = self.resample_ohlcv(symbol_data.clone(), interval) { [INFO] [stdout] 544 | symbol_data = resampled; [INFO] [stdout] 545 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:776:9 [INFO] [stdout] | [INFO] [stdout] 776 | result.sort_by(|a, b| a.time.cmp(&b.time)); [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] 776 - result.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 776 + result.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/vci.rs:807:9 [INFO] [stdout] | [INFO] [stdout] 807 | result.sort_by(|a, b| a.time.cmp(&b.time)); [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] 807 - result.sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 807 + result.sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:110:78 [INFO] [stdout] | [INFO] [stdout] 110 | let memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/worker.rs:186:33 [INFO] [stdout] | [INFO] [stdout] 186 | ... limited_data_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [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] 186 - limited_data_vec.sort_by(|a, b| b.time.cmp(&a.time)); // Newest first [INFO] [stdout] 186 + limited_data_vec.sort_by_key(|b| std::cmp::Reverse(b.time)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:301:78 [INFO] [stdout] | [INFO] [stdout] 301 | let memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:311:103 [INFO] [stdout] | [INFO] [stdout] 311 | let (cleaned_symbols, cleaned_data_points) = crate::data_structures::cleanup_old_data(&mut *data_guard); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `&mut data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/worker.rs:312:86 [INFO] [stdout] | [INFO] [stdout] 312 | let new_memory_bytes = crate::data_structures::estimate_memory_usage(&*data_guard); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&data_guard` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 21s [INFO] running `Command { std: "docker" "inspect" "bd87c7f2ee08705cf34cf2fb339c003cb1b9b562a1f0c8d5abc3a55550859d38", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "bd87c7f2ee08705cf34cf2fb339c003cb1b9b562a1f0c8d5abc3a55550859d38", kill_on_drop: false }` [INFO] [stdout] bd87c7f2ee08705cf34cf2fb339c003cb1b9b562a1f0c8d5abc3a55550859d38