[INFO] cloning repository https://github.com/ustankie/workflow [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/ustankie/workflow" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fustankie%2Fworkflow", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fustankie%2Fworkflow'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 9a8fa114a010b992d644db107998c7dc554f7043 [INFO] linting ustankie/workflow against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fustankie%2Fworkflow" "/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/ustankie/workflow [INFO] finished tweaking git repo https://github.com/ustankie/workflow [INFO] tweaked toml for git repo https://github.com/ustankie/workflow written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/ustankie/workflow 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/ustankie/workflow already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded pq-sys v0.4.8 [INFO] [stderr] Downloaded terminal-fonts v0.1.0 [INFO] [stderr] Downloaded crossterm_winapi v0.8.0 [INFO] [stderr] Downloaded redox_termios v0.1.3 [INFO] [stderr] Downloaded diesel_derives v2.1.4 [INFO] [stderr] Downloaded tui v0.16.0 [INFO] [stderr] Downloaded comfy-table v7.1.1 [INFO] [stderr] Downloaded diesel v2.1.6 [INFO] [stderr] Downloaded crossterm v0.20.0 [INFO] [stderr] Downloaded syn v2.0.64 [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] 10873e1bf20e37539bba0b09f8265dc83fae4de93fb584a047396fe3d04d65ef [INFO] running `Command { std: "docker" "start" "-a" "10873e1bf20e37539bba0b09f8265dc83fae4de93fb584a047396fe3d04d65ef", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "10873e1bf20e37539bba0b09f8265dc83fae4de93fb584a047396fe3d04d65ef", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "10873e1bf20e37539bba0b09f8265dc83fae4de93fb584a047396fe3d04d65ef", kill_on_drop: false }` [INFO] [stdout] 10873e1bf20e37539bba0b09f8265dc83fae4de93fb584a047396fe3d04d65ef [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] 43ed77fa4388db1873c862c30588ff5da09feb8c0134dcfdc47714a67f36884c [INFO] running `Command { std: "docker" "start" "-a" "43ed77fa4388db1873c862c30588ff5da09feb8c0134dcfdc47714a67f36884c", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.82 [INFO] [stderr] Checking mio v0.7.14 [INFO] [stderr] Checking parking_lot_core v0.8.6 [INFO] [stderr] Checking signal-hook v0.3.17 [INFO] [stderr] Compiling nix v0.28.0 [INFO] [stderr] Checking memchr v2.7.2 [INFO] [stderr] Compiling pq-sys v0.4.8 [INFO] [stderr] Checking parking_lot v0.12.2 [INFO] [stderr] Checking parking_lot v0.11.2 [INFO] [stderr] Checking unicode-width v0.1.12 [INFO] [stderr] Checking chrono v0.4.38 [INFO] [stderr] Checking termion v1.5.6 [INFO] [stderr] Checking crossterm v0.27.0 [INFO] [stderr] Checking signal-hook-mio v0.2.3 [INFO] [stderr] Checking strum v0.26.2 [INFO] [stderr] Checking cassowary v0.3.0 [INFO] [stderr] Checking crossterm v0.20.0 [INFO] [stderr] Checking crossterm v0.22.1 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking terminal-fonts v0.1.0 [INFO] [stderr] Compiling quote v1.0.36 [INFO] [stderr] Checking whoami v1.5.1 [INFO] [stderr] Checking tui v0.16.0 [INFO] [stderr] Compiling syn v2.0.64 [INFO] [stderr] Checking regex-automata v0.4.6 [INFO] [stderr] Checking ctrlc v3.4.4 [INFO] [stderr] Checking regex v1.10.4 [INFO] [stderr] Compiling diesel_table_macro_syntax v0.1.0 [INFO] [stderr] Compiling diesel_derives v2.1.4 [INFO] [stderr] Compiling strum_macros v0.26.2 [INFO] [stderr] Checking comfy-table v7.1.1 [INFO] [stderr] Checking diesel v2.1.6 [INFO] [stderr] Checking workflow v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/apps.rs:10:8 [INFO] [stdout] | [INFO] [stdout] 10 | if args.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/apps.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | / match db_operations::apps::add_app(&(x.to_lowercase()), display_communicates) { [INFO] [stdout] 19 | | Err(x) => println!("{}", x), [INFO] [stdout] 20 | | _ => (), [INFO] [stdout] 21 | | } [INFO] [stdout] | |_________________^ help: try: `if let Err(x) = db_operations::apps::add_app(&(x.to_lowercase()), display_communicates) { println!("{}", x) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/db_operations/apps.rs:37:8 [INFO] [stdout] | [INFO] [stdout] 37 | if args.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.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] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/db_operations/projects.rs:124:13 [INFO] [stdout] | [INFO] [stdout] 124 | return Err("Project of such name is already in the database, choose another name!"); [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] 124 - return Err("Project of such name is already in the database, choose another name!"); [INFO] [stdout] 124 + Err("Project of such name is already in the database, choose another name!") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/db_operations/projects.rs:128:13 [INFO] [stdout] | [INFO] [stdout] 128 | return Err("Database error occurred"); [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] 128 - return Err("Database error occurred"); [INFO] [stdout] 128 + Err("Database error occurred") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/db_operations/projects.rs:133:34 [INFO] [stdout] | [INFO] [stdout] 133 | pub fn get_apps_in_projects() -> Result, Option)>, &'static str> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/db_operations/projects.rs:158:6 [INFO] [stdout] | [INFO] [stdout] 158 | ) -> Result, Option, Option)>, &'static str> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `project_ids` after checking its variant with `is_some` [INFO] [stdout] --> src/db_operations/projects.rs:193:26 [INFO] [stdout] | [INFO] [stdout] 192 | if project_ids.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = project_ids` [INFO] [stdout] 193 | let seeked_ids = project_ids.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] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/db_operations/tasks.rs:86:13 [INFO] [stdout] | [INFO] [stdout] 86 | return Err("Task of such name is already in this project, choose another name!"); [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] 86 - return Err("Task of such name is already in this project, choose another name!"); [INFO] [stdout] 86 + Err("Task of such name is already in this project, choose another name!") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/db_operations/tasks.rs:89:13 [INFO] [stdout] | [INFO] [stdout] 89 | return Err("Database error occurred"); [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] 89 - return Err("Database error occurred"); [INFO] [stdout] 89 + Err("Database error occurred") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/db_operations/stats.rs:19:6 [INFO] [stdout] | [INFO] [stdout] 19 | ) -> Result, Option, Option)>, &'static str> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/db_operations/stats.rs:25:17 [INFO] [stdout] | [INFO] [stdout] 25 | let result: Result, Option, Option)>, Error> = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/db_operations/stats.rs:50:6 [INFO] [stdout] | [INFO] [stdout] 50 | ) -> Result, Option, Option)>, &'static str> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/db_operations/stats.rs:64:12 [INFO] [stdout] | [INFO] [stdout] 64 | if let Some(_) = seeked_project_id { [INFO] [stdout] | -------^^^^^^^-------------------- help: try: `if seeked_project_id.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: length comparison to zero [INFO] [stdout] --> src/db_operations/logs.rs:26:18 [INFO] [stdout] | [INFO] [stdout] 26 | Ok(x) if x.len() > 0 => { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/db_operations/logs.rs:40:8 [INFO] [stdout] | [INFO] [stdout] 40 | if args.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/logs.rs:10:16 [INFO] [stdout] | [INFO] [stdout] 10 | let a = if args.len() > 0 && (args[0] == "-t" || args[0] == "-tasks") { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!args.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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/logs.rs:12:15 [INFO] [stdout] | [INFO] [stdout] 12 | } else if args.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.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] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/logs.rs:87:13 [INFO] [stdout] | [INFO] [stdout] 87 | / if log_type != (Commands::Begin) { [INFO] [stdout] 88 | | println!("First begin the task, then perform other operations!"); [INFO] [stdout] 89 | | return 0 as usize; [INFO] [stdout] 90 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 86 ~ Ok(None) [INFO] [stdout] 87 ~ if log_type != (Commands::Begin) => { [INFO] [stdout] 88 | println!("First begin the task, then perform other operations!"); [INFO] [stdout] 89 | return 0 as usize; [INFO] [stdout] 90 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/logs.rs:84:20 [INFO] [stdout] | [INFO] [stdout] 84 | return 0 as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/logs.rs:89:24 [INFO] [stdout] | [INFO] [stdout] 89 | return 0 as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/logs.rs:94:20 [INFO] [stdout] | [INFO] [stdout] 94 | return 0 as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/logs.rs:130:20 [INFO] [stdout] | [INFO] [stdout] 130 | return 0 as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/logs.rs:136:20 [INFO] [stdout] | [INFO] [stdout] 136 | return 0 as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/logs.rs:140:20 [INFO] [stdout] | [INFO] [stdout] 140 | return 0 as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/projects.rs:46:24 [INFO] [stdout] | [INFO] [stdout] 46 | if let None = project_apps { [INFO] [stdout] | -------^^^^--------------- help: try: `if project_apps.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/projects.rs:69:16 [INFO] [stdout] | [INFO] [stdout] 69 | let stats: Result, Option, Option)>, &str> = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/projects.rs:78:8 [INFO] [stdout] | [INFO] [stdout] 78 | if project_apps.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `project_apps.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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/projects.rs:232:20 [INFO] [stdout] | [INFO] [stdout] 232 | if command.contains_key(&Commands::End.to_string()) [INFO] [stdout] | ____________________^ [INFO] [stdout] 233 | | && !!command.get(&Commands::End.to_string()).unwrap() [INFO] [stdout] | |_________________________________________________________________________^ help: try: `command.contains_key(&Commands::End.to_string()) && command.get(&Commands::End.to_string()).unwrap()` [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/projects.rs:252:20 [INFO] [stdout] | [INFO] [stdout] 252 | if command.contains_key(&Commands::Begin.to_string()) [INFO] [stdout] | ____________________^ [INFO] [stdout] 253 | | && !!command.get(&Commands::Begin.to_string()).unwrap() [INFO] [stdout] | |___________________________________________________________________________^ help: try: `command.contains_key(&Commands::Begin.to_string()) && command.get(&Commands::Begin.to_string()).unwrap()` [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: length comparison to zero [INFO] [stdout] --> src/projects.rs:272:8 [INFO] [stdout] | [INFO] [stdout] 272 | if project_tasks.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `project_tasks.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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/projects.rs:273:43 [INFO] [stdout] | [INFO] [stdout] 273 | if seeked_project_id.is_none() || seeked_project_id.clone().unwrap().len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!seeked_project_id.clone().unwrap().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] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/stats.rs:58:12 [INFO] [stdout] | [INFO] [stdout] 58 | stats: Result, Option, Option)>, &str>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/stats.rs:296:27 [INFO] [stdout] | [INFO] [stdout] 296 | a.cmp(&b) [INFO] [stdout] | ^^ help: change this to: `b` [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] --> src/stats.rs:314:27 [INFO] [stdout] | [INFO] [stdout] 314 | a.cmp(&b) [INFO] [stdout] | ^^ help: change this to: `b` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/stats.rs:418:12 [INFO] [stdout] | [INFO] [stdout] 418 | stats: Result, Option, Option)>, &str>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/stats.rs:474:43 [INFO] [stdout] | [INFO] [stdout] 474 | while i < result.len() && &result[i].0.task_id == &result[i - 1].0.task_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] 474 - while i < result.len() && &result[i].0.task_id == &result[i - 1].0.task_id { [INFO] [stdout] 474 + while i < result.len() && result[i].0.task_id == result[i - 1].0.task_id { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/stats.rs:524:33 [INFO] [stdout] | [INFO] [stdout] 524 | project_id: result[i - 1].0.project_id.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `result[i - 1].0.project_id` [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: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/stats.rs:581:33 [INFO] [stdout] | [INFO] [stdout] 581 | project_id: result[i - 1].0.project_id.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `result[i - 1].0.project_id` [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: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/stats.rs:629:24 [INFO] [stdout] | [INFO] [stdout] 629 | if let Err(_) = seeked_date { [INFO] [stdout] | -------^^^^^^-------------- help: try: `if seeked_date.is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/stats.rs:651:20 [INFO] [stdout] | [INFO] [stdout] 651 | let stats: Result, Option, Option)>, &str> = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/stats.rs:654:12 [INFO] [stdout] | [INFO] [stdout] 654 | if x.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/pomodoro.rs:51:8 [INFO] [stdout] | [INFO] [stdout] 51 | if args.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pomodoro.rs:165:13 [INFO] [stdout] | [INFO] [stdout] 165 | &task_id, [INFO] [stdout] | ^^^^^^^^ help: change this to: `task_id` [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: manual implementation of an assign operation [INFO] [stdout] --> src/pomodoro.rs:192:9 [INFO] [stdout] | [INFO] [stdout] 192 | *count_time = *count_time - chrono::Duration::seconds(1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*count_time -= chrono::Duration::seconds(1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/main.rs:78:1 [INFO] [stdout] | [INFO] [stdout] 78 | / impl ToString for Commands { [INFO] [stdout] 79 | | fn to_string(&self) -> String { [INFO] [stdout] 80 | | match self { [INFO] [stdout] 81 | | Self::Begin => String::from("B"), [INFO] [stdout] ... | [INFO] [stdout] 88 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | / if self.scroll_position > 0 { [INFO] [stdout] 133 | | self.scroll_position -= 1; [INFO] [stdout] 134 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 131 ~ Key::Up [INFO] [stdout] 132 ~ if self.scroll_position > 0 => { [INFO] [stdout] 133 | self.scroll_position -= 1; [INFO] [stdout] 134 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:138:17 [INFO] [stdout] | [INFO] [stdout] 138 | / if self.scroll_position < self.msg_end { [INFO] [stdout] 139 | | self.scroll_position += 1; [INFO] [stdout] 140 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 136 ~ Key::Down [INFO] [stdout] 137 | // You can adjust the scroll limit according to your content [INFO] [stdout] 138 ~ if self.scroll_position < self.msg_end => { [INFO] [stdout] 139 | self.scroll_position += 1; [INFO] [stdout] 140 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/main.rs:258:5 [INFO] [stdout] | [INFO] [stdout] 258 | / for key in io::stdin().keys() { [INFO] [stdout] 259 | | if let Ok(key) = key { [INFO] [stdout] 260 | | match key { [INFO] [stdout] 261 | | Key::Char('q') => break, [INFO] [stdout] ... | [INFO] [stdout] 285 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/main.rs:259:9 [INFO] [stdout] | [INFO] [stdout] 259 | / if let Ok(key) = key { [INFO] [stdout] 260 | | match key { [INFO] [stdout] 261 | | Key::Char('q') => break, [INFO] [stdout] 262 | | _ => { [INFO] [stdout] ... | [INFO] [stdout] 284 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 258 ~ for key in io::stdin().keys().flatten() { [INFO] [stdout] 259 + match key { [INFO] [stdout] 260 + Key::Char('q') => break, [INFO] [stdout] 261 + _ => { [INFO] [stdout] 262 + app.handle_input(key); [INFO] [stdout] 263 + terminal [INFO] [stdout] 264 + .draw(|f| { [INFO] [stdout] 265 + let chunks = Layout::default() [INFO] [stdout] 266 + .constraints([Constraint::Percentage(100)].as_ref()) [INFO] [stdout] 267 + .margin(2) [INFO] [stdout] 268 + .split(f.size()); [INFO] [stdout] 269 + [INFO] [stdout] 270 + let scrollable_text = message [INFO] [stdout] 271 + .lines() [INFO] [stdout] 272 + .skip(app.scroll_position as usize) [INFO] [stdout] 273 + .collect::>() [INFO] [stdout] 274 + .join("\n"); [INFO] [stdout] 275 + [INFO] [stdout] 276 + let paragraph = Paragraph::new(scrollable_text) [INFO] [stdout] 277 + .block(Block::default().title("Man").borders(Borders::ALL)); [INFO] [stdout] 278 + f.render_widget(paragraph, chunks[0]); [INFO] [stdout] 279 + }) [INFO] [stdout] 280 + .unwrap(); [INFO] [stdout] 281 + } [INFO] [stdout] 282 + } [INFO] [stdout] 283 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/apps.rs:10:8 [INFO] [stdout] | [INFO] [stdout] 10 | if args.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/apps.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | / match db_operations::apps::add_app(&(x.to_lowercase()), display_communicates) { [INFO] [stdout] 19 | | Err(x) => println!("{}", x), [INFO] [stdout] 20 | | _ => (), [INFO] [stdout] 21 | | } [INFO] [stdout] | |_________________^ help: try: `if let Err(x) = db_operations::apps::add_app(&(x.to_lowercase()), display_communicates) { println!("{}", x) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/db_operations/apps.rs:37:8 [INFO] [stdout] | [INFO] [stdout] 37 | if args.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.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] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/db_operations/projects.rs:124:13 [INFO] [stdout] | [INFO] [stdout] 124 | return Err("Project of such name is already in the database, choose another name!"); [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] 124 - return Err("Project of such name is already in the database, choose another name!"); [INFO] [stdout] 124 + Err("Project of such name is already in the database, choose another name!") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/db_operations/projects.rs:128:13 [INFO] [stdout] | [INFO] [stdout] 128 | return Err("Database error occurred"); [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] 128 - return Err("Database error occurred"); [INFO] [stdout] 128 + Err("Database error occurred") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/db_operations/projects.rs:133:34 [INFO] [stdout] | [INFO] [stdout] 133 | pub fn get_apps_in_projects() -> Result, Option)>, &'static str> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/db_operations/projects.rs:158:6 [INFO] [stdout] | [INFO] [stdout] 158 | ) -> Result, Option, Option)>, &'static str> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `project_ids` after checking its variant with `is_some` [INFO] [stdout] --> src/db_operations/projects.rs:193:26 [INFO] [stdout] | [INFO] [stdout] 192 | if project_ids.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = project_ids` [INFO] [stdout] 193 | let seeked_ids = project_ids.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] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/db_operations/tasks.rs:86:13 [INFO] [stdout] | [INFO] [stdout] 86 | return Err("Task of such name is already in this project, choose another name!"); [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] 86 - return Err("Task of such name is already in this project, choose another name!"); [INFO] [stdout] 86 + Err("Task of such name is already in this project, choose another name!") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/db_operations/tasks.rs:89:13 [INFO] [stdout] | [INFO] [stdout] 89 | return Err("Database error occurred"); [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] 89 - return Err("Database error occurred"); [INFO] [stdout] 89 + Err("Database error occurred") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/db_operations/stats.rs:19:6 [INFO] [stdout] | [INFO] [stdout] 19 | ) -> Result, Option, Option)>, &'static str> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/db_operations/stats.rs:25:17 [INFO] [stdout] | [INFO] [stdout] 25 | let result: Result, Option, Option)>, Error> = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/db_operations/stats.rs:50:6 [INFO] [stdout] | [INFO] [stdout] 50 | ) -> Result, Option, Option)>, &'static str> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/db_operations/stats.rs:64:12 [INFO] [stdout] | [INFO] [stdout] 64 | if let Some(_) = seeked_project_id { [INFO] [stdout] | -------^^^^^^^-------------------- help: try: `if seeked_project_id.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: length comparison to zero [INFO] [stdout] --> src/db_operations/logs.rs:26:18 [INFO] [stdout] | [INFO] [stdout] 26 | Ok(x) if x.len() > 0 => { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/db_operations/logs.rs:40:8 [INFO] [stdout] | [INFO] [stdout] 40 | if args.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/logs.rs:10:16 [INFO] [stdout] | [INFO] [stdout] 10 | let a = if args.len() > 0 && (args[0] == "-t" || args[0] == "-tasks") { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!args.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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/logs.rs:12:15 [INFO] [stdout] | [INFO] [stdout] 12 | } else if args.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.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] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/logs.rs:87:13 [INFO] [stdout] | [INFO] [stdout] 87 | / if log_type != (Commands::Begin) { [INFO] [stdout] 88 | | println!("First begin the task, then perform other operations!"); [INFO] [stdout] 89 | | return 0 as usize; [INFO] [stdout] 90 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 86 ~ Ok(None) [INFO] [stdout] 87 ~ if log_type != (Commands::Begin) => { [INFO] [stdout] 88 | println!("First begin the task, then perform other operations!"); [INFO] [stdout] 89 | return 0 as usize; [INFO] [stdout] 90 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/logs.rs:84:20 [INFO] [stdout] | [INFO] [stdout] 84 | return 0 as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/logs.rs:89:24 [INFO] [stdout] | [INFO] [stdout] 89 | return 0 as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/logs.rs:94:20 [INFO] [stdout] | [INFO] [stdout] 94 | return 0 as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/logs.rs:130:20 [INFO] [stdout] | [INFO] [stdout] 130 | return 0 as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/logs.rs:136:20 [INFO] [stdout] | [INFO] [stdout] 136 | return 0 as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/logs.rs:140:20 [INFO] [stdout] | [INFO] [stdout] 140 | return 0 as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/projects.rs:46:24 [INFO] [stdout] | [INFO] [stdout] 46 | if let None = project_apps { [INFO] [stdout] | -------^^^^--------------- help: try: `if project_apps.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/projects.rs:69:16 [INFO] [stdout] | [INFO] [stdout] 69 | let stats: Result, Option, Option)>, &str> = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/projects.rs:78:8 [INFO] [stdout] | [INFO] [stdout] 78 | if project_apps.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `project_apps.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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/projects.rs:232:20 [INFO] [stdout] | [INFO] [stdout] 232 | if command.contains_key(&Commands::End.to_string()) [INFO] [stdout] | ____________________^ [INFO] [stdout] 233 | | && !!command.get(&Commands::End.to_string()).unwrap() [INFO] [stdout] | |_________________________________________________________________________^ help: try: `command.contains_key(&Commands::End.to_string()) && command.get(&Commands::End.to_string()).unwrap()` [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/projects.rs:252:20 [INFO] [stdout] | [INFO] [stdout] 252 | if command.contains_key(&Commands::Begin.to_string()) [INFO] [stdout] | ____________________^ [INFO] [stdout] 253 | | && !!command.get(&Commands::Begin.to_string()).unwrap() [INFO] [stdout] | |___________________________________________________________________________^ help: try: `command.contains_key(&Commands::Begin.to_string()) && command.get(&Commands::Begin.to_string()).unwrap()` [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: length comparison to zero [INFO] [stdout] --> src/projects.rs:272:8 [INFO] [stdout] | [INFO] [stdout] 272 | if project_tasks.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `project_tasks.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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/projects.rs:273:43 [INFO] [stdout] | [INFO] [stdout] 273 | if seeked_project_id.is_none() || seeked_project_id.clone().unwrap().len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!seeked_project_id.clone().unwrap().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] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/stats.rs:58:12 [INFO] [stdout] | [INFO] [stdout] 58 | stats: Result, Option, Option)>, &str>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/stats.rs:296:27 [INFO] [stdout] | [INFO] [stdout] 296 | a.cmp(&b) [INFO] [stdout] | ^^ help: change this to: `b` [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] --> src/stats.rs:314:27 [INFO] [stdout] | [INFO] [stdout] 314 | a.cmp(&b) [INFO] [stdout] | ^^ help: change this to: `b` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/stats.rs:418:12 [INFO] [stdout] | [INFO] [stdout] 418 | stats: Result, Option, Option)>, &str>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/stats.rs:474:43 [INFO] [stdout] | [INFO] [stdout] 474 | while i < result.len() && &result[i].0.task_id == &result[i - 1].0.task_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] 474 - while i < result.len() && &result[i].0.task_id == &result[i - 1].0.task_id { [INFO] [stdout] 474 + while i < result.len() && result[i].0.task_id == result[i - 1].0.task_id { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/stats.rs:524:33 [INFO] [stdout] | [INFO] [stdout] 524 | project_id: result[i - 1].0.project_id.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `result[i - 1].0.project_id` [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: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/stats.rs:581:33 [INFO] [stdout] | [INFO] [stdout] 581 | project_id: result[i - 1].0.project_id.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `result[i - 1].0.project_id` [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: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/stats.rs:629:24 [INFO] [stdout] | [INFO] [stdout] 629 | if let Err(_) = seeked_date { [INFO] [stdout] | -------^^^^^^-------------- help: try: `if seeked_date.is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/stats.rs:651:20 [INFO] [stdout] | [INFO] [stdout] 651 | let stats: Result, Option, Option)>, &str> = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/stats.rs:654:12 [INFO] [stdout] | [INFO] [stdout] 654 | if x.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/pomodoro.rs:51:8 [INFO] [stdout] | [INFO] [stdout] 51 | if args.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pomodoro.rs:165:13 [INFO] [stdout] | [INFO] [stdout] 165 | &task_id, [INFO] [stdout] | ^^^^^^^^ help: change this to: `task_id` [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: manual implementation of an assign operation [INFO] [stdout] --> src/pomodoro.rs:192:9 [INFO] [stdout] | [INFO] [stdout] 192 | *count_time = *count_time - chrono::Duration::seconds(1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*count_time -= chrono::Duration::seconds(1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/main.rs:78:1 [INFO] [stdout] | [INFO] [stdout] 78 | / impl ToString for Commands { [INFO] [stdout] 79 | | fn to_string(&self) -> String { [INFO] [stdout] 80 | | match self { [INFO] [stdout] 81 | | Self::Begin => String::from("B"), [INFO] [stdout] ... | [INFO] [stdout] 88 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | / if self.scroll_position > 0 { [INFO] [stdout] 133 | | self.scroll_position -= 1; [INFO] [stdout] 134 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 131 ~ Key::Up [INFO] [stdout] 132 ~ if self.scroll_position > 0 => { [INFO] [stdout] 133 | self.scroll_position -= 1; [INFO] [stdout] 134 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:138:17 [INFO] [stdout] | [INFO] [stdout] 138 | / if self.scroll_position < self.msg_end { [INFO] [stdout] 139 | | self.scroll_position += 1; [INFO] [stdout] 140 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 136 ~ Key::Down [INFO] [stdout] 137 | // You can adjust the scroll limit according to your content [INFO] [stdout] 138 ~ if self.scroll_position < self.msg_end => { [INFO] [stdout] 139 | self.scroll_position += 1; [INFO] [stdout] 140 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/main.rs:258:5 [INFO] [stdout] | [INFO] [stdout] 258 | / for key in io::stdin().keys() { [INFO] [stdout] 259 | | if let Ok(key) = key { [INFO] [stdout] 260 | | match key { [INFO] [stdout] 261 | | Key::Char('q') => break, [INFO] [stdout] ... | [INFO] [stdout] 285 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/main.rs:259:9 [INFO] [stdout] | [INFO] [stdout] 259 | / if let Ok(key) = key { [INFO] [stdout] 260 | | match key { [INFO] [stdout] 261 | | Key::Char('q') => break, [INFO] [stdout] 262 | | _ => { [INFO] [stdout] ... | [INFO] [stdout] 284 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 258 ~ for key in io::stdin().keys().flatten() { [INFO] [stdout] 259 + match key { [INFO] [stdout] 260 + Key::Char('q') => break, [INFO] [stdout] 261 + _ => { [INFO] [stdout] 262 + app.handle_input(key); [INFO] [stdout] 263 + terminal [INFO] [stdout] 264 + .draw(|f| { [INFO] [stdout] 265 + let chunks = Layout::default() [INFO] [stdout] 266 + .constraints([Constraint::Percentage(100)].as_ref()) [INFO] [stdout] 267 + .margin(2) [INFO] [stdout] 268 + .split(f.size()); [INFO] [stdout] 269 + [INFO] [stdout] 270 + let scrollable_text = message [INFO] [stdout] 271 + .lines() [INFO] [stdout] 272 + .skip(app.scroll_position as usize) [INFO] [stdout] 273 + .collect::>() [INFO] [stdout] 274 + .join("\n"); [INFO] [stdout] 275 + [INFO] [stdout] 276 + let paragraph = Paragraph::new(scrollable_text) [INFO] [stdout] 277 + .block(Block::default().title("Man").borders(Borders::ALL)); [INFO] [stdout] 278 + f.render_widget(paragraph, chunks[0]); [INFO] [stdout] 279 + }) [INFO] [stdout] 280 + .unwrap(); [INFO] [stdout] 281 + } [INFO] [stdout] 282 + } [INFO] [stdout] 283 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 44.36s [INFO] running `Command { std: "docker" "inspect" "43ed77fa4388db1873c862c30588ff5da09feb8c0134dcfdc47714a67f36884c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "43ed77fa4388db1873c862c30588ff5da09feb8c0134dcfdc47714a67f36884c", kill_on_drop: false }` [INFO] [stdout] 43ed77fa4388db1873c862c30588ff5da09feb8c0134dcfdc47714a67f36884c