[INFO] cloning repository https://github.com/Nixa001/Smart_Traffic_Sim [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Nixa001/Smart_Traffic_Sim" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FNixa001%2FSmart_Traffic_Sim", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FNixa001%2FSmart_Traffic_Sim'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 2b5a084a58a23c294deff4443ef84eb9bbc05d02 [INFO] linting Nixa001/Smart_Traffic_Sim against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FNixa001%2FSmart_Traffic_Sim" "/workspace/builds/worker-3-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/Nixa001/Smart_Traffic_Sim [INFO] finished tweaking git repo https://github.com/Nixa001/Smart_Traffic_Sim [INFO] tweaked toml for git repo https://github.com/Nixa001/Smart_Traffic_Sim written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Nixa001/Smart_Traffic_Sim 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/Nixa001/Smart_Traffic_Sim 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] Downloading crates ... [INFO] [stderr] Downloaded miniquad v0.4.2 [INFO] [stderr] Downloaded macroquad v0.4.8 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 27fb45366e1e3219bd115ece0652102d27b85f9b69a1d6c3164ce3b41b85f747 [INFO] running `Command { std: "docker" "start" "-a" "27fb45366e1e3219bd115ece0652102d27b85f9b69a1d6c3164ce3b41b85f747", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "27fb45366e1e3219bd115ece0652102d27b85f9b69a1d6c3164ce3b41b85f747", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "27fb45366e1e3219bd115ece0652102d27b85f9b69a1d6c3164ce3b41b85f747", kill_on_drop: false }` [INFO] [stdout] 27fb45366e1e3219bd115ece0652102d27b85f9b69a1d6c3164ce3b41b85f747 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] e596937b94156ee560096b34e285b5263a73ed0b65222e2f695054b5b16d7f53 [INFO] running `Command { std: "docker" "start" "-a" "e596937b94156ee560096b34e285b5263a73ed0b65222e2f695054b5b16d7f53", kill_on_drop: false }` [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Checking miniz_oxide v0.7.4 [INFO] [stderr] Compiling miniquad v0.4.2 [INFO] [stderr] Checking ahash v0.8.11 [INFO] [stderr] Checking bytemuck v1.16.1 [INFO] [stderr] Checking glam v0.27.0 [INFO] [stderr] Compiling macroquad_macro v0.1.8 [INFO] [stderr] Checking hashbrown v0.13.2 [INFO] [stderr] Checking flate2 v1.0.30 [INFO] [stderr] Checking fontdue v0.7.3 [INFO] [stderr] Checking png v0.17.13 [INFO] [stderr] Checking image v0.24.9 [INFO] [stderr] Checking macroquad v0.4.8 [INFO] [stderr] Checking smart-road v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/intersection.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 92 | / return match cars { [INFO] [stdout] 93 | | Some(cars) => { [INFO] [stdout] 94 | | let last_car_id = cars.as_slice().last().unwrap(); [INFO] [stdout] 95 | | let last_car_position = self.cars.get(last_car_id).unwrap().coordonne; [INFO] [stdout] ... | [INFO] [stdout] 118 | | None => true, [INFO] [stdout] 119 | | }; [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] 92 ~ match cars { [INFO] [stdout] 93 + Some(cars) => { [INFO] [stdout] 94 + let last_car_id = cars.as_slice().last().unwrap(); [INFO] [stdout] 95 + let last_car_position = self.cars.get(last_car_id).unwrap().coordonne; [INFO] [stdout] 96 + if (route == Route::NS || route == Route::NW || route == Route::NE) [INFO] [stdout] 97 + && last_car_position.y <= start_coordinates.y + SECURITY_DISTANCE [INFO] [stdout] 98 + { [INFO] [stdout] 99 + return false; [INFO] [stdout] 100 + } [INFO] [stdout] 101 + if (route == Route::SN || route == Route::SE || route == Route::SW) [INFO] [stdout] 102 + && last_car_position.y + SECURITY_DISTANCE >= start_coordinates.y [INFO] [stdout] 103 + { [INFO] [stdout] 104 + return false; [INFO] [stdout] 105 + } [INFO] [stdout] 106 + if (route == Route::WE || route == Route::WS || route == Route::WN) [INFO] [stdout] 107 + && last_car_position.x <= start_coordinates.x + SECURITY_DISTANCE [INFO] [stdout] 108 + { [INFO] [stdout] 109 + return false; [INFO] [stdout] 110 + } [INFO] [stdout] 111 + if (route == Route::EW || route == Route::EN || route == Route::ES) [INFO] [stdout] 112 + && last_car_position.x + SECURITY_DISTANCE >= start_coordinates.x [INFO] [stdout] 113 + { [INFO] [stdout] 114 + return false; [INFO] [stdout] 115 + } [INFO] [stdout] 116 + true [INFO] [stdout] 117 + } [INFO] [stdout] 118 + None => true, [INFO] [stdout] 119 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/intersection.rs:157:20 [INFO] [stdout] | [INFO] [stdout] 157 | if !cars_on_cross_road.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cars_on_cross_road.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/intersection.rs:196:24 [INFO] [stdout] | [INFO] [stdout] 196 | if !cars.get(&cars_ids[ind - 1]).is_none() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cars.get(&cars_ids[ind - 1]).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `cars_on_cross_road` after checking its variant with `is_none` [INFO] [stdout] --> src/intersection.rs:158:40 [INFO] [stdout] | [INFO] [stdout] 157 | if !cars_on_cross_road.is_none() { [INFO] [stdout] | ---------------------------- the check is happening here [INFO] [stdout] 158 | let mut all_cars = cars_on_cross_road.unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/intersection.rs:139:34 [INFO] [stdout] | [INFO] [stdout] 139 | let mut can_go = route.not_allowed_to_go().len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `route.not_allowed_to_go().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(r).is_none()` [INFO] [stdout] --> src/intersection.rs:154:62 [INFO] [stdout] | [INFO] [stdout] 154 | can_go = can_go && (self.occupied_tracks.get(r).is_none() || not_speed_up); [INFO] [stdout] | ---------------------^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!self.occupied_tracks.contains_key(r)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&cars_ids[ind - 1]).is_none()` [INFO] [stdout] --> src/intersection.rs:196:30 [INFO] [stdout] | [INFO] [stdout] 196 | if !cars.get(&cars_ids[ind - 1]).is_none() [INFO] [stdout] | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!cars.contains_key(&cars_ids[ind - 1])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/intersection.rs:294:5 [INFO] [stdout] | [INFO] [stdout] 294 | return routes[n]; [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] 294 - return routes[n]; [INFO] [stdout] 294 + routes[n] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/intersection.rs:298:5 [INFO] [stdout] | [INFO] [stdout] 298 | / return ((((a.x >= b.x && a.x <= d.x) || (c.x >= b.x && c.x <= d.x)) [INFO] [stdout] 299 | | && ((a.y >= b.y && a.y <= d.y) || (c.y >= b.y && c.y <= d.y))) [INFO] [stdout] 300 | | || (((b.x >= a.x && b.x <= c.x) || (d.x >= a.x && d.x <= c.x)) [INFO] [stdout] 301 | | && ((b.y >= a.y && b.y <= c.y) || (d.y >= a.y && d.y <= c.y)))) [INFO] [stdout] ... | [INFO] [stdout] 304 | | || (((b.x >= a.x && b.x <= c.x) || (d.x >= a.x && d.x <= c.x)) [INFO] [stdout] 305 | | && ((a.y >= b.y && a.y <= d.y) || (c.y >= b.y && c.y <= d.y)))); [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] 298 ~ ((((a.x >= b.x && a.x <= d.x) || (c.x >= b.x && c.x <= d.x)) [INFO] [stdout] 299 + && ((a.y >= b.y && a.y <= d.y) || (c.y >= b.y && c.y <= d.y))) [INFO] [stdout] 300 + || (((b.x >= a.x && b.x <= c.x) || (d.x >= a.x && d.x <= c.x)) [INFO] [stdout] 301 + && ((b.y >= a.y && b.y <= c.y) || (d.y >= a.y && d.y <= c.y)))) [INFO] [stdout] 302 + || ((((a.x >= b.x && a.x <= d.x) || (c.x >= b.x && c.x <= d.x)) [INFO] [stdout] 303 + && ((b.y >= a.y && b.y <= c.y) || (d.y >= a.y && d.y <= c.y))) [INFO] [stdout] 304 + || (((b.x >= a.x && b.x <= c.x) || (d.x >= a.x && d.x <= c.x)) [INFO] [stdout] 305 ~ && ((a.y >= b.y && a.y <= d.y) || (c.y >= b.y && c.y <= d.y)))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/vehicule.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | / pub fn new( [INFO] [stdout] 28 | | coordonne: Vec2, [INFO] [stdout] 29 | | rectangle: (f32, f32), [INFO] [stdout] 30 | | color: Texture2D, [INFO] [stdout] ... | [INFO] [stdout] 35 | | turned: bool, [INFO] [stdout] 36 | | ) -> Vehicule { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 92 | / return match self.direction { [INFO] [stdout] 93 | | Direction::Right => self.coordonne.x > APRES_INTERSECTION.x - CAR_WIDTH, [INFO] [stdout] 94 | | Direction::Left => self.coordonne.x < APRES_INTERSECTION.y, [INFO] [stdout] 95 | | Direction::Down => self.coordonne.y > APRES_INTERSECTION.x - CAR_WIDTH, [INFO] [stdout] 96 | | Direction::Up => self.coordonne.y < APRES_INTERSECTION.y, [INFO] [stdout] 97 | | }; [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] 92 ~ match self.direction { [INFO] [stdout] 93 + Direction::Right => self.coordonne.x > APRES_INTERSECTION.x - CAR_WIDTH, [INFO] [stdout] 94 + Direction::Left => self.coordonne.x < APRES_INTERSECTION.y, [INFO] [stdout] 95 + Direction::Down => self.coordonne.y > APRES_INTERSECTION.x - CAR_WIDTH, [INFO] [stdout] 96 + Direction::Up => self.coordonne.y < APRES_INTERSECTION.y, [INFO] [stdout] 97 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | return !self.avant_intersect() && !self.after_intersect(); [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] 110 - return !self.avant_intersect() && !self.after_intersect(); [INFO] [stdout] 110 + !self.avant_intersect() && !self.after_intersect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | return self.vitesse.0.abs() == VITESSE_RAPID || self.vitesse.1.abs() == VITESSE_RAPID; [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] 123 - return self.vitesse.0.abs() == VITESSE_RAPID || self.vitesse.1.abs() == VITESSE_RAPID; [INFO] [stdout] 123 + self.vitesse.0.abs() == VITESSE_RAPID || self.vitesse.1.abs() == VITESSE_RAPID [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:127:9 [INFO] [stdout] | [INFO] [stdout] 127 | return self.vitesse.0.abs() == VITESSE_MIN || self.vitesse.1.abs() == VITESSE_MIN; [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] 127 - return self.vitesse.0.abs() == VITESSE_MIN || self.vitesse.1.abs() == VITESSE_MIN; [INFO] [stdout] 127 + self.vitesse.0.abs() == VITESSE_MIN || self.vitesse.1.abs() == VITESSE_MIN [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:140:9 [INFO] [stdout] | [INFO] [stdout] 140 | / return match self.route { [INFO] [stdout] 141 | | Route::NW => self.coordonne.y >= 340.0, [INFO] [stdout] 142 | | Route::SE => self.coordonne.y <= 625.0, [INFO] [stdout] 143 | | Route::WS => self.coordonne.x > 375.0, [INFO] [stdout] ... | [INFO] [stdout] 150 | | _ => false, [INFO] [stdout] 151 | | }; [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] 140 ~ match self.route { [INFO] [stdout] 141 + Route::NW => self.coordonne.y >= 340.0, [INFO] [stdout] 142 + Route::SE => self.coordonne.y <= 625.0, [INFO] [stdout] 143 + Route::WS => self.coordonne.x > 375.0, [INFO] [stdout] 144 + Route::EN => self.coordonne.x < 625.0, [INFO] [stdout] 145 + [INFO] [stdout] 146 + Route::NE => self.coordonne.y > 515.0, [INFO] [stdout] 147 + Route::SW => self.coordonne.y < 485.0, [INFO] [stdout] 148 + Route::WN => self.coordonne.x > 515.0, [INFO] [stdout] 149 + Route::ES => self.coordonne.x < 485.0, [INFO] [stdout] 150 + _ => false, [INFO] [stdout] 151 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:218:18 [INFO] [stdout] | [INFO] [stdout] 218 | _ => return, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: replace `return` with a unit value [INFO] [stdout] | [INFO] [stdout] 218 - _ => return, [INFO] [stdout] 218 + _ => (), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:223:9 [INFO] [stdout] | [INFO] [stdout] 223 | / return match self.direction { [INFO] [stdout] 224 | | Direction::Right => self.coordonne.x > 1000.0, [INFO] [stdout] 225 | | Direction::Left => self.coordonne.x < 0.0 - CAR_WIDTH, [INFO] [stdout] 226 | | Direction::Down => self.coordonne.y > 1000.0, [INFO] [stdout] 227 | | Direction::Up => self.coordonne.y < 0.0 - CAR_WIDTH, [INFO] [stdout] 228 | | }; [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] 223 ~ match self.direction { [INFO] [stdout] 224 + Direction::Right => self.coordonne.x > 1000.0, [INFO] [stdout] 225 + Direction::Left => self.coordonne.x < 0.0 - CAR_WIDTH, [INFO] [stdout] 226 + Direction::Down => self.coordonne.y > 1000.0, [INFO] [stdout] 227 + Direction::Up => self.coordonne.y < 0.0 - CAR_WIDTH, [INFO] [stdout] 228 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Statistics` [INFO] [stdout] --> src/main.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | / pub fn new() -> Self { [INFO] [stdout] 62 | | Self { [INFO] [stdout] 63 | | passed_intersection: 0, [INFO] [stdout] 64 | | max_velocity: 0.0, [INFO] [stdout] ... | [INFO] [stdout] 70 | | } [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] 60 + impl Default for Statistics { [INFO] [stdout] 61 + fn default() -> Self { [INFO] [stdout] 62 + Self::new() [INFO] [stdout] 63 + } [INFO] [stdout] 64 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/intersection.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 92 | / return match cars { [INFO] [stdout] 93 | | Some(cars) => { [INFO] [stdout] 94 | | let last_car_id = cars.as_slice().last().unwrap(); [INFO] [stdout] 95 | | let last_car_position = self.cars.get(last_car_id).unwrap().coordonne; [INFO] [stdout] ... | [INFO] [stdout] 118 | | None => true, [INFO] [stdout] 119 | | }; [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] 92 ~ match cars { [INFO] [stdout] 93 + Some(cars) => { [INFO] [stdout] 94 + let last_car_id = cars.as_slice().last().unwrap(); [INFO] [stdout] 95 + let last_car_position = self.cars.get(last_car_id).unwrap().coordonne; [INFO] [stdout] 96 + if (route == Route::NS || route == Route::NW || route == Route::NE) [INFO] [stdout] 97 + && last_car_position.y <= start_coordinates.y + SECURITY_DISTANCE [INFO] [stdout] 98 + { [INFO] [stdout] 99 + return false; [INFO] [stdout] 100 + } [INFO] [stdout] 101 + if (route == Route::SN || route == Route::SE || route == Route::SW) [INFO] [stdout] 102 + && last_car_position.y + SECURITY_DISTANCE >= start_coordinates.y [INFO] [stdout] 103 + { [INFO] [stdout] 104 + return false; [INFO] [stdout] 105 + } [INFO] [stdout] 106 + if (route == Route::WE || route == Route::WS || route == Route::WN) [INFO] [stdout] 107 + && last_car_position.x <= start_coordinates.x + SECURITY_DISTANCE [INFO] [stdout] 108 + { [INFO] [stdout] 109 + return false; [INFO] [stdout] 110 + } [INFO] [stdout] 111 + if (route == Route::EW || route == Route::EN || route == Route::ES) [INFO] [stdout] 112 + && last_car_position.x + SECURITY_DISTANCE >= start_coordinates.x [INFO] [stdout] 113 + { [INFO] [stdout] 114 + return false; [INFO] [stdout] 115 + } [INFO] [stdout] 116 + true [INFO] [stdout] 117 + } [INFO] [stdout] 118 + None => true, [INFO] [stdout] 119 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/intersection.rs:157:20 [INFO] [stdout] | [INFO] [stdout] 157 | if !cars_on_cross_road.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cars_on_cross_road.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/intersection.rs:196:24 [INFO] [stdout] | [INFO] [stdout] 196 | if !cars.get(&cars_ids[ind - 1]).is_none() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cars.get(&cars_ids[ind - 1]).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `cars_on_cross_road` after checking its variant with `is_none` [INFO] [stdout] --> src/intersection.rs:158:40 [INFO] [stdout] | [INFO] [stdout] 157 | if !cars_on_cross_road.is_none() { [INFO] [stdout] | ---------------------------- the check is happening here [INFO] [stdout] 158 | let mut all_cars = cars_on_cross_road.unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/intersection.rs:139:34 [INFO] [stdout] | [INFO] [stdout] 139 | let mut can_go = route.not_allowed_to_go().len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `route.not_allowed_to_go().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(r).is_none()` [INFO] [stdout] --> src/intersection.rs:154:62 [INFO] [stdout] | [INFO] [stdout] 154 | can_go = can_go && (self.occupied_tracks.get(r).is_none() || not_speed_up); [INFO] [stdout] | ---------------------^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!self.occupied_tracks.contains_key(r)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&cars_ids[ind - 1]).is_none()` [INFO] [stdout] --> src/intersection.rs:196:30 [INFO] [stdout] | [INFO] [stdout] 196 | if !cars.get(&cars_ids[ind - 1]).is_none() [INFO] [stdout] | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!cars.contains_key(&cars_ids[ind - 1])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/intersection.rs:294:5 [INFO] [stdout] | [INFO] [stdout] 294 | return routes[n]; [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] 294 - return routes[n]; [INFO] [stdout] 294 + routes[n] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/intersection.rs:298:5 [INFO] [stdout] | [INFO] [stdout] 298 | / return ((((a.x >= b.x && a.x <= d.x) || (c.x >= b.x && c.x <= d.x)) [INFO] [stdout] 299 | | && ((a.y >= b.y && a.y <= d.y) || (c.y >= b.y && c.y <= d.y))) [INFO] [stdout] 300 | | || (((b.x >= a.x && b.x <= c.x) || (d.x >= a.x && d.x <= c.x)) [INFO] [stdout] 301 | | && ((b.y >= a.y && b.y <= c.y) || (d.y >= a.y && d.y <= c.y)))) [INFO] [stdout] ... | [INFO] [stdout] 304 | | || (((b.x >= a.x && b.x <= c.x) || (d.x >= a.x && d.x <= c.x)) [INFO] [stdout] 305 | | && ((a.y >= b.y && a.y <= d.y) || (c.y >= b.y && c.y <= d.y)))); [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] 298 ~ ((((a.x >= b.x && a.x <= d.x) || (c.x >= b.x && c.x <= d.x)) [INFO] [stdout] 299 + && ((a.y >= b.y && a.y <= d.y) || (c.y >= b.y && c.y <= d.y))) [INFO] [stdout] 300 + || (((b.x >= a.x && b.x <= c.x) || (d.x >= a.x && d.x <= c.x)) [INFO] [stdout] 301 + && ((b.y >= a.y && b.y <= c.y) || (d.y >= a.y && d.y <= c.y)))) [INFO] [stdout] 302 + || ((((a.x >= b.x && a.x <= d.x) || (c.x >= b.x && c.x <= d.x)) [INFO] [stdout] 303 + && ((b.y >= a.y && b.y <= c.y) || (d.y >= a.y && d.y <= c.y))) [INFO] [stdout] 304 + || (((b.x >= a.x && b.x <= c.x) || (d.x >= a.x && d.x <= c.x)) [INFO] [stdout] 305 ~ && ((a.y >= b.y && a.y <= d.y) || (c.y >= b.y && c.y <= d.y)))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/vehicule.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | / pub fn new( [INFO] [stdout] 28 | | coordonne: Vec2, [INFO] [stdout] 29 | | rectangle: (f32, f32), [INFO] [stdout] 30 | | color: Texture2D, [INFO] [stdout] ... | [INFO] [stdout] 35 | | turned: bool, [INFO] [stdout] 36 | | ) -> Vehicule { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 92 | / return match self.direction { [INFO] [stdout] 93 | | Direction::Right => self.coordonne.x > APRES_INTERSECTION.x - CAR_WIDTH, [INFO] [stdout] 94 | | Direction::Left => self.coordonne.x < APRES_INTERSECTION.y, [INFO] [stdout] 95 | | Direction::Down => self.coordonne.y > APRES_INTERSECTION.x - CAR_WIDTH, [INFO] [stdout] 96 | | Direction::Up => self.coordonne.y < APRES_INTERSECTION.y, [INFO] [stdout] 97 | | }; [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] 92 ~ match self.direction { [INFO] [stdout] 93 + Direction::Right => self.coordonne.x > APRES_INTERSECTION.x - CAR_WIDTH, [INFO] [stdout] 94 + Direction::Left => self.coordonne.x < APRES_INTERSECTION.y, [INFO] [stdout] 95 + Direction::Down => self.coordonne.y > APRES_INTERSECTION.x - CAR_WIDTH, [INFO] [stdout] 96 + Direction::Up => self.coordonne.y < APRES_INTERSECTION.y, [INFO] [stdout] 97 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | return !self.avant_intersect() && !self.after_intersect(); [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] 110 - return !self.avant_intersect() && !self.after_intersect(); [INFO] [stdout] 110 + !self.avant_intersect() && !self.after_intersect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | return self.vitesse.0.abs() == VITESSE_RAPID || self.vitesse.1.abs() == VITESSE_RAPID; [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] 123 - return self.vitesse.0.abs() == VITESSE_RAPID || self.vitesse.1.abs() == VITESSE_RAPID; [INFO] [stdout] 123 + self.vitesse.0.abs() == VITESSE_RAPID || self.vitesse.1.abs() == VITESSE_RAPID [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:127:9 [INFO] [stdout] | [INFO] [stdout] 127 | return self.vitesse.0.abs() == VITESSE_MIN || self.vitesse.1.abs() == VITESSE_MIN; [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] 127 - return self.vitesse.0.abs() == VITESSE_MIN || self.vitesse.1.abs() == VITESSE_MIN; [INFO] [stdout] 127 + self.vitesse.0.abs() == VITESSE_MIN || self.vitesse.1.abs() == VITESSE_MIN [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:140:9 [INFO] [stdout] | [INFO] [stdout] 140 | / return match self.route { [INFO] [stdout] 141 | | Route::NW => self.coordonne.y >= 340.0, [INFO] [stdout] 142 | | Route::SE => self.coordonne.y <= 625.0, [INFO] [stdout] 143 | | Route::WS => self.coordonne.x > 375.0, [INFO] [stdout] ... | [INFO] [stdout] 150 | | _ => false, [INFO] [stdout] 151 | | }; [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] 140 ~ match self.route { [INFO] [stdout] 141 + Route::NW => self.coordonne.y >= 340.0, [INFO] [stdout] 142 + Route::SE => self.coordonne.y <= 625.0, [INFO] [stdout] 143 + Route::WS => self.coordonne.x > 375.0, [INFO] [stdout] 144 + Route::EN => self.coordonne.x < 625.0, [INFO] [stdout] 145 + [INFO] [stdout] 146 + Route::NE => self.coordonne.y > 515.0, [INFO] [stdout] 147 + Route::SW => self.coordonne.y < 485.0, [INFO] [stdout] 148 + Route::WN => self.coordonne.x > 515.0, [INFO] [stdout] 149 + Route::ES => self.coordonne.x < 485.0, [INFO] [stdout] 150 + _ => false, [INFO] [stdout] 151 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:218:18 [INFO] [stdout] | [INFO] [stdout] 218 | _ => return, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: replace `return` with a unit value [INFO] [stdout] | [INFO] [stdout] 218 - _ => return, [INFO] [stdout] 218 + _ => (), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/vehicule.rs:223:9 [INFO] [stdout] | [INFO] [stdout] 223 | / return match self.direction { [INFO] [stdout] 224 | | Direction::Right => self.coordonne.x > 1000.0, [INFO] [stdout] 225 | | Direction::Left => self.coordonne.x < 0.0 - CAR_WIDTH, [INFO] [stdout] 226 | | Direction::Down => self.coordonne.y > 1000.0, [INFO] [stdout] 227 | | Direction::Up => self.coordonne.y < 0.0 - CAR_WIDTH, [INFO] [stdout] 228 | | }; [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] 223 ~ match self.direction { [INFO] [stdout] 224 + Direction::Right => self.coordonne.x > 1000.0, [INFO] [stdout] 225 + Direction::Left => self.coordonne.x < 0.0 - CAR_WIDTH, [INFO] [stdout] 226 + Direction::Down => self.coordonne.y > 1000.0, [INFO] [stdout] 227 + Direction::Up => self.coordonne.y < 0.0 - CAR_WIDTH, [INFO] [stdout] 228 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Statistics` [INFO] [stdout] --> src/main.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | / pub fn new() -> Self { [INFO] [stdout] 62 | | Self { [INFO] [stdout] 63 | | passed_intersection: 0, [INFO] [stdout] 64 | | max_velocity: 0.0, [INFO] [stdout] ... | [INFO] [stdout] 70 | | } [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] 60 + impl Default for Statistics { [INFO] [stdout] 61 + fn default() -> Self { [INFO] [stdout] 62 + Self::new() [INFO] [stdout] 63 + } [INFO] [stdout] 64 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.97s [INFO] running `Command { std: "docker" "inspect" "e596937b94156ee560096b34e285b5263a73ed0b65222e2f695054b5b16d7f53", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e596937b94156ee560096b34e285b5263a73ed0b65222e2f695054b5b16d7f53", kill_on_drop: false }` [INFO] [stdout] e596937b94156ee560096b34e285b5263a73ed0b65222e2f695054b5b16d7f53