[INFO] cloning repository https://github.com/utka1365/kpo_lab [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/utka1365/kpo_lab" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Futka1365%2Fkpo_lab", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Futka1365%2Fkpo_lab'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 8a4bee0b9d0b6c19adb12c86463450746ab8de60 [INFO] linting utka1365/kpo_lab against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Futka1365%2Fkpo_lab" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/utka1365/kpo_lab [INFO] finished tweaking git repo https://github.com/utka1365/kpo_lab [INFO] tweaked toml for git repo https://github.com/utka1365/kpo_lab written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/utka1365/kpo_lab 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/utka1365/kpo_lab 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] Blocking waiting for file lock on package cache [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded getch-rs v0.2.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 9350c035dbb5e41487125718a5d210bde32a456c23c2e192ec05806ce6fc1907 [INFO] running `Command { std: "docker" "start" "-a" "9350c035dbb5e41487125718a5d210bde32a456c23c2e192ec05806ce6fc1907", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "9350c035dbb5e41487125718a5d210bde32a456c23c2e192ec05806ce6fc1907", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "9350c035dbb5e41487125718a5d210bde32a456c23c2e192ec05806ce6fc1907", kill_on_drop: false }` [INFO] [stdout] 9350c035dbb5e41487125718a5d210bde32a456c23c2e192ec05806ce6fc1907 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] cdbdcfb751ddf7d419417fde6437780458ba092cad957c29a69862a586a1e892 [INFO] running `Command { std: "docker" "start" "-a" "cdbdcfb751ddf7d419417fde6437780458ba092cad957c29a69862a586a1e892", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.177 [INFO] [stderr] Compiling proc-macro2 v1.0.101 [INFO] [stderr] Compiling quote v1.0.41 [INFO] [stderr] Compiling zerocopy v0.8.27 [INFO] [stderr] Compiling unicode-ident v1.0.20 [INFO] [stderr] Compiling serde_json v1.0.145 [INFO] [stderr] Compiling memoffset v0.7.1 [INFO] [stderr] Compiling syn v2.0.107 [INFO] [stderr] Checking getrandom v0.3.4 [INFO] [stderr] Checking nix v0.26.4 [INFO] [stderr] Checking ppv-lite86 v0.2.21 [INFO] [stderr] Checking rand_core v0.9.3 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Checking rand v0.9.2 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Checking getch-rs v0.2.0 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking KPO1 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/models/horse.rs:413:36 [INFO] [stdout] | [INFO] [stdout] 413 | else if jock.balance < 100 * 2< src/models/horse.rs:419:24 [INFO] [stdout] | [INFO] [stdout] 419 | cost = 100 * 2< src/models/horse.rs:413:36 [INFO] [stdout] | [INFO] [stdout] 413 | else if jock.balance < 100 * 2< src/models/horse.rs:419:24 [INFO] [stdout] | [INFO] [stdout] 419 | cost = 100 * 2< src/menu.rs:200:13 [INFO] [stdout] | [INFO] [stdout] 200 | let input: String = input().unwrap(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `name` is never read [INFO] [stdout] --> src/logic.rs:196:32 [INFO] [stdout] | [INFO] [stdout] 196 | let mut name: String = "".to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/models/horse.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / pub mod horse { [INFO] [stdout] 2 | | use crate::models::jockey::jockey::*; [INFO] [stdout] 3 | | use crate::menu::menu::input; [INFO] [stdout] 4 | | use rand::{seq::SliceRandom, seq::IndexedRandom, Rng}; [INFO] [stdout] ... | [INFO] [stdout] 436 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/models/horse.rs:102:13 [INFO] [stdout] | [INFO] [stdout] 102 | let color: Colors; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `color` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 102 ~ [INFO] [stdout] 103 | [INFO] [stdout] ... [INFO] [stdout] 129 | colors.shuffle(&mut rng); [INFO] [stdout] 130 ~ let color: Colors = match colors.choose(&mut rng).expect("Ошибка при генерации объекта Horse") { [INFO] [stdout] 131 ~ Colors::Red => Colors::Red, [INFO] [stdout] 132 ~ Colors::Bay => Colors::Bay, [INFO] [stdout] 133 ~ Colors::Grey => Colors::Grey, [INFO] [stdout] 134 ~ Colors::Black => Colors::Black [INFO] [stdout] 135 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/models/horse.rs:279:13 [INFO] [stdout] | [INFO] [stdout] 279 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 279 - print!("\n"); [INFO] [stdout] 279 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/models/horse.rs:341:13 [INFO] [stdout] | [INFO] [stdout] 341 | let cost: i32; [INFO] [stdout] | ^^^^^^^^^^^^^^ created here [INFO] [stdout] 342 | cost = 50; [INFO] [stdout] | ^^^^^^^^^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `cost` here [INFO] [stdout] | [INFO] [stdout] 341 ~ [INFO] [stdout] 342 ~ let cost: i32 = 50; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/models/horse.rs:355:13 [INFO] [stdout] | [INFO] [stdout] 355 | let cost: i32; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `cost` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 355 ~ [INFO] [stdout] 356 ~ let cost: i32 = match self.rarity { [INFO] [stdout] 357 ~ Rarity::Common => 200, [INFO] [stdout] 358 ~ Rarity::Rare => 500, [INFO] [stdout] 359 ~ Rarity::Unique => 1000 [INFO] [stdout] 360 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/menu.rs:200:13 [INFO] [stdout] | [INFO] [stdout] 200 | let input: String = input().unwrap(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/models/jockey.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / pub mod jockey { [INFO] [stdout] 2 | | use serde::{Serialize, Deserialize}; [INFO] [stdout] 3 | | use crate::menu::menu::{clear_cl, getch}; [INFO] [stdout] 4 | | use crate::models::horse::horse::*; [INFO] [stdout] ... | [INFO] [stdout] 57 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `name` is never read [INFO] [stdout] --> src/logic.rs:196:32 [INFO] [stdout] | [INFO] [stdout] 196 | let mut name: String = "".to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/models/race.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / pub mod race { [INFO] [stdout] 2 | | use std::time::{Duration, Instant}; [INFO] [stdout] 3 | | use rand::Rng; [INFO] [stdout] 4 | | use serde::{Serialize, Deserialize}; [INFO] [stdout] ... | [INFO] [stdout] 257 | | }*/ [INFO] [stdout] 258 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/models/horse.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / pub mod horse { [INFO] [stdout] 2 | | use crate::models::jockey::jockey::*; [INFO] [stdout] 3 | | use crate::menu::menu::input; [INFO] [stdout] 4 | | use rand::{seq::SliceRandom, seq::IndexedRandom, Rng}; [INFO] [stdout] ... | [INFO] [stdout] 436 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression assigns a bool literal [INFO] [stdout] --> src/models/race.rs:129:17 [INFO] [stdout] | [INFO] [stdout] 129 | / if chance_of_win < necessary_chance{ [INFO] [stdout] 130 | | res = false; [INFO] [stdout] 131 | | } [INFO] [stdout] 132 | | else { [INFO] [stdout] 133 | | res = true; [INFO] [stdout] 134 | | } [INFO] [stdout] | |_________________^ help: you can reduce it to: `res = chance_of_win >= necessary_chance;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/menu.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / pub mod menu { [INFO] [stdout] 2 | | use std::io::{Write, stdin, Error}; [INFO] [stdout] 3 | | use std::fs::{File, read_to_string}; [INFO] [stdout] 4 | | use std::collections::{HashSet}; [INFO] [stdout] ... | [INFO] [stdout] 226 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/menu.rs:62:16 [INFO] [stdout] | [INFO] [stdout] 62 | if !file.is_ok(){ [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `file.is_err()` [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: redundant pattern matching, consider using `is_ok()` [INFO] [stdout] --> src/menu.rs:66:13 [INFO] [stdout] | [INFO] [stdout] 66 | / match write!(file, "{}", serde_json::to_string(self).unwrap()){ [INFO] [stdout] 67 | | Ok(_) => true, [INFO] [stdout] 68 | | Err(_) => false, [INFO] [stdout] 69 | | } [INFO] [stdout] | |_____________^ help: try: `write!(file, "{}", serde_json::to_string(self).unwrap()).is_ok()` [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: this boolean expression can be simplified [INFO] [stdout] --> src/menu.rs:78:12 [INFO] [stdout] | [INFO] [stdout] 78 | if !reader.read_line(&mut str).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `reader.read_line(&mut str).is_err()` [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: unneeded late initialization [INFO] [stdout] --> src/menu.rs:77:9 [INFO] [stdout] | [INFO] [stdout] 77 | let res: Result; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `res` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 77 ~ [INFO] [stdout] 78 ~ let res: Result = if !reader.read_line(&mut str).is_ok() { [INFO] [stdout] 79 ~ Err("Ошибка!".to_string()) [INFO] [stdout] 80 | } else { [INFO] [stdout] 81 ~ Ok(str.trim().to_string()) [INFO] [stdout] 82 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/menu.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 88 | let ch = g.getch(); [INFO] [stdout] | ------------------- unnecessary `let` binding [INFO] [stdout] 89 | ch [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] 88 ~ [INFO] [stdout] 89 ~ g.getch() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/menu.rs:147:28 [INFO] [stdout] | [INFO] [stdout] 147 | if !set.is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `set.is_err()` [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_err` on `set` after checking its variant with `is_ok` [INFO] [stdout] --> src/menu.rs:148:42 [INFO] [stdout] | [INFO] [stdout] 147 | if !set.is_ok() { [INFO] [stdout] | ----------- the check is happening here [INFO] [stdout] 148 | panic!("{}", set.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/logic.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / pub mod logic{ [INFO] [stdout] 2 | | use std::fs::{read_to_string, File}; [INFO] [stdout] 3 | | use std::io::{Error, Write}; [INFO] [stdout] 4 | | use std::time::{Duration, Instant}; [INFO] [stdout] ... | [INFO] [stdout] 424 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/models/horse.rs:102:13 [INFO] [stdout] | [INFO] [stdout] 102 | let color: Colors; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `color` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 102 ~ [INFO] [stdout] 103 | [INFO] [stdout] ... [INFO] [stdout] 129 | colors.shuffle(&mut rng); [INFO] [stdout] 130 ~ let color: Colors = match colors.choose(&mut rng).expect("Ошибка при генерации объекта Horse") { [INFO] [stdout] 131 ~ Colors::Red => Colors::Red, [INFO] [stdout] 132 ~ Colors::Bay => Colors::Bay, [INFO] [stdout] 133 ~ Colors::Grey => Colors::Grey, [INFO] [stdout] 134 ~ Colors::Black => Colors::Black [INFO] [stdout] 135 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/logic.rs:144:16 [INFO] [stdout] | [INFO] [stdout] 144 | if !file.is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `file.is_err()` [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 `input` after checking its variant with `is_ok` [INFO] [stdout] --> src/logic.rs:200:24 [INFO] [stdout] | [INFO] [stdout] 199 | if input.is_ok() { [INFO] [stdout] | ---------------- help: try: `if let Ok() = input` [INFO] [stdout] 200 | name = input.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/models/horse.rs:279:13 [INFO] [stdout] | [INFO] [stdout] 279 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 279 - print!("\n"); [INFO] [stdout] 279 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/models/horse.rs:341:13 [INFO] [stdout] | [INFO] [stdout] 341 | let cost: i32; [INFO] [stdout] | ^^^^^^^^^^^^^^ created here [INFO] [stdout] 342 | cost = 50; [INFO] [stdout] | ^^^^^^^^^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `cost` here [INFO] [stdout] | [INFO] [stdout] 341 ~ [INFO] [stdout] 342 ~ let cost: i32 = 50; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/models/horse.rs:355:13 [INFO] [stdout] | [INFO] [stdout] 355 | let cost: i32; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `cost` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 355 ~ [INFO] [stdout] 356 ~ let cost: i32 = match self.rarity { [INFO] [stdout] 357 ~ Rarity::Common => 200, [INFO] [stdout] 358 ~ Rarity::Rare => 500, [INFO] [stdout] 359 ~ Rarity::Unique => 1000 [INFO] [stdout] 360 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `horse` after checking its variant with `is_none` [INFO] [stdout] --> src/logic.rs:402:13 [INFO] [stdout] | [INFO] [stdout] 398 | if horse.is_none() { [INFO] [stdout] | ------------------ help: try: `if let Some() = &horse` [INFO] [stdout] ... [INFO] [stdout] 402 | horse.as_ref().unwrap().print(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `horse` after checking its variant with `is_none` [INFO] [stdout] --> src/logic.rs:406:24 [INFO] [stdout] | [INFO] [stdout] 398 | if horse.is_none() { [INFO] [stdout] | ------------------ help: try: `if let Some() = &horse` [INFO] [stdout] ... [INFO] [stdout] 406 | if horse.as_ref().unwrap().cost as i32 > jock.balance { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `horse` after checking its variant with `is_none` [INFO] [stdout] --> src/logic.rs:411:25 [INFO] [stdout] | [INFO] [stdout] 398 | if horse.is_none() { [INFO] [stdout] | ------------------ help: try: `if let Some() = &mut horse` [INFO] [stdout] ... [INFO] [stdout] 411 | / horse [INFO] [stdout] 412 | | .as_mut() [INFO] [stdout] 413 | | .unwrap() [INFO] [stdout] | |_____________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `horse` after checking its variant with `is_none` [INFO] [stdout] --> src/logic.rs:415:41 [INFO] [stdout] | [INFO] [stdout] 398 | if horse.is_none() { [INFO] [stdout] | ------------------ help: try: `if let Some() = &horse` [INFO] [stdout] ... [INFO] [stdout] 415 | jock.balance -= horse.as_ref().unwrap().cost as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `horse` after checking its variant with `is_none` [INFO] [stdout] --> src/logic.rs:416:40 [INFO] [stdout] | [INFO] [stdout] 398 | if horse.is_none() { [INFO] [stdout] | ------------------ help: try: `if let Some() = horse` [INFO] [stdout] ... [INFO] [stdout] 416 | jock.add_horse(horse.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/models/jockey.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / pub mod jockey { [INFO] [stdout] 2 | | use serde::{Serialize, Deserialize}; [INFO] [stdout] 3 | | use crate::menu::menu::{clear_cl, getch}; [INFO] [stdout] 4 | | use crate::models::horse::horse::*; [INFO] [stdout] ... | [INFO] [stdout] 57 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/models/jockey.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | getch(); [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] 33 | let _ = getch(); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/models/race.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / pub mod race { [INFO] [stdout] 2 | | use std::time::{Duration, Instant}; [INFO] [stdout] 3 | | use rand::Rng; [INFO] [stdout] 4 | | use serde::{Serialize, Deserialize}; [INFO] [stdout] ... | [INFO] [stdout] 257 | | }*/ [INFO] [stdout] 258 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/models/jockey.rs:40:13 [INFO] [stdout] | [INFO] [stdout] 40 | getch(); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 40 | let _ = getch(); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression assigns a bool literal [INFO] [stdout] --> src/models/race.rs:129:17 [INFO] [stdout] | [INFO] [stdout] 129 | / if chance_of_win < necessary_chance{ [INFO] [stdout] 130 | | res = false; [INFO] [stdout] 131 | | } [INFO] [stdout] 132 | | else { [INFO] [stdout] 133 | | res = true; [INFO] [stdout] 134 | | } [INFO] [stdout] | |_________________^ help: you can reduce it to: `res = chance_of_win >= necessary_chance;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/menu.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / pub mod menu { [INFO] [stdout] 2 | | use std::io::{Write, stdin, Error}; [INFO] [stdout] 3 | | use std::fs::{File, read_to_string}; [INFO] [stdout] 4 | | use std::collections::{HashSet}; [INFO] [stdout] ... | [INFO] [stdout] 226 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/menu.rs:62:16 [INFO] [stdout] | [INFO] [stdout] 62 | if !file.is_ok(){ [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `file.is_err()` [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: redundant pattern matching, consider using `is_ok()` [INFO] [stdout] --> src/menu.rs:66:13 [INFO] [stdout] | [INFO] [stdout] 66 | / match write!(file, "{}", serde_json::to_string(self).unwrap()){ [INFO] [stdout] 67 | | Ok(_) => true, [INFO] [stdout] 68 | | Err(_) => false, [INFO] [stdout] 69 | | } [INFO] [stdout] | |_____________^ help: try: `write!(file, "{}", serde_json::to_string(self).unwrap()).is_ok()` [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: this boolean expression can be simplified [INFO] [stdout] --> src/menu.rs:78:12 [INFO] [stdout] | [INFO] [stdout] 78 | if !reader.read_line(&mut str).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `reader.read_line(&mut str).is_err()` [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: unneeded late initialization [INFO] [stdout] --> src/menu.rs:77:9 [INFO] [stdout] | [INFO] [stdout] 77 | let res: Result; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `res` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 77 ~ [INFO] [stdout] 78 ~ let res: Result = if !reader.read_line(&mut str).is_ok() { [INFO] [stdout] 79 ~ Err("Ошибка!".to_string()) [INFO] [stdout] 80 | } else { [INFO] [stdout] 81 ~ Ok(str.trim().to_string()) [INFO] [stdout] 82 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/menu.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 88 | let ch = g.getch(); [INFO] [stdout] | ------------------- unnecessary `let` binding [INFO] [stdout] 89 | ch [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] 88 ~ [INFO] [stdout] 89 ~ g.getch() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/menu.rs:147:28 [INFO] [stdout] | [INFO] [stdout] 147 | if !set.is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `set.is_err()` [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_err` on `set` after checking its variant with `is_ok` [INFO] [stdout] --> src/menu.rs:148:42 [INFO] [stdout] | [INFO] [stdout] 147 | if !set.is_ok() { [INFO] [stdout] | ----------- the check is happening here [INFO] [stdout] 148 | panic!("{}", set.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/logic.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / pub mod logic{ [INFO] [stdout] 2 | | use std::fs::{read_to_string, File}; [INFO] [stdout] 3 | | use std::io::{Error, Write}; [INFO] [stdout] 4 | | use std::time::{Duration, Instant}; [INFO] [stdout] ... | [INFO] [stdout] 424 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/logic.rs:144:16 [INFO] [stdout] | [INFO] [stdout] 144 | if !file.is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `file.is_err()` [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 `input` after checking its variant with `is_ok` [INFO] [stdout] --> src/logic.rs:200:24 [INFO] [stdout] | [INFO] [stdout] 199 | if input.is_ok() { [INFO] [stdout] | ---------------- help: try: `if let Ok() = input` [INFO] [stdout] 200 | name = input.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `horse` after checking its variant with `is_none` [INFO] [stdout] --> src/logic.rs:402:13 [INFO] [stdout] | [INFO] [stdout] 398 | if horse.is_none() { [INFO] [stdout] | ------------------ help: try: `if let Some() = &horse` [INFO] [stdout] ... [INFO] [stdout] 402 | horse.as_ref().unwrap().print(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `horse` after checking its variant with `is_none` [INFO] [stdout] --> src/logic.rs:406:24 [INFO] [stdout] | [INFO] [stdout] 398 | if horse.is_none() { [INFO] [stdout] | ------------------ help: try: `if let Some() = &horse` [INFO] [stdout] ... [INFO] [stdout] 406 | if horse.as_ref().unwrap().cost as i32 > jock.balance { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `horse` after checking its variant with `is_none` [INFO] [stdout] --> src/logic.rs:411:25 [INFO] [stdout] | [INFO] [stdout] 398 | if horse.is_none() { [INFO] [stdout] | ------------------ help: try: `if let Some() = &mut horse` [INFO] [stdout] ... [INFO] [stdout] 411 | / horse [INFO] [stdout] 412 | | .as_mut() [INFO] [stdout] 413 | | .unwrap() [INFO] [stdout] | |_____________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `horse` after checking its variant with `is_none` [INFO] [stdout] --> src/logic.rs:415:41 [INFO] [stdout] | [INFO] [stdout] 398 | if horse.is_none() { [INFO] [stdout] | ------------------ help: try: `if let Some() = &horse` [INFO] [stdout] ... [INFO] [stdout] 415 | jock.balance -= horse.as_ref().unwrap().cost as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `horse` after checking its variant with `is_none` [INFO] [stdout] --> src/logic.rs:416:40 [INFO] [stdout] | [INFO] [stdout] 398 | if horse.is_none() { [INFO] [stdout] | ------------------ help: try: `if let Some() = horse` [INFO] [stdout] ... [INFO] [stdout] 416 | jock.add_horse(horse.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/models/jockey.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | getch(); [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] 33 | let _ = getch(); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/models/jockey.rs:40:13 [INFO] [stdout] | [INFO] [stdout] 40 | getch(); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 40 | let _ = getch(); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 12.90s [INFO] running `Command { std: "docker" "inspect" "cdbdcfb751ddf7d419417fde6437780458ba092cad957c29a69862a586a1e892", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "cdbdcfb751ddf7d419417fde6437780458ba092cad957c29a69862a586a1e892", kill_on_drop: false }` [INFO] [stdout] cdbdcfb751ddf7d419417fde6437780458ba092cad957c29a69862a586a1e892