[INFO] cloning repository https://github.com/JasonVranek/Flowrs [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/JasonVranek/Flowrs" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FJasonVranek%2FFlowrs", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FJasonVranek%2FFlowrs'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 3efff655fa0e86b9251feeb6991b1f7aba220d8a [INFO] linting JasonVranek/Flowrs against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FJasonVranek%2FFlowrs" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/JasonVranek/Flowrs [INFO] finished tweaking git repo https://github.com/JasonVranek/Flowrs [INFO] tweaked toml for git repo https://github.com/JasonVranek/Flowrs written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/JasonVranek/Flowrs 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] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "generate-lockfile" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Locking 116 packages to latest compatible versions [INFO] [stderr] Adding env_logger v0.6.2 (available: v0.11.9) [INFO] [stderr] Adding futures v0.1.31 (available: v0.3.32) [INFO] [stderr] Adding rand v0.6.5 (available: v0.10.0) [INFO] [stderr] Adding tokio v0.1.22 (available: v1.50.0) [INFO] [stderr] Adding tokio-serde v0.3.0 (available: v0.9.0) [INFO] [stderr] Adding tokio-serde-json v0.2.0 (available: v0.3.0) [INFO] [stderr] Adding ws v0.7.9 (available: v0.9.2) [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] Downloading crates ... [INFO] [stderr] Downloaded tokio-serde v0.3.0 [INFO] [stderr] Downloaded tokio-serde-json v0.2.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 6bbe3498b694bc772b3b6c5b01dd4d9df21fbe1334c7448303325ca0583f8a87 [INFO] running `Command { std: "docker" "start" "-a" "6bbe3498b694bc772b3b6c5b01dd4d9df21fbe1334c7448303325ca0583f8a87", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "6bbe3498b694bc772b3b6c5b01dd4d9df21fbe1334c7448303325ca0583f8a87", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "6bbe3498b694bc772b3b6c5b01dd4d9df21fbe1334c7448303325ca0583f8a87", kill_on_drop: false }` [INFO] [stdout] 6bbe3498b694bc772b3b6c5b01dd4d9df21fbe1334c7448303325ca0583f8a87 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] f93e50b179d471869ef81f6c59fd129c056ed5e57f205a3c0370e3fe11c1d1e1 [INFO] running `Command { std: "docker" "start" "-a" "f93e50b179d471869ef81f6c59fd129c056ed5e57f205a3c0370e3fe11c1d1e1", kill_on_drop: false }` [INFO] [stderr] Checking iovec v0.1.4 [INFO] [stderr] Compiling crossbeam-utils v0.7.2 [INFO] [stderr] Compiling maybe-uninit v2.0.0 [INFO] [stderr] Checking futures v0.1.31 [INFO] [stderr] Checking net2 v0.2.39 [INFO] [stderr] Compiling autocfg v0.1.8 [INFO] [stderr] Checking num_cpus v1.17.0 [INFO] [stderr] Compiling memoffset v0.5.6 [INFO] [stderr] Compiling crossbeam-epoch v0.8.2 [INFO] [stderr] Checking lock_api v0.3.4 [INFO] [stderr] Checking rand_core v0.3.1 [INFO] [stderr] Compiling proc-macro2 v1.0.106 [INFO] [stderr] Compiling parking_lot_core v0.6.3 [INFO] [stderr] Compiling parking_lot v0.9.0 [INFO] [stderr] Checking tinyvec v1.11.0 [INFO] [stderr] Compiling quote v1.0.45 [INFO] [stderr] Checking bytes v0.4.12 [INFO] [stderr] Checking regex-syntax v0.8.10 [INFO] [stderr] Compiling rand_chacha v0.1.1 [INFO] [stderr] Compiling rand_pcg v0.1.2 [INFO] [stderr] Compiling serde v1.0.228 [INFO] [stderr] Compiling rand v0.6.5 [INFO] [stderr] Checking percent-encoding v1.0.1 [INFO] [stderr] Checking lazycell v1.3.0 [INFO] [stderr] Checking mio v0.6.23 [INFO] [stderr] Checking sha1 v0.6.1 [INFO] [stderr] Checking unicode-normalization v0.1.25 [INFO] [stderr] Checking humantime v1.3.0 [INFO] [stderr] Checking rand_xorshift v0.1.1 [INFO] [stderr] Checking rand_hc v0.1.0 [INFO] [stderr] Checking rand_isaac v0.1.1 [INFO] [stderr] Checking rand_jitter v0.1.4 [INFO] [stderr] Checking rand_os v0.1.3 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Checking rand v0.4.6 [INFO] [stderr] Checking smallvec v0.6.14 [INFO] [stderr] Checking crossbeam-queue v0.2.3 [INFO] [stderr] Checking idna v0.1.5 [INFO] [stderr] Checking mio-uds v0.6.8 [INFO] [stderr] Checking mio-extras v2.0.6 [INFO] [stderr] Compiling syn v2.0.117 [INFO] [stderr] Checking crossbeam-deque v0.7.4 [INFO] [stderr] Checking url v1.7.2 [INFO] [stderr] Checking tokio-executor v0.1.10 [INFO] [stderr] Checking tokio-io v0.1.13 [INFO] [stderr] Checking tokio-sync v0.1.8 [INFO] [stderr] Checking tokio-serde v0.3.0 [INFO] [stderr] Checking tokio-serde-json v0.2.0 [INFO] [stderr] Checking tokio-threadpool v0.1.18 [INFO] [stderr] Checking tokio-current-thread v0.1.7 [INFO] [stderr] Checking tokio-timer v0.2.13 [INFO] [stderr] Checking ws v0.7.9 [INFO] [stderr] Checking tokio-reactor v0.1.12 [INFO] [stderr] Checking tokio-codec v0.1.2 [INFO] [stderr] Checking tokio-fs v0.1.7 [INFO] [stderr] Checking tokio-tcp v0.1.4 [INFO] [stderr] Checking tokio-udp v0.1.6 [INFO] [stderr] Checking tokio-uds v0.2.7 [INFO] [stderr] Checking regex-automata v0.4.14 [INFO] [stderr] Checking tokio v0.1.22 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Checking regex v1.12.3 [INFO] [stderr] Checking env_logger v0.6.2 [INFO] [stderr] Checking flow_rs v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/io/ws_json.rs:46:12 [INFO] [stdout] | [INFO] [stdout] 46 | out: out, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `out` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/io/ws_json.rs:75:4 [INFO] [stdout] | [INFO] [stdout] 75 | out: out, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `out` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/io/ws_json.rs:46:12 [INFO] [stdout] | [INFO] [stdout] 46 | out: out, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `out` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/io/ws_json.rs:75:4 [INFO] [stdout] | [INFO] [stdout] 75 | out: out, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `out` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/order/mod.rs:1:24 [INFO] [stdout] | [INFO] [stdout] 1 | type CustClosure = Box f64 + Send + Sync + 'static>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(bare_trait_objects)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 1 | type CustClosure = Box f64 + Send + Sync + 'static>; [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/controller/mod.rs:39:26 [INFO] [stdout] | [INFO] [stdout] 39 | pub type AsyncTask = Box + Send>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 39 | pub type AsyncTask = Box + Send>; [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/order/mod.rs:1:24 [INFO] [stdout] | [INFO] [stdout] 1 | type CustClosure = Box f64 + Send + Sync + 'static>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(bare_trait_objects)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 1 | type CustClosure = Box f64 + Send + Sync + 'static>; [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/controller/mod.rs:39:26 [INFO] [stdout] | [INFO] [stdout] 39 | pub type AsyncTask = Box + Send>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 39 | pub type AsyncTask = Box + Send>; [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/io/ws_json.rs:73:2 [INFO] [stdout] | [INFO] [stdout] 73 | / let _ws_client = connect(address, move |out| { [INFO] [stdout] 74 | | Client { [INFO] [stdout] 75 | | out: out, [INFO] [stdout] 76 | | json: json.clone() [INFO] [stdout] 77 | | } [INFO] [stdout] 78 | | }).expect("Error with Client"); [INFO] [stdout] | |___________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 73 - let _ws_client = connect(address, move |out| { [INFO] [stdout] 73 + connect(address, move |out| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing a legacy numeric constant [INFO] [stdout] --> src/exchange/order_book.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use core::f64::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import and use the associated constant `f64::MAX` from the primitive type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/exchange/order_book.rs:30:29 [INFO] [stdout] | [INFO] [stdout] 30 | min_price: Mutex::new(MAX), [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 30 | min_price: Mutex::new(f64::MAX), [INFO] [stdout] | +++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/exchange/order_book.rs:70:69 [INFO] [stdout] | [INFO] [stdout] 70 | let order_index: Option = orders.iter().position(|o| &o.trader_id == &order.trader_id); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 70 - let order_index: Option = orders.iter().position(|o| &o.trader_id == &order.trader_id); [INFO] [stdout] 70 + let order_index: Option = orders.iter().position(|o| o.trader_id == order.trader_id); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Book` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/exchange/order_book.rs:90:5 [INFO] [stdout] | [INFO] [stdout] 90 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/exchange/order_book.rs:114:6 [INFO] [stdout] | [INFO] [stdout] 114 | price.clone() as f64 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `price.clone()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/exchange/order_book.rs:114:6 [INFO] [stdout] | [INFO] [stdout] 114 | price.clone() as f64 [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*price` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/exchange/order_book.rs:120:6 [INFO] [stdout] | [INFO] [stdout] 120 | price.clone() as f64 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `price.clone()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/exchange/order_book.rs:120:6 [INFO] [stdout] | [INFO] [stdout] 120 | price.clone() as f64 [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*price` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/exchange/order_book.rs:142:39 [INFO] [stdout] | [INFO] [stdout] 142 | let new_min = orders.iter().fold(MAX, |min, order| if order.p_low < min {order.p_low} else {min}); [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 142 | let new_min = orders.iter().fold(f64::MAX, |min, order| if order.p_low < min {order.p_low} else {min}); [INFO] [stdout] | +++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/exchange/auction.rs:137:7 [INFO] [stdout] | [INFO] [stdout] 137 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 137 - return true; [INFO] [stdout] 137 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/exchange/auction.rs:139:7 [INFO] [stdout] | [INFO] [stdout] 139 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 139 - return false; [INFO] [stdout] 139 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/exchange/auction.rs:136:6 [INFO] [stdout] | [INFO] [stdout] 136 | / if (a - b).abs() > EPSILON && a - b > 0.0 { [INFO] [stdout] 137 | | return true; [INFO] [stdout] 138 | | } else { [INFO] [stdout] 139 | | return false; [INFO] [stdout] 140 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `return (a - b).abs() > EPSILON && a - b > 0.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/exchange/auction.rs:148:7 [INFO] [stdout] | [INFO] [stdout] 148 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 148 - return true; [INFO] [stdout] 148 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/exchange/auction.rs:150:7 [INFO] [stdout] | [INFO] [stdout] 150 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 150 - return false; [INFO] [stdout] 150 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/exchange/auction.rs:147:6 [INFO] [stdout] | [INFO] [stdout] 147 | / if (a - b).abs() > EPSILON && a - b < 0.0 { [INFO] [stdout] 148 | | return true; [INFO] [stdout] 149 | | } else { [INFO] [stdout] 150 | | return false; [INFO] [stdout] 151 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `return (a - b).abs() > EPSILON && a - b < 0.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/exchange/auction.rs:156:7 [INFO] [stdout] | [INFO] [stdout] 156 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 156 - return true; [INFO] [stdout] 156 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/exchange/auction.rs:158:7 [INFO] [stdout] | [INFO] [stdout] 158 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 158 - return false; [INFO] [stdout] 158 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/exchange/auction.rs:155:6 [INFO] [stdout] | [INFO] [stdout] 155 | / if (a - b).abs() < EPSILON { [INFO] [stdout] 156 | | return true; [INFO] [stdout] 157 | | } else { [INFO] [stdout] 158 | | return false; [INFO] [stdout] 159 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `return (a - b).abs() < EPSILON` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/exchange/order_processing.rs:56:6 [INFO] [stdout] | [INFO] [stdout] 54 | let serializer = WriteJson::new(length_delimited); [INFO] [stdout] | -------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 55 | [INFO] [stdout] 56 | serializer [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] 54 ~ [INFO] [stdout] 55 | [INFO] [stdout] 56 ~ WriteJson::new(length_delimited) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/exchange/order_processing.rs:66:6 [INFO] [stdout] | [INFO] [stdout] 64 | let deserialized = ReadJson::<_, Value>::new(length_delimited); [INFO] [stdout] | --------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 65 | [INFO] [stdout] 66 | deserialized [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] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 64 ~ [INFO] [stdout] 65 | [INFO] [stdout] 66 ~ ReadJson::<_, Value>::new(length_delimited) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/io/ws_json.rs:73:2 [INFO] [stdout] | [INFO] [stdout] 73 | / let _ws_client = connect(address, move |out| { [INFO] [stdout] 74 | | Client { [INFO] [stdout] 75 | | out: out, [INFO] [stdout] 76 | | json: json.clone() [INFO] [stdout] 77 | | } [INFO] [stdout] 78 | | }).expect("Error with Client"); [INFO] [stdout] | |___________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 73 - let _ws_client = connect(address, move |out| { [INFO] [stdout] 73 + connect(address, move |out| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing a legacy numeric constant [INFO] [stdout] --> src/exchange/order_book.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use core::f64::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import and use the associated constant `f64::MAX` from the primitive type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/exchange/order_book.rs:30:29 [INFO] [stdout] | [INFO] [stdout] 30 | min_price: Mutex::new(MAX), [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 30 | min_price: Mutex::new(f64::MAX), [INFO] [stdout] | +++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Queue` [INFO] [stdout] --> src/exchange/queue.rs:11:2 [INFO] [stdout] | [INFO] [stdout] 11 | / pub fn new() -> Queue { [INFO] [stdout] 12 | | Queue { [INFO] [stdout] 13 | | items: Mutex::new(Vec::::new()), [INFO] [stdout] 14 | | } [INFO] [stdout] 15 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 10 + impl Default for Queue { [INFO] [stdout] 11 + fn default() -> Self { [INFO] [stdout] 12 + Self::new() [INFO] [stdout] 13 + } [INFO] [stdout] 14 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/exchange/order_book.rs:70:69 [INFO] [stdout] | [INFO] [stdout] 70 | let order_index: Option = orders.iter().position(|o| &o.trader_id == &order.trader_id); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 70 - let order_index: Option = orders.iter().position(|o| &o.trader_id == &order.trader_id); [INFO] [stdout] 70 + let order_index: Option = orders.iter().position(|o| o.trader_id == order.trader_id); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/exchange/queue_processing.rs:70:20 [INFO] [stdout] | [INFO] [stdout] 70 | let p_high = order.p_high.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.p_high` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/exchange/queue_processing.rs:71:16 [INFO] [stdout] | [INFO] [stdout] 71 | let p_low = order.p_low.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.p_low` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Book` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/exchange/order_book.rs:90:5 [INFO] [stdout] | [INFO] [stdout] 90 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/exchange/queue_processing.rs:107:17 [INFO] [stdout] | [INFO] [stdout] 107 | let p_high = order.p_high.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.p_high` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/exchange/queue_processing.rs:108:16 [INFO] [stdout] | [INFO] [stdout] 108 | let p_low = order.p_low.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.p_low` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/exchange/order_book.rs:114:6 [INFO] [stdout] | [INFO] [stdout] 114 | price.clone() as f64 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `price.clone()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/exchange/order_book.rs:114:6 [INFO] [stdout] | [INFO] [stdout] 114 | price.clone() as f64 [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*price` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/exchange/order_book.rs:120:6 [INFO] [stdout] | [INFO] [stdout] 120 | price.clone() as f64 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `price.clone()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/exchange/order_book.rs:120:6 [INFO] [stdout] | [INFO] [stdout] 120 | price.clone() as f64 [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*price` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Traders` [INFO] [stdout] --> src/simulation/trader.rs:16:2 [INFO] [stdout] | [INFO] [stdout] 16 | / pub fn new() -> Self { [INFO] [stdout] 17 | | Traders { [INFO] [stdout] 18 | | traders: Mutex::new(HashMap::new()), [INFO] [stdout] 19 | | } [INFO] [stdout] 20 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 15 + impl Default for Traders { [INFO] [stdout] 16 + fn default() -> Self { [INFO] [stdout] 17 + Self::new() [INFO] [stdout] 18 + } [INFO] [stdout] 19 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/exchange/order_book.rs:142:39 [INFO] [stdout] | [INFO] [stdout] 142 | let new_min = orders.iter().fold(MAX, |min, order| if order.p_low < min {order.p_low} else {min}); [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 142 | let new_min = orders.iter().fold(f64::MAX, |min, order| if order.p_low < min {order.p_low} else {min}); [INFO] [stdout] | +++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/simulation/trader_behavior.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | / return (order.trader_id.clone(), [INFO] [stdout] 14 | | order.order_type.clone(), [INFO] [stdout] 15 | | order.trade_type.clone(), [INFO] [stdout] 16 | | order.p_low.clone(), [INFO] [stdout] 17 | | order.p_high.clone(), [INFO] [stdout] 18 | | order.u_max.clone()); [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 13 ~ (order.trader_id.clone(), [INFO] [stdout] 14 + order.order_type.clone(), [INFO] [stdout] 15 + order.trade_type.clone(), [INFO] [stdout] 16 + order.p_low.clone(), [INFO] [stdout] 17 + order.p_high.clone(), [INFO] [stdout] 18 ~ order.u_max.clone()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/simulation/trader_behavior.rs:16:9 [INFO] [stdout] | [INFO] [stdout] 16 | order.p_low.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.p_low` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/simulation/trader_behavior.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | order.p_high.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.p_high` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/simulation/trader_behavior.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | order.u_max.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.u_max` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/exchange/order_book.rs:162:47 [INFO] [stdout] | [INFO] [stdout] 162 | assert_eq!(*book.min_price.lock().unwrap(), MAX); [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 162 | assert_eq!(*book.min_price.lock().unwrap(), f64::MAX); [INFO] [stdout] | +++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/simulation/trader_behavior.rs:81:4 [INFO] [stdout] | [INFO] [stdout] 81 | !(rand == 1) [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `(rand != 1)` [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: unneeded `return` statement [INFO] [stdout] --> src/exchange/auction.rs:137:7 [INFO] [stdout] | [INFO] [stdout] 137 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 137 - return true; [INFO] [stdout] 137 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/exchange/auction.rs:139:7 [INFO] [stdout] | [INFO] [stdout] 139 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 139 - return false; [INFO] [stdout] 139 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/exchange/auction.rs:136:6 [INFO] [stdout] | [INFO] [stdout] 136 | / if (a - b).abs() > EPSILON && a - b > 0.0 { [INFO] [stdout] 137 | | return true; [INFO] [stdout] 138 | | } else { [INFO] [stdout] 139 | | return false; [INFO] [stdout] 140 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `return (a - b).abs() > EPSILON && a - b > 0.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/exchange/auction.rs:148:7 [INFO] [stdout] | [INFO] [stdout] 148 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 148 - return true; [INFO] [stdout] 148 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/exchange/auction.rs:150:7 [INFO] [stdout] | [INFO] [stdout] 150 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 150 - return false; [INFO] [stdout] 150 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/exchange/auction.rs:147:6 [INFO] [stdout] | [INFO] [stdout] 147 | / if (a - b).abs() > EPSILON && a - b < 0.0 { [INFO] [stdout] 148 | | return true; [INFO] [stdout] 149 | | } else { [INFO] [stdout] 150 | | return false; [INFO] [stdout] 151 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `return (a - b).abs() > EPSILON && a - b < 0.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/exchange/auction.rs:156:7 [INFO] [stdout] | [INFO] [stdout] 156 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 156 - return true; [INFO] [stdout] 156 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/exchange/auction.rs:158:7 [INFO] [stdout] | [INFO] [stdout] 158 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 158 - return false; [INFO] [stdout] 158 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/exchange/auction.rs:155:6 [INFO] [stdout] | [INFO] [stdout] 155 | / if (a - b).abs() < EPSILON { [INFO] [stdout] 156 | | return true; [INFO] [stdout] 157 | | } else { [INFO] [stdout] 158 | | return false; [INFO] [stdout] 159 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `return (a - b).abs() < EPSILON` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/order/mod.rs:128:6 [INFO] [stdout] | [INFO] [stdout] 119 | / let func = Box::new(move |x: f64| -> f64 { [INFO] [stdout] 120 | | if x <= p_l { [INFO] [stdout] 121 | | u [INFO] [stdout] 122 | | } else if x > p_h { [INFO] [stdout] ... | [INFO] [stdout] 127 | | }); [INFO] [stdout] | |___________- unnecessary `let` binding [INFO] [stdout] 128 | func [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] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 119 ~ [INFO] [stdout] 120 ~ (Box::new(move |x: f64| -> f64 { [INFO] [stdout] 121 ~ if x <= p_l { [INFO] [stdout] 122 ~ u [INFO] [stdout] 123 ~ } else if x > p_h { [INFO] [stdout] 124 ~ 0.0 [INFO] [stdout] 125 ~ } else { [INFO] [stdout] 126 ~ u * ((p_h - x) / (p_h - p_l)) [INFO] [stdout] 127 ~ } [INFO] [stdout] 128 ~ })) as _ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/order/mod.rs:144:6 [INFO] [stdout] | [INFO] [stdout] 135 | / let func = Box::new(move |x: f64| -> f64 { [INFO] [stdout] 136 | | if x < p_l { [INFO] [stdout] 137 | | 0.0 [INFO] [stdout] 138 | | } else if x >= p_h { [INFO] [stdout] ... | [INFO] [stdout] 143 | | }); [INFO] [stdout] | |___________- unnecessary `let` binding [INFO] [stdout] 144 | func [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] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 135 ~ [INFO] [stdout] 136 ~ (Box::new(move |x: f64| -> f64 { [INFO] [stdout] 137 ~ if x < p_l { [INFO] [stdout] 138 ~ 0.0 [INFO] [stdout] 139 ~ } else if x >= p_h { [INFO] [stdout] 140 ~ u [INFO] [stdout] 141 ~ } else { [INFO] [stdout] 142 ~ u + ((x - p_h) / (p_h - p_l)) * u [INFO] [stdout] 143 ~ } [INFO] [stdout] 144 ~ })) as _ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Controller` [INFO] [stdout] --> src/controller/mod.rs:22:2 [INFO] [stdout] | [INFO] [stdout] 22 | / pub fn new() -> Controller { [INFO] [stdout] 23 | | Controller{ [INFO] [stdout] 24 | | tasks: Vec::::new(), [INFO] [stdout] 25 | | } [INFO] [stdout] 26 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 21 + impl Default for Controller { [INFO] [stdout] 22 + fn default() -> Self { [INFO] [stdout] 23 + Self::new() [INFO] [stdout] 24 + } [INFO] [stdout] 25 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/simulation/random_behavior.rs:83:33 [INFO] [stdout] | [INFO] [stdout] 83 | let addr = address.clone(); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] = note: `#[warn(noop_method_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/simulation/random_behavior.rs:104:32 [INFO] [stdout] | [INFO] [stdout] 104 | let addr = address.clone(); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/simulation/random_behavior.rs:124:35 [INFO] [stdout] | [INFO] [stdout] 124 | let addr = address.clone(); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/simulation/random_behavior.rs:127:33 [INFO] [stdout] | [INFO] [stdout] 127 | let addr = addr.clone(); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/exchange/order_processing.rs:56:6 [INFO] [stdout] | [INFO] [stdout] 54 | let serializer = WriteJson::new(length_delimited); [INFO] [stdout] | -------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 55 | [INFO] [stdout] 56 | serializer [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] 54 ~ [INFO] [stdout] 55 | [INFO] [stdout] 56 ~ WriteJson::new(length_delimited) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/exchange/order_processing.rs:66:6 [INFO] [stdout] | [INFO] [stdout] 64 | let deserialized = ReadJson::<_, Value>::new(length_delimited); [INFO] [stdout] | --------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 65 | [INFO] [stdout] 66 | deserialized [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] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 64 ~ [INFO] [stdout] 65 | [INFO] [stdout] 66 ~ ReadJson::<_, Value>::new(length_delimited) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Queue` [INFO] [stdout] --> src/exchange/queue.rs:11:2 [INFO] [stdout] | [INFO] [stdout] 11 | / pub fn new() -> Queue { [INFO] [stdout] 12 | | Queue { [INFO] [stdout] 13 | | items: Mutex::new(Vec::::new()), [INFO] [stdout] 14 | | } [INFO] [stdout] 15 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 10 + impl Default for Queue { [INFO] [stdout] 11 + fn default() -> Self { [INFO] [stdout] 12 + Self::new() [INFO] [stdout] 13 + } [INFO] [stdout] 14 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/exchange/queue_processing.rs:70:20 [INFO] [stdout] | [INFO] [stdout] 70 | let p_high = order.p_high.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.p_high` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/exchange/queue_processing.rs:71:16 [INFO] [stdout] | [INFO] [stdout] 71 | let p_low = order.p_low.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.p_low` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/exchange/queue_processing.rs:107:17 [INFO] [stdout] | [INFO] [stdout] 107 | let p_high = order.p_high.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.p_high` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/exchange/queue_processing.rs:108:16 [INFO] [stdout] | [INFO] [stdout] 108 | let p_low = order.p_low.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.p_low` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Traders` [INFO] [stdout] --> src/simulation/trader.rs:16:2 [INFO] [stdout] | [INFO] [stdout] 16 | / pub fn new() -> Self { [INFO] [stdout] 17 | | Traders { [INFO] [stdout] 18 | | traders: Mutex::new(HashMap::new()), [INFO] [stdout] 19 | | } [INFO] [stdout] 20 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 15 + impl Default for Traders { [INFO] [stdout] 16 + fn default() -> Self { [INFO] [stdout] 17 + Self::new() [INFO] [stdout] 18 + } [INFO] [stdout] 19 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/simulation/trader_behavior.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | / return (order.trader_id.clone(), [INFO] [stdout] 14 | | order.order_type.clone(), [INFO] [stdout] 15 | | order.trade_type.clone(), [INFO] [stdout] 16 | | order.p_low.clone(), [INFO] [stdout] 17 | | order.p_high.clone(), [INFO] [stdout] 18 | | order.u_max.clone()); [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 13 ~ (order.trader_id.clone(), [INFO] [stdout] 14 + order.order_type.clone(), [INFO] [stdout] 15 + order.trade_type.clone(), [INFO] [stdout] 16 + order.p_low.clone(), [INFO] [stdout] 17 + order.p_high.clone(), [INFO] [stdout] 18 ~ order.u_max.clone()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/simulation/trader_behavior.rs:16:9 [INFO] [stdout] | [INFO] [stdout] 16 | order.p_low.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.p_low` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/simulation/trader_behavior.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | order.p_high.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.p_high` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f64` which implements the `Copy` trait [INFO] [stdout] --> src/simulation/trader_behavior.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | order.u_max.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `order.u_max` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/simulation/trader_behavior.rs:81:4 [INFO] [stdout] | [INFO] [stdout] 81 | !(rand == 1) [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `(rand != 1)` [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: useless use of `format!` [INFO] [stdout] --> examples/random_arrivals.rs:16:23 [INFO] [stdout] | [INFO] [stdout] 16 | let tcp_address = format!("127.0.0.1:5000"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"127.0.0.1:5000".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> examples/random_arrivals.rs:31:84 [INFO] [stdout] | [INFO] [stdout] 31 | let ws_arrivals = RandBehavior::ws_arrival_interval(Arc::clone(&traders), 500, &ws_address); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `ws_address` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> examples/random_arrivals.rs:32:83 [INFO] [stdout] | [INFO] [stdout] 32 | let ws_updates = RandBehavior::ws_update_interval(Arc::clone(&traders), 1000, &ws_address); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `ws_address` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> examples/random_arrivals.rs:33:83 [INFO] [stdout] | [INFO] [stdout] 33 | let ws_cancels = RandBehavior::ws_cancel_interval(Arc::clone(&traders), 2000, &ws_address); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `ws_address` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/order/mod.rs:128:6 [INFO] [stdout] | [INFO] [stdout] 119 | / let func = Box::new(move |x: f64| -> f64 { [INFO] [stdout] 120 | | if x <= p_l { [INFO] [stdout] 121 | | u [INFO] [stdout] 122 | | } else if x > p_h { [INFO] [stdout] ... | [INFO] [stdout] 127 | | }); [INFO] [stdout] | |___________- unnecessary `let` binding [INFO] [stdout] 128 | func [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] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 119 ~ [INFO] [stdout] 120 ~ (Box::new(move |x: f64| -> f64 { [INFO] [stdout] 121 ~ if x <= p_l { [INFO] [stdout] 122 ~ u [INFO] [stdout] 123 ~ } else if x > p_h { [INFO] [stdout] 124 ~ 0.0 [INFO] [stdout] 125 ~ } else { [INFO] [stdout] 126 ~ u * ((p_h - x) / (p_h - p_l)) [INFO] [stdout] 127 ~ } [INFO] [stdout] 128 ~ })) as _ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/order/mod.rs:144:6 [INFO] [stdout] | [INFO] [stdout] 135 | / let func = Box::new(move |x: f64| -> f64 { [INFO] [stdout] 136 | | if x < p_l { [INFO] [stdout] 137 | | 0.0 [INFO] [stdout] 138 | | } else if x >= p_h { [INFO] [stdout] ... | [INFO] [stdout] 143 | | }); [INFO] [stdout] | |___________- unnecessary `let` binding [INFO] [stdout] 144 | func [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] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 135 ~ [INFO] [stdout] 136 ~ (Box::new(move |x: f64| -> f64 { [INFO] [stdout] 137 ~ if x < p_l { [INFO] [stdout] 138 ~ 0.0 [INFO] [stdout] 139 ~ } else if x >= p_h { [INFO] [stdout] 140 ~ u [INFO] [stdout] 141 ~ } else { [INFO] [stdout] 142 ~ u + ((x - p_h) / (p_h - p_l)) * u [INFO] [stdout] 143 ~ } [INFO] [stdout] 144 ~ })) as _ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> src/order/mod.rs:163:9 [INFO] [stdout] | [INFO] [stdout] 163 | x + 1 as f64 [INFO] [stdout] | ^^^^^^^^ help: try: `1_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Controller` [INFO] [stdout] --> src/controller/mod.rs:22:2 [INFO] [stdout] | [INFO] [stdout] 22 | / pub fn new() -> Controller { [INFO] [stdout] 23 | | Controller{ [INFO] [stdout] 24 | | tasks: Vec::::new(), [INFO] [stdout] 25 | | } [INFO] [stdout] 26 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 21 + impl Default for Controller { [INFO] [stdout] 22 + fn default() -> Self { [INFO] [stdout] 23 + Self::new() [INFO] [stdout] 24 + } [INFO] [stdout] 25 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/main.rs:38:52 [INFO] [stdout] | [INFO] [stdout] 38 | let tcp_server = tcp_listener(Arc::clone(&queue), format!("127.0.0.1:5000")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"127.0.0.1:5000".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:44:51 [INFO] [stdout] | [INFO] [stdout] 44 | let _ws_server = ws_listener(Arc::clone(&queue), &address); [INFO] [stdout] | ^^^^^^^^ help: change this to: `address` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/simulation/random_behavior.rs:83:33 [INFO] [stdout] | [INFO] [stdout] 83 | let addr = address.clone(); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] = note: `#[warn(noop_method_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/simulation/random_behavior.rs:104:32 [INFO] [stdout] | [INFO] [stdout] 104 | let addr = address.clone(); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/simulation/random_behavior.rs:124:35 [INFO] [stdout] | [INFO] [stdout] 124 | let addr = address.clone(); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/simulation/random_behavior.rs:127:33 [INFO] [stdout] | [INFO] [stdout] 127 | let addr = addr.clone(); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/main.rs:38:52 [INFO] [stdout] | [INFO] [stdout] 38 | let tcp_server = tcp_listener(Arc::clone(&queue), format!("127.0.0.1:5000")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"127.0.0.1:5000".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:44:51 [INFO] [stdout] | [INFO] [stdout] 44 | let _ws_server = ws_listener(Arc::clone(&queue), &address); [INFO] [stdout] | ^^^^^^^^ help: change this to: `address` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `flow_rs::exchange::order_processing::*` [INFO] [stdout] --> tests/integration_test.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use flow_rs::exchange::order_processing::*; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `setup_ask_order` is never used [INFO] [stdout] --> tests/common/mod.rs:28:8 [INFO] [stdout] | [INFO] [stdout] 28 | pub fn setup_ask_order() -> Order { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `rand_coef_vector` is never used [INFO] [stdout] --> tests/common/mod.rs:81:8 [INFO] [stdout] | [INFO] [stdout] 81 | pub fn rand_coef_vector() -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `n_bid_enters` is never used [INFO] [stdout] --> tests/common/mod.rs:91:8 [INFO] [stdout] | [INFO] [stdout] 91 | pub fn n_bid_enters(n: u32) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `n_ask_enters` is never used [INFO] [stdout] --> tests/common/mod.rs:99:8 [INFO] [stdout] | [INFO] [stdout] 99 | pub fn n_ask_enters(n: u32) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> tests/integration_test.rs:166:22 [INFO] [stdout] | [INFO] [stdout] 166 | bids[0].trader_id = format!("jason"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"jason".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> tests/integration_test.rs:196:27 [INFO] [stdout] | [INFO] [stdout] 196 | update_order.trader_id = format!("jason"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"jason".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> tests/integration_test.rs:217:36 [INFO] [stdout] | [INFO] [stdout] 217 | let index = bids_book.peek_id_pos(format!("jason")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"jason".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> tests/integration_test.rs:240:22 [INFO] [stdout] | [INFO] [stdout] 240 | bids[0].trader_id = format!("jason"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"jason".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> tests/integration_test.rs:276:27 [INFO] [stdout] | [INFO] [stdout] 276 | update_order.trader_id = format!("jason"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"jason".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> tests/integration_test.rs:297:36 [INFO] [stdout] | [INFO] [stdout] 297 | let index = bids_book.peek_id_pos(format!("jason")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"jason".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> tests/integration_test.rs:300:9 [INFO] [stdout] | [INFO] [stdout] 300 | if let Some(_) = index { [INFO] [stdout] | -------^^^^^^^-------- help: try: `if index.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> tests/integration_test.rs:26:2 [INFO] [stdout] | [INFO] [stdout] 26 | book.add_order(bid); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 26 | let _ = book.add_order(bid); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 12.08s [INFO] running `Command { std: "docker" "inspect" "f93e50b179d471869ef81f6c59fd129c056ed5e57f205a3c0370e3fe11c1d1e1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "f93e50b179d471869ef81f6c59fd129c056ed5e57f205a3c0370e3fe11c1d1e1", kill_on_drop: false }` [INFO] [stdout] f93e50b179d471869ef81f6c59fd129c056ed5e57f205a3c0370e3fe11c1d1e1