[INFO] fetching crate choki 1.1.19... [INFO] linting choki-1.1.19 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate choki 1.1.19 into /workspace/builds/worker-4-tc1/source [INFO] started tweaking crates.io crate choki 1.1.19 [INFO] finished tweaking crates.io crate choki 1.1.19 [INFO] tweaked toml for crates.io crate choki 1.1.19 written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate choki 1.1.19 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 crates.io crate choki 1.1.19 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 urlencoding v2.1.3 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 1edad5309602944bb14131bdb01a171fd06667f36dba0c92a62a6fce455ac2b1 [INFO] running `Command { std: "docker" "start" "-a" "1edad5309602944bb14131bdb01a171fd06667f36dba0c92a62a6fce455ac2b1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "1edad5309602944bb14131bdb01a171fd06667f36dba0c92a62a6fce455ac2b1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1edad5309602944bb14131bdb01a171fd06667f36dba0c92a62a6fce455ac2b1", kill_on_drop: false }` [INFO] [stdout] 1edad5309602944bb14131bdb01a171fd06667f36dba0c92a62a6fce455ac2b1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 43f9f4f3a182f8cc0b0cd1b0250115664366fe9a8690beacb4a3006466a57e0b [INFO] running `Command { std: "docker" "start" "-a" "43f9f4f3a182f8cc0b0cd1b0250115664366fe9a8690beacb4a3006466a57e0b", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.171 [INFO] [stderr] Checking miniz_oxide v0.8.0 [INFO] [stderr] Checking crc32fast v1.4.2 [INFO] [stderr] Checking bumpalo v3.17.0 [INFO] [stderr] Checking urlencoding v2.1.3 [INFO] [stderr] Checking flate2 v1.0.35 [INFO] [stderr] Checking num_cpus v1.16.0 [INFO] [stderr] Checking threadpool v1.8.1 [INFO] [stderr] Checking choki v1.1.19 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `std::fmt::write` [INFO] [stdout] --> src/lib.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | use std::fmt::write; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::hash::Hash` [INFO] [stdout] --> src/lib.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use std::hash::Hash; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `self` [INFO] [stdout] --> src/lib.rs:9:18 [INFO] [stdout] | [INFO] [stdout] 9 | use std::path::{ self, Path }; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Instant` [INFO] [stdout] --> src/lib.rs:10:28 [INFO] [stdout] | [INFO] [stdout] 10 | use std::time::{ Duration, Instant }; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `fs`, `io`, and `vec` [INFO] [stdout] --> src/lib.rs:11:12 [INFO] [stdout] | [INFO] [stdout] 11 | use std::{ fs, io, thread, vec }; [INFO] [stdout] | ^^ ^^ ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `io::Write` [INFO] [stdout] --> src/lib.rs:12:12 [INFO] [stdout] | [INFO] [stdout] 12 | use std::{ io::Write, net::* }; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Error` [INFO] [stdout] --> src/lib.rs:14:36 [INFO] [stdout] | [INFO] [stdout] 14 | use std::io::{ BufRead, BufReader, Error, Read }; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Write` [INFO] [stdout] --> src/src/request.rs:1:57 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{ collections::HashMap, io::{ BufReader, Read, Write }, net::TcpStream }; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | query: query, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `query` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | params: params, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `params` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:46:13 [INFO] [stdout] | [INFO] [stdout] 46 | headers: headers, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `headers` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:47:13 [INFO] [stdout] | [INFO] [stdout] 47 | cookies: cookies, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `cookies` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | ip: ip, [INFO] [stdout] | ^^^^^^ help: replace it with: `ip` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:50:13 [INFO] [stdout] | [INFO] [stdout] 50 | user_agent: user_agent, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `user_agent` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | content_encoding: content_encoding, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `content_encoding` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:52:13 [INFO] [stdout] | [INFO] [stdout] 52 | content_length: content_length, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `content_length` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | content_type: content_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `content_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:55:13 [INFO] [stdout] | [INFO] [stdout] 55 | boudary: boudary, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `boudary` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `result` [INFO] [stdout] --> src/src/response.rs:1:60 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{ io::{ BufReader, Read, Write }, net::TcpStream, result }; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/response.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | stream: stream, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `stream` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:72:13 [INFO] [stdout] | [INFO] [stdout] 72 | encoding_type: encoding_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `encoding_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:73:13 [INFO] [stdout] | [INFO] [stdout] 73 | quality: quality, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `quality` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:216:13 [INFO] [stdout] | [INFO] [stdout] 216 | path: path, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:217:13 [INFO] [stdout] | [INFO] [stdout] 217 | req_type: req_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `req_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:218:13 [INFO] [stdout] | [INFO] [stdout] 218 | query: query, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `query` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:310:13 [INFO] [stdout] | [INFO] [stdout] 310 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:311:13 [INFO] [stdout] | [INFO] [stdout] 311 | value: value, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:398:13 [INFO] [stdout] | [INFO] [stdout] 398 | path: path, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:399:13 [INFO] [stdout] | [INFO] [stdout] 399 | req_type: req_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `req_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:400:13 [INFO] [stdout] | [INFO] [stdout] 400 | handle: handle, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `handle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:426:13 [INFO] [stdout] | [INFO] [stdout] 426 | content_type: content_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `content_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:497:13 [INFO] [stdout] | [INFO] [stdout] 497 | info: info, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:498:13 [INFO] [stdout] | [INFO] [stdout] 498 | data: data, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:504:13 [INFO] [stdout] | [INFO] [stdout] 504 | info: info, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:506:13 [INFO] [stdout] | [INFO] [stdout] 506 | value: value, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lib.rs:50:13 [INFO] [stdout] | [INFO] [stdout] 50 | public_var: public_var, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `public_var` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fmt::write` [INFO] [stdout] --> src/lib.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | use std::fmt::write; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::hash::Hash` [INFO] [stdout] --> src/lib.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use std::hash::Hash; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `self` [INFO] [stdout] --> src/lib.rs:9:18 [INFO] [stdout] | [INFO] [stdout] 9 | use std::path::{ self, Path }; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Instant` [INFO] [stdout] --> src/lib.rs:10:28 [INFO] [stdout] | [INFO] [stdout] 10 | use std::time::{ Duration, Instant }; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `fs`, `io`, and `vec` [INFO] [stdout] --> src/lib.rs:11:12 [INFO] [stdout] | [INFO] [stdout] 11 | use std::{ fs, io, thread, vec }; [INFO] [stdout] | ^^ ^^ ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `io::Write` [INFO] [stdout] --> src/lib.rs:12:12 [INFO] [stdout] | [INFO] [stdout] 12 | use std::{ io::Write, net::* }; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Error` [INFO] [stdout] --> src/lib.rs:14:36 [INFO] [stdout] | [INFO] [stdout] 14 | use std::io::{ BufRead, BufReader, Error, Read }; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Write` [INFO] [stdout] --> src/src/request.rs:1:57 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{ collections::HashMap, io::{ BufReader, Read, Write }, net::TcpStream }; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | query: query, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `query` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | params: params, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `params` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:46:13 [INFO] [stdout] | [INFO] [stdout] 46 | headers: headers, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `headers` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:47:13 [INFO] [stdout] | [INFO] [stdout] 47 | cookies: cookies, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `cookies` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | ip: ip, [INFO] [stdout] | ^^^^^^ help: replace it with: `ip` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:50:13 [INFO] [stdout] | [INFO] [stdout] 50 | user_agent: user_agent, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `user_agent` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | content_encoding: content_encoding, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `content_encoding` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:52:13 [INFO] [stdout] | [INFO] [stdout] 52 | content_length: content_length, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `content_length` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | content_type: content_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `content_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/request.rs:55:13 [INFO] [stdout] | [INFO] [stdout] 55 | boudary: boudary, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `boudary` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `result` [INFO] [stdout] --> src/src/response.rs:1:60 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{ io::{ BufReader, Read, Write }, net::TcpStream, result }; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/response.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | stream: stream, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `stream` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:72:13 [INFO] [stdout] | [INFO] [stdout] 72 | encoding_type: encoding_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `encoding_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:73:13 [INFO] [stdout] | [INFO] [stdout] 73 | quality: quality, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `quality` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:216:13 [INFO] [stdout] | [INFO] [stdout] 216 | path: path, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:217:13 [INFO] [stdout] | [INFO] [stdout] 217 | req_type: req_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `req_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:218:13 [INFO] [stdout] | [INFO] [stdout] 218 | query: query, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `query` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:310:13 [INFO] [stdout] | [INFO] [stdout] 310 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:311:13 [INFO] [stdout] | [INFO] [stdout] 311 | value: value, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:398:13 [INFO] [stdout] | [INFO] [stdout] 398 | path: path, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:399:13 [INFO] [stdout] | [INFO] [stdout] 399 | req_type: req_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `req_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:400:13 [INFO] [stdout] | [INFO] [stdout] 400 | handle: handle, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `handle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:426:13 [INFO] [stdout] | [INFO] [stdout] 426 | content_type: content_type, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `content_type` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:497:13 [INFO] [stdout] | [INFO] [stdout] 497 | info: info, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:498:13 [INFO] [stdout] | [INFO] [stdout] 498 | data: data, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:504:13 [INFO] [stdout] | [INFO] [stdout] 504 | info: info, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/src/structs.rs:506:13 [INFO] [stdout] | [INFO] [stdout] 506 | value: value, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lib.rs:50:13 [INFO] [stdout] | [INFO] [stdout] 50 | public_var: public_var, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `public_var` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `io::BufRead` [INFO] [stdout] --> src/src/structs.rs:1:34 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{ collections::HashMap, io::BufRead }; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `err` [INFO] [stdout] --> src/src/request.rs:94:29 [INFO] [stdout] | [INFO] [stdout] 94 | Err(err) => 0, [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_err` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `err` [INFO] [stdout] --> src/src/request.rs:115:37 [INFO] [stdout] | [INFO] [stdout] 115 | ... Err(err) => -1.0, [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_err` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `data_indexes` is never read [INFO] [stdout] --> src/src/request.rs:284:53 [INFO] [stdout] | [INFO] [stdout] 284 | let mut data_indexes: Vec<(usize, usize)> = Vec::new(); [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: value assigned to `body_item_info` is never read [INFO] [stdout] --> src/src/request.rs:285:48 [INFO] [stdout] | [INFO] [stdout] 285 | let mut body_item_info: BodyItemInfo = BodyItemInfo::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `io::BufRead` [INFO] [stdout] --> src/src/structs.rs:1:34 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{ collections::HashMap, io::BufRead }; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `err` [INFO] [stdout] --> src/src/request.rs:94:29 [INFO] [stdout] | [INFO] [stdout] 94 | Err(err) => 0, [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_err` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `err` [INFO] [stdout] --> src/src/request.rs:115:37 [INFO] [stdout] | [INFO] [stdout] 115 | ... Err(err) => -1.0, [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_err` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `data_indexes` is never read [INFO] [stdout] --> src/src/request.rs:284:53 [INFO] [stdout] | [INFO] [stdout] 284 | let mut data_indexes: Vec<(usize, usize)> = Vec::new(); [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: value assigned to `body_item_info` is never read [INFO] [stdout] --> src/src/request.rs:285:48 [INFO] [stdout] | [INFO] [stdout] 285 | let mut body_item_info: BodyItemInfo = BodyItemInfo::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `parts` is never read [INFO] [stdout] --> src/src/structs.rs:452:36 [INFO] [stdout] | [INFO] [stdout] 452 | let mut parts: Vec<&str> = Vec::new(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `parts` is never read [INFO] [stdout] --> src/src/structs.rs:452:36 [INFO] [stdout] | [INFO] [stdout] 452 | let mut parts: Vec<&str> = Vec::new(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `e` [INFO] [stdout] --> src/lib.rs:281:21 [INFO] [stdout] | [INFO] [stdout] 281 | Err(e) => { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_e` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (10/7) [INFO] [stdout] --> src/src/request.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | / pub fn new( [INFO] [stdout] 30 | | query: HashMap, [INFO] [stdout] 31 | | params: HashMap, [INFO] [stdout] 32 | | headers: Vec
, [INFO] [stdout] ... | [INFO] [stdout] 41 | | boudary: Option [INFO] [stdout] 42 | | ) -> Request { [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/request.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | / return Request { [INFO] [stdout] 44 | | query: query, [INFO] [stdout] 45 | | params: params, [INFO] [stdout] 46 | | headers: headers, [INFO] [stdout] ... | [INFO] [stdout] 59 | | buffer: Vec::new(), [INFO] [stdout] 60 | | }; [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] 43 ~ Request { [INFO] [stdout] 44 + query: query, [INFO] [stdout] 45 + params: params, [INFO] [stdout] 46 + headers: headers, [INFO] [stdout] 47 + cookies: cookies, [INFO] [stdout] 48 + [INFO] [stdout] 49 + ip: ip, [INFO] [stdout] 50 + user_agent: user_agent, [INFO] [stdout] 51 + content_encoding: content_encoding, [INFO] [stdout] 52 + content_length: content_length, [INFO] [stdout] 53 + [INFO] [stdout] 54 + content_type: content_type, [INFO] [stdout] 55 + boudary: boudary, [INFO] [stdout] 56 + [INFO] [stdout] 57 + body: Vec::new(), [INFO] [stdout] 58 + body_data_segments: Vec::new(), [INFO] [stdout] 59 + buffer: Vec::new(), [INFO] [stdout] 60 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/request.rs:162:9 [INFO] [stdout] | [INFO] [stdout] 162 | return Ok(req); [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] 162 - return Ok(req); [INFO] [stdout] 162 + Ok(req) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/request.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | return input[skip_text.len()..].to_string(); [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] 80 - return input[skip_text.len()..].to_string(); [INFO] [stdout] 80 + input[skip_text.len()..].to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/src/request.rs:92:42 [INFO] [stdout] | [INFO] [stdout] 92 | req.content_length = match parts[1].parse::() { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 93 | | Ok(res) => res, [INFO] [stdout] 94 | | Err(err) => 0, [INFO] [stdout] 95 | | }; [INFO] [stdout] | |_____________________^ help: ascribe the type usize and replace your expression with: `parts[1].parse::().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/request.rs:109:28 [INFO] [stdout] | [INFO] [stdout] 109 | if parts.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!parts.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: this pattern reimplements `Result::unwrap_or` [INFO] [stdout] --> src/src/request.rs:113:48 [INFO] [stdout] | [INFO] [stdout] 113 | ... encoding.quality = match parts[1].parse::() { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 114 | | ... Ok(res) => res, [INFO] [stdout] 115 | | ... Err(err) => -1.0, [INFO] [stdout] 116 | | ... }; [INFO] [stdout] | |_______________________^ help: replace with: `parts[1].parse::().unwrap_or(-1.0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/request.rs:129:20 [INFO] [stdout] | [INFO] [stdout] 129 | if parts.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!parts.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/src/request.rs:191:9 [INFO] [stdout] | [INFO] [stdout] 191 | return res; [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] 191 - return res; [INFO] [stdout] 191 + res [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/request.rs:166:12 [INFO] [stdout] | [INFO] [stdout] 166 | if self.body.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.body.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: called `unwrap` on `key_value` after checking its variant with `is_some` [INFO] [stdout] --> src/src/request.rs:229:37 [INFO] [stdout] | [INFO] [stdout] 228 | if key_value.is_some() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = key_value` [INFO] [stdout] 229 | let key_value = key_value.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/src/request.rs:310:9 [INFO] [stdout] | [INFO] [stdout] 310 | return Ok(true); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 310 - return Ok(true); [INFO] [stdout] 310 + Ok(true) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/src/request.rs:204:9 [INFO] [stdout] | [INFO] [stdout] 204 | / loop { [INFO] [stdout] 205 | | match bfreader.read(&mut buffer) { [INFO] [stdout] 206 | | Ok(size) => { [INFO] [stdout] 207 | | total_size += size; [INFO] [stdout] ... | [INFO] [stdout] 218 | | } [INFO] [stdout] | |_________^ help: try: `while let Ok(size) = bfreader.read(&mut buffer) { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/src/request.rs:246:24 [INFO] [stdout] | [INFO] [stdout] 246 | let boundary = (&self.boudary.clone().unwrap()).as_bytes().to_owned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.boudary.clone().unwrap()` [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 loop could be written as a `while let` loop [INFO] [stdout] --> src/src/request.rs:316:9 [INFO] [stdout] | [INFO] [stdout] 316 | / loop { [INFO] [stdout] 317 | | match bfreader.read(&mut buffer) { [INFO] [stdout] 318 | | Ok(size) => { [INFO] [stdout] 319 | | total_size += size; [INFO] [stdout] ... | [INFO] [stdout] 328 | | } [INFO] [stdout] | |_________^ help: try: `while let Ok(size) = bfreader.read(&mut buffer) { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/response.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | / return Response { [INFO] [stdout] 21 | | stream: stream, [INFO] [stdout] 22 | | cookies: Vec::new(), [INFO] [stdout] 23 | | headers: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 26 | | status_code: ResponseCode::Ok, [INFO] [stdout] 27 | | }; [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] 20 ~ Response { [INFO] [stdout] 21 + stream: stream, [INFO] [stdout] 22 + cookies: Vec::new(), [INFO] [stdout] 23 + headers: Vec::new(), [INFO] [stdout] 24 + content_encoding: content_encoding.unwrap_or_default(), [INFO] [stdout] 25 + use_compression: false, [INFO] [stdout] 26 + status_code: ResponseCode::Ok, [INFO] [stdout] 27 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `e` [INFO] [stdout] --> src/lib.rs:281:21 [INFO] [stdout] | [INFO] [stdout] 281 | Err(e) => { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_e` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/response.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | return compressed_data; [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] 72 - return compressed_data; [INFO] [stdout] 72 + compressed_data [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/response.rs:87:9 [INFO] [stdout] | [INFO] [stdout] 87 | return data.to_vec(); [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] 87 - return data.to_vec(); [INFO] [stdout] 87 + data.to_vec() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/response.rs:75:12 [INFO] [stdout] | [INFO] [stdout] 75 | if self.content_encoding.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.content_encoding.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/src/response.rs:91:13 [INFO] [stdout] | [INFO] [stdout] 91 | return self.compress_data(data); [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] 91 - return self.compress_data(data); [INFO] [stdout] 91 + self.compress_data(data) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/response.rs:93:13 [INFO] [stdout] | [INFO] [stdout] 93 | return data.to_vec(); [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] 93 - return data.to_vec(); [INFO] [stdout] 93 + data.to_vec() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/src/response.rs:90:12 [INFO] [stdout] | [INFO] [stdout] 90 | if self.use_compression == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.use_compression` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` 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/src/response.rs:102:25 [INFO] [stdout] | [INFO] [stdout] 102 | self.send_bytes(&data.as_bytes(), Some(ContentType::PlainText)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `data.as_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/src/response.rs:110:25 [INFO] [stdout] | [INFO] [stdout] 110 | self.send_bytes(&data.as_bytes(), Some(ContentType::Json)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `data.as_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/src/response.rs:118:44 [INFO] [stdout] | [INFO] [stdout] 118 | let content_type: ContentType = if !content_type.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `content_type.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `content_type` after checking its variant with `is_none` [INFO] [stdout] --> src/src/response.rs:119:13 [INFO] [stdout] | [INFO] [stdout] 118 | let content_type: ContentType = if !content_type.is_none() { [INFO] [stdout] | ---------------------- the check is happening here [INFO] [stdout] 119 | content_type.unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/src/response.rs:140:37 [INFO] [stdout] | [INFO] [stdout] 140 | match self.stream.write_all(&response.as_bytes()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `response.as_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/src/response.rs:159:44 [INFO] [stdout] | [INFO] [stdout] 159 | let content_type: ContentType = if !content_type.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `content_type.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `content_type` after checking its variant with `is_none` [INFO] [stdout] --> src/src/response.rs:160:13 [INFO] [stdout] | [INFO] [stdout] 159 | let content_type: ContentType = if !content_type.is_none() { [INFO] [stdout] | ---------------------- the check is happening here [INFO] [stdout] 160 | content_type.unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/src/response.rs:184:37 [INFO] [stdout] | [INFO] [stdout] 184 | match self.stream.write_all(&response.as_bytes()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `response.as_bytes()` [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: called `unwrap` on `stream_size` after checking its variant with `is_some` [INFO] [stdout] --> src/src/response.rs:258:14 [INFO] [stdout] | [INFO] [stdout] 257 | let stream_size: i64 = if stream_size.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = stream_size` [INFO] [stdout] 258 | *stream_size.unwrap() as i64 [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: unneeded `return` statement [INFO] [stdout] --> src/src/response.rs:352:9 [INFO] [stdout] | [INFO] [stdout] 352 | return &self.stream; [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] 352 - return &self.stream; [INFO] [stdout] 352 + &self.stream [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (10/7) [INFO] [stdout] --> src/src/request.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | / pub fn new( [INFO] [stdout] 30 | | query: HashMap, [INFO] [stdout] 31 | | params: HashMap, [INFO] [stdout] 32 | | headers: Vec
, [INFO] [stdout] ... | [INFO] [stdout] 41 | | boudary: Option [INFO] [stdout] 42 | | ) -> Request { [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `src::structs::EncodingType` [INFO] [stdout] --> src/src/structs.rs:56:5 [INFO] [stdout] | [INFO] [stdout] 56 | / pub fn to_string(&self) -> String { [INFO] [stdout] 57 | | match self { [INFO] [stdout] 58 | | EncodingType::Gzip => "gzip".to_owned(), [INFO] [stdout] 59 | | EncodingType::Any => "*".to_owned(), [INFO] [stdout] ... | [INFO] [stdout] 62 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `src::structs::EncodingType` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/request.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | / return Request { [INFO] [stdout] 44 | | query: query, [INFO] [stdout] 45 | | params: params, [INFO] [stdout] 46 | | headers: headers, [INFO] [stdout] ... | [INFO] [stdout] 59 | | buffer: Vec::new(), [INFO] [stdout] 60 | | }; [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] 43 ~ Request { [INFO] [stdout] 44 + query: query, [INFO] [stdout] 45 + params: params, [INFO] [stdout] 46 + headers: headers, [INFO] [stdout] 47 + cookies: cookies, [INFO] [stdout] 48 + [INFO] [stdout] 49 + ip: ip, [INFO] [stdout] 50 + user_agent: user_agent, [INFO] [stdout] 51 + content_encoding: content_encoding, [INFO] [stdout] 52 + content_length: content_length, [INFO] [stdout] 53 + [INFO] [stdout] 54 + content_type: content_type, [INFO] [stdout] 55 + boudary: boudary, [INFO] [stdout] 56 + [INFO] [stdout] 57 + body: Vec::new(), [INFO] [stdout] 58 + body_data_segments: Vec::new(), [INFO] [stdout] 59 + buffer: Vec::new(), [INFO] [stdout] 60 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:71:9 [INFO] [stdout] | [INFO] [stdout] 71 | / return Encoding { [INFO] [stdout] 72 | | encoding_type: encoding_type, [INFO] [stdout] 73 | | quality: quality, [INFO] [stdout] 74 | | }; [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] 71 ~ Encoding { [INFO] [stdout] 72 + encoding_type: encoding_type, [INFO] [stdout] 73 + quality: quality, [INFO] [stdout] 74 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/request.rs:162:9 [INFO] [stdout] | [INFO] [stdout] 162 | return Ok(req); [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] 162 - return Ok(req); [INFO] [stdout] 162 + Ok(req) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/request.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | return input[skip_text.len()..].to_string(); [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] 80 - return input[skip_text.len()..].to_string(); [INFO] [stdout] 80 + input[skip_text.len()..].to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:205:9 [INFO] [stdout] | [INFO] [stdout] 205 | return HttpServerError { reason: reason.to_string() }; [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] 205 - return HttpServerError { reason: reason.to_string() }; [INFO] [stdout] 205 + HttpServerError { reason: reason.to_string() } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/src/request.rs:92:42 [INFO] [stdout] | [INFO] [stdout] 92 | req.content_length = match parts[1].parse::() { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 93 | | Ok(res) => res, [INFO] [stdout] 94 | | Err(err) => 0, [INFO] [stdout] 95 | | }; [INFO] [stdout] | |_____________________^ help: ascribe the type usize and replace your expression with: `parts[1].parse::().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:215:9 [INFO] [stdout] | [INFO] [stdout] 215 | / return Url { [INFO] [stdout] 216 | | path: path, [INFO] [stdout] 217 | | req_type: req_type, [INFO] [stdout] 218 | | query: query, [INFO] [stdout] 219 | | }; [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] 215 ~ Url { [INFO] [stdout] 216 + path: path, [INFO] [stdout] 217 + req_type: req_type, [INFO] [stdout] 218 + query: query, [INFO] [stdout] 219 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `query_string` after checking its variant with `is_some` [INFO] [stdout] --> src/src/structs.rs:246:48 [INFO] [stdout] | [INFO] [stdout] 245 | if query_string.is_some() { [INFO] [stdout] | ------------------------- help: try: `if let Some() = query_string` [INFO] [stdout] 246 | let query_string = query_string.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 `query_string` after checking its variant with `is_some` [INFO] [stdout] --> src/src/structs.rs:254:44 [INFO] [stdout] | [INFO] [stdout] 253 | if query_string.is_some() { [INFO] [stdout] | ------------------------- help: try: `if let Some() = query_string` [INFO] [stdout] 254 | let query_string = query_string.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: length comparison to zero [INFO] [stdout] --> src/src/request.rs:109:28 [INFO] [stdout] | [INFO] [stdout] 109 | if parts.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!parts.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/src/structs.rs:228:30 [INFO] [stdout] | [INFO] [stdout] 228 | let mut path: &str = &decode(parts[1]).unwrap_or_default().to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `decode(parts[1]).unwrap_or_default().as_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern reimplements `Result::unwrap_or` [INFO] [stdout] --> src/src/request.rs:113:48 [INFO] [stdout] | [INFO] [stdout] 113 | ... encoding.quality = match parts[1].parse::() { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 114 | | ... Ok(res) => res, [INFO] [stdout] 115 | | ... Err(err) => -1.0, [INFO] [stdout] 116 | | ... }; [INFO] [stdout] | |_______________________^ help: replace with: `parts[1].parse::().unwrap_or(-1.0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/src/structs.rs:235:12 [INFO] [stdout] | [INFO] [stdout] 235 | if path.contains("?") == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `path.contains("?")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/request.rs:129:20 [INFO] [stdout] | [INFO] [stdout] 129 | if parts.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!parts.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: equality checks against true are unnecessary [INFO] [stdout] --> src/src/structs.rs:240:37 [INFO] [stdout] | [INFO] [stdout] 240 | if parts.1.len() > 2 && parts.1.contains("=") == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `parts.1.contains("=")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:296:9 [INFO] [stdout] | [INFO] [stdout] 296 | return (true, params); [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] 296 - return (true, params); [INFO] [stdout] 296 + (true, params) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/structs.rs:266:25 [INFO] [stdout] | [INFO] [stdout] 266 | .filter(|a| a.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!a.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/src/request.rs:191:9 [INFO] [stdout] | [INFO] [stdout] 191 | return res; [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] 191 - return res; [INFO] [stdout] 191 + res [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/structs.rs:270:25 [INFO] [stdout] | [INFO] [stdout] 270 | .filter(|a| a.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!a.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/src/request.rs:166:12 [INFO] [stdout] | [INFO] [stdout] 166 | if self.body.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.body.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: called `unwrap` on `key_value` after checking its variant with `is_some` [INFO] [stdout] --> src/src/request.rs:229:37 [INFO] [stdout] | [INFO] [stdout] 228 | if key_value.is_some() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = key_value` [INFO] [stdout] 229 | let key_value = key_value.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/src/request.rs:310:9 [INFO] [stdout] | [INFO] [stdout] 310 | return Ok(true); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 310 - return Ok(true); [INFO] [stdout] 310 + Ok(true) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/src/request.rs:204:9 [INFO] [stdout] | [INFO] [stdout] 204 | / loop { [INFO] [stdout] 205 | | match bfreader.read(&mut buffer) { [INFO] [stdout] 206 | | Ok(size) => { [INFO] [stdout] 207 | | total_size += size; [INFO] [stdout] ... | [INFO] [stdout] 218 | | } [INFO] [stdout] | |_________^ help: try: `while let Ok(size) = bfreader.read(&mut buffer) { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/structs.rs:276:12 [INFO] [stdout] | [INFO] [stdout] 276 | if parts_input.len() == 0 && parts_pattern.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `parts_input.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/src/structs.rs:276:38 [INFO] [stdout] | [INFO] [stdout] 276 | if parts_input.len() == 0 && parts_pattern.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `parts_pattern.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: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/src/structs.rs:283:17 [INFO] [stdout] | [INFO] [stdout] 283 | parts_pattern[i].contains("[") == false && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!parts_pattern[i].contains("[")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/src/structs.rs:284:17 [INFO] [stdout] | [INFO] [stdout] 284 | parts_pattern[i].contains("]") == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!parts_pattern[i].contains("]")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:309:9 [INFO] [stdout] | [INFO] [stdout] 309 | / return Cookie { [INFO] [stdout] 310 | | name: name, [INFO] [stdout] 311 | | value: value, [INFO] [stdout] 312 | | path: "".to_string(), [INFO] [stdout] 313 | | expires: "".to_string(), [INFO] [stdout] 314 | | }; [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] 309 ~ Cookie { [INFO] [stdout] 310 + name: name, [INFO] [stdout] 311 + value: value, [INFO] [stdout] 312 + path: "".to_string(), [INFO] [stdout] 313 + expires: "".to_string(), [INFO] [stdout] 314 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/src/structs.rs:331:49 [INFO] [stdout] | [INFO] [stdout] 331 | pub fn generate_set_cookie_headers(cookies: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 331 - pub fn generate_set_cookie_headers(cookies: &Vec) -> String { [INFO] [stdout] 331 + pub fn generate_set_cookie_headers(cookies: &[Cookie]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/src/request.rs:246:24 [INFO] [stdout] | [INFO] [stdout] 246 | let boundary = (&self.boudary.clone().unwrap()).as_bytes().to_owned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.boudary.clone().unwrap()` [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: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:347:9 [INFO] [stdout] | [INFO] [stdout] 347 | / return Header { [INFO] [stdout] 348 | | name: name.to_owned(), [INFO] [stdout] 349 | | value: value.to_owned(), [INFO] [stdout] 350 | | }; [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] 347 ~ Header { [INFO] [stdout] 348 + name: name.to_owned(), [INFO] [stdout] 349 + value: value.to_owned(), [INFO] [stdout] 350 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/src/request.rs:316:9 [INFO] [stdout] | [INFO] [stdout] 316 | / loop { [INFO] [stdout] 317 | | match bfreader.read(&mut buffer) { [INFO] [stdout] 318 | | Ok(size) => { [INFO] [stdout] 319 | | total_size += size; [INFO] [stdout] ... | [INFO] [stdout] 328 | | } [INFO] [stdout] | |_________^ help: try: `while let Ok(size) = bfreader.read(&mut buffer) { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/structs.rs:359:12 [INFO] [stdout] | [INFO] [stdout] 359 | if headers.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `headers.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/src/response.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | / return Response { [INFO] [stdout] 21 | | stream: stream, [INFO] [stdout] 22 | | cookies: Vec::new(), [INFO] [stdout] 23 | | headers: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 26 | | status_code: ResponseCode::Ok, [INFO] [stdout] 27 | | }; [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] 20 ~ Response { [INFO] [stdout] 21 + stream: stream, [INFO] [stdout] 22 + cookies: Vec::new(), [INFO] [stdout] 23 + headers: Vec::new(), [INFO] [stdout] 24 + content_encoding: content_encoding.unwrap_or_default(), [INFO] [stdout] 25 + use_compression: false, [INFO] [stdout] 26 + status_code: ResponseCode::Ok, [INFO] [stdout] 27 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:397:9 [INFO] [stdout] | [INFO] [stdout] 397 | / return EndPoint { [INFO] [stdout] 398 | | path: path, [INFO] [stdout] 399 | | req_type: req_type, [INFO] [stdout] 400 | | handle: handle, [INFO] [stdout] 401 | | }; [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] 397 ~ EndPoint { [INFO] [stdout] 398 + path: path, [INFO] [stdout] 399 + req_type: req_type, [INFO] [stdout] 400 + handle: handle, [INFO] [stdout] 401 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/src/structs.rs:416:5 [INFO] [stdout] | [INFO] [stdout] 416 | / pub fn default() -> BodyItemInfo { [INFO] [stdout] 417 | | return BodyItemInfo { [INFO] [stdout] 418 | | content_type: ContentType::None, [INFO] [stdout] 419 | | name: None, [INFO] [stdout] ... | [INFO] [stdout] 422 | | }; [INFO] [stdout] 423 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:417:9 [INFO] [stdout] | [INFO] [stdout] 417 | / return BodyItemInfo { [INFO] [stdout] 418 | | content_type: ContentType::None, [INFO] [stdout] 419 | | name: None, [INFO] [stdout] 420 | | file_name: None, [INFO] [stdout] 421 | | value: None, [INFO] [stdout] 422 | | }; [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] 417 ~ BodyItemInfo { [INFO] [stdout] 418 + content_type: ContentType::None, [INFO] [stdout] 419 + name: None, [INFO] [stdout] 420 + file_name: None, [INFO] [stdout] 421 + value: None, [INFO] [stdout] 422 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/response.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | return compressed_data; [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] 72 - return compressed_data; [INFO] [stdout] 72 + compressed_data [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:425:9 [INFO] [stdout] | [INFO] [stdout] 425 | / return BodyItemInfo { [INFO] [stdout] 426 | | content_type: content_type, [INFO] [stdout] 427 | | name: None, [INFO] [stdout] 428 | | file_name: None, [INFO] [stdout] 429 | | value: None, [INFO] [stdout] 430 | | }; [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] 425 ~ BodyItemInfo { [INFO] [stdout] 426 + content_type: content_type, [INFO] [stdout] 427 + name: None, [INFO] [stdout] 428 + file_name: None, [INFO] [stdout] 429 + value: None, [INFO] [stdout] 430 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:433:9 [INFO] [stdout] | [INFO] [stdout] 433 | / return BodyItemInfo { [INFO] [stdout] 434 | | content_type: ContentType::UrlEncoded, [INFO] [stdout] 435 | | name: Some(name), [INFO] [stdout] 436 | | file_name: None, [INFO] [stdout] 437 | | value: Some(value), [INFO] [stdout] 438 | | }; [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] 433 ~ BodyItemInfo { [INFO] [stdout] 434 + content_type: ContentType::UrlEncoded, [INFO] [stdout] 435 + name: Some(name), [INFO] [stdout] 436 + file_name: None, [INFO] [stdout] 437 + value: Some(value), [INFO] [stdout] 438 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:441:9 [INFO] [stdout] | [INFO] [stdout] 441 | return BodyItem::new_url(self, self.value.clone().unwrap_or_default()); [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] 441 - return BodyItem::new_url(self, self.value.clone().unwrap_or_default()); [INFO] [stdout] 441 + BodyItem::new_url(self, self.value.clone().unwrap_or_default()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/src/structs.rs:443:5 [INFO] [stdout] | [INFO] [stdout] 443 | / pub fn from_str(input: &str) -> Result { [INFO] [stdout] 444 | | let lines: Vec<&str> = input.lines().collect(); [INFO] [stdout] 445 | | [INFO] [stdout] 446 | | let mut body_item = BodyItemInfo::default(); [INFO] [stdout] ... | [INFO] [stdout] 485 | | return Ok(body_item); [INFO] [stdout] 486 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/response.rs:87:9 [INFO] [stdout] | [INFO] [stdout] 87 | return data.to_vec(); [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] 87 - return data.to_vec(); [INFO] [stdout] 87 + data.to_vec() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/response.rs:75:12 [INFO] [stdout] | [INFO] [stdout] 75 | if self.content_encoding.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.content_encoding.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/src/response.rs:91:13 [INFO] [stdout] | [INFO] [stdout] 91 | return self.compress_data(data); [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] 91 - return self.compress_data(data); [INFO] [stdout] 91 + self.compress_data(data) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/response.rs:93:13 [INFO] [stdout] | [INFO] [stdout] 93 | return data.to_vec(); [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] 93 - return data.to_vec(); [INFO] [stdout] 93 + data.to_vec() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/src/response.rs:90:12 [INFO] [stdout] | [INFO] [stdout] 90 | if self.use_compression == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.use_compression` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:485:9 [INFO] [stdout] | [INFO] [stdout] 485 | return Ok(body_item); [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] 485 - return Ok(body_item); [INFO] [stdout] 485 + Ok(body_item) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/structs.rs:448:12 [INFO] [stdout] | [INFO] [stdout] 448 | if lines.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `lines.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/src/response.rs:102:25 [INFO] [stdout] | [INFO] [stdout] 102 | self.send_bytes(&data.as_bytes(), Some(ContentType::PlainText)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `data.as_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/src/response.rs:110:25 [INFO] [stdout] | [INFO] [stdout] 110 | self.send_bytes(&data.as_bytes(), Some(ContentType::Json)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `data.as_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/src/response.rs:118:44 [INFO] [stdout] | [INFO] [stdout] 118 | let content_type: ContentType = if !content_type.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `content_type.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `content_type` after checking its variant with `is_none` [INFO] [stdout] --> src/src/response.rs:119:13 [INFO] [stdout] | [INFO] [stdout] 118 | let content_type: ContentType = if !content_type.is_none() { [INFO] [stdout] | ---------------------- the check is happening here [INFO] [stdout] 119 | content_type.unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/src/structs.rs:479:12 [INFO] [stdout] | [INFO] [stdout] 479 | if name.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `name.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/src/structs.rs:496:9 [INFO] [stdout] | [INFO] [stdout] 496 | / return BodyItem { [INFO] [stdout] 497 | | info: info, [INFO] [stdout] 498 | | data: data, [INFO] [stdout] 499 | | value: "".to_owned(), [INFO] [stdout] 500 | | }; [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] 496 ~ BodyItem { [INFO] [stdout] 497 + info: info, [INFO] [stdout] 498 + data: data, [INFO] [stdout] 499 + value: "".to_owned(), [INFO] [stdout] 500 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:503:9 [INFO] [stdout] | [INFO] [stdout] 503 | / return BodyItem { [INFO] [stdout] 504 | | info: info, [INFO] [stdout] 505 | | data: &[], [INFO] [stdout] 506 | | value: value, [INFO] [stdout] 507 | | }; [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] 503 ~ BodyItem { [INFO] [stdout] 504 + info: info, [INFO] [stdout] 505 + data: &[], [INFO] [stdout] 506 + value: value, [INFO] [stdout] 507 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/src/response.rs:140:37 [INFO] [stdout] | [INFO] [stdout] 140 | match self.stream.write_all(&response.as_bytes()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `response.as_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/src/response.rs:159:44 [INFO] [stdout] | [INFO] [stdout] 159 | let content_type: ContentType = if !content_type.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `content_type.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `content_type` after checking its variant with `is_none` [INFO] [stdout] --> src/src/response.rs:160:13 [INFO] [stdout] | [INFO] [stdout] 159 | let content_type: ContentType = if !content_type.is_none() { [INFO] [stdout] | ---------------------- the check is happening here [INFO] [stdout] 160 | content_type.unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/src/response.rs:184:37 [INFO] [stdout] | [INFO] [stdout] 184 | match self.stream.write_all(&response.as_bytes()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `response.as_bytes()` [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: implementation of inherent method `to_string(&self) -> String` for type `src::structs::ResponseCode` [INFO] [stdout] --> src/src/structs.rs:569:5 [INFO] [stdout] | [INFO] [stdout] 569 | / pub fn to_string(&self) -> String { [INFO] [stdout] 570 | | self.as_u16().to_string() [INFO] [stdout] 571 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `src::structs::ResponseCode` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/src/utils/mod.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod utils; [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 `return` statement [INFO] [stdout] --> src/src/utils/utils.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | return input.contains("\t") || input.contains(" "); [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] 16 - return input.contains("\t") || input.contains(" "); [INFO] [stdout] 16 + input.contains("\t") || input.contains(" ") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `stream_size` after checking its variant with `is_some` [INFO] [stdout] --> src/src/response.rs:258:14 [INFO] [stdout] | [INFO] [stdout] 257 | let stream_size: i64 = if stream_size.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = stream_size` [INFO] [stdout] 258 | *stream_size.unwrap() as i64 [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/lib.rs:34:17 [INFO] [stdout] | [INFO] [stdout] 34 | middleware: Option< [INFO] [stdout] | _________________^ [INFO] [stdout] 35 | | fn(url: &Url, req: &Request, res: &mut Response, public_var: &Option) -> bool [INFO] [stdout] 36 | | >, [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: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:45:9 [INFO] [stdout] | [INFO] [stdout] 45 | / return Server { [INFO] [stdout] 46 | | active: false, [INFO] [stdout] 47 | | max_content_length: max_content_length.unwrap_or_default(), [INFO] [stdout] 48 | | endpoints: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 52 | | logger: None, [INFO] [stdout] 53 | | }; [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] 45 ~ Server { [INFO] [stdout] 46 + active: false, [INFO] [stdout] 47 + max_content_length: max_content_length.unwrap_or_default(), [INFO] [stdout] 48 + endpoints: Vec::new(), [INFO] [stdout] 49 + static_endpoints: HashMap::new(), [INFO] [stdout] 50 + public_var: public_var, [INFO] [stdout] 51 + middleware: None, [INFO] [stdout] 52 + logger: None, [INFO] [stdout] 53 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/lib.rs:75:12 [INFO] [stdout] | [INFO] [stdout] 75 | if self.active == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `self.active` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/lib.rs:80:12 [INFO] [stdout] | [INFO] [stdout] 80 | if path_.is_dir() == false || path_.exists() == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!path_.is_dir()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/lib.rs:80:39 [INFO] [stdout] | [INFO] [stdout] 80 | if path_.is_dir() == false || path_.exists() == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!path_.exists()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:87:14 [INFO] [stdout] | [INFO] [stdout] 87 | (self.endpoints.len() > 0 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.endpoints.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/lib.rs:89:14 [INFO] [stdout] | [INFO] [stdout] 89 | (self.static_endpoints.len() > 0 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.static_endpoints.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: needlessly taken reference of both operands [INFO] [stdout] --> src/lib.rs:90:54 [INFO] [stdout] | [INFO] [stdout] 90 | self.static_endpoints.iter().any(|x| &x.0.0 == &path)) [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] 90 - self.static_endpoints.iter().any(|x| &x.0.0 == &path)) [INFO] [stdout] 90 + self.static_endpoints.iter().any(|x| x.0.0 == path)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/lib.rs:110:12 [INFO] [stdout] | [INFO] [stdout] 110 | if self.active == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `self.active` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:115:14 [INFO] [stdout] | [INFO] [stdout] 115 | (self.endpoints.len() > 0 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.endpoints.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/lib.rs:117:14 [INFO] [stdout] | [INFO] [stdout] 117 | (self.static_endpoints.len() > 0 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.static_endpoints.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: needlessly taken reference of both operands [INFO] [stdout] --> src/lib.rs:118:54 [INFO] [stdout] | [INFO] [stdout] 118 | self.static_endpoints.iter().any(|x| &x.0.0 == &path)) [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] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 118 - self.static_endpoints.iter().any(|x| &x.0.0 == &path)) [INFO] [stdout] 118 + self.static_endpoints.iter().any(|x| x.0.0 == path)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/response.rs:352:9 [INFO] [stdout] | [INFO] [stdout] 352 | return &self.stream; [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] 352 - return &self.stream; [INFO] [stdout] 352 + &self.stream [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `src::structs::EncodingType` [INFO] [stdout] --> src/src/structs.rs:56:5 [INFO] [stdout] | [INFO] [stdout] 56 | / pub fn to_string(&self) -> String { [INFO] [stdout] 57 | | match self { [INFO] [stdout] 58 | | EncodingType::Gzip => "gzip".to_owned(), [INFO] [stdout] 59 | | EncodingType::Any => "*".to_owned(), [INFO] [stdout] ... | [INFO] [stdout] 62 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `src::structs::EncodingType` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:71:9 [INFO] [stdout] | [INFO] [stdout] 71 | / return Encoding { [INFO] [stdout] 72 | | encoding_type: encoding_type, [INFO] [stdout] 73 | | quality: quality, [INFO] [stdout] 74 | | }; [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] 71 ~ Encoding { [INFO] [stdout] 72 + encoding_type: encoding_type, [INFO] [stdout] 73 + quality: quality, [INFO] [stdout] 74 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/lib.rs:205:12 [INFO] [stdout] | [INFO] [stdout] 205 | if self.active == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `self.active` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:205:9 [INFO] [stdout] | [INFO] [stdout] 205 | return HttpServerError { reason: reason.to_string() }; [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] 205 - return HttpServerError { reason: reason.to_string() }; [INFO] [stdout] 205 + HttpServerError { reason: reason.to_string() } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:215:9 [INFO] [stdout] | [INFO] [stdout] 215 | / return Url { [INFO] [stdout] 216 | | path: path, [INFO] [stdout] 217 | | req_type: req_type, [INFO] [stdout] 218 | | query: query, [INFO] [stdout] 219 | | }; [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] 215 ~ Url { [INFO] [stdout] 216 + path: path, [INFO] [stdout] 217 + req_type: req_type, [INFO] [stdout] 218 + query: query, [INFO] [stdout] 219 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `query_string` after checking its variant with `is_some` [INFO] [stdout] --> src/src/structs.rs:246:48 [INFO] [stdout] | [INFO] [stdout] 245 | if query_string.is_some() { [INFO] [stdout] | ------------------------- help: try: `if let Some() = query_string` [INFO] [stdout] 246 | let query_string = query_string.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 `query_string` after checking its variant with `is_some` [INFO] [stdout] --> src/src/structs.rs:254:44 [INFO] [stdout] | [INFO] [stdout] 253 | if query_string.is_some() { [INFO] [stdout] | ------------------------- help: try: `if let Some() = query_string` [INFO] [stdout] 254 | let query_string = query_string.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: unnecessary use of `to_string` [INFO] [stdout] --> src/src/structs.rs:228:30 [INFO] [stdout] | [INFO] [stdout] 228 | let mut path: &str = &decode(parts[1]).unwrap_or_default().to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `decode(parts[1]).unwrap_or_default().as_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/src/structs.rs:235:12 [INFO] [stdout] | [INFO] [stdout] 235 | if path.contains("?") == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `path.contains("?")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/src/structs.rs:240:37 [INFO] [stdout] | [INFO] [stdout] 240 | if parts.1.len() > 2 && parts.1.contains("=") == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `parts.1.contains("=")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:296:9 [INFO] [stdout] | [INFO] [stdout] 296 | return (true, params); [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] 296 - return (true, params); [INFO] [stdout] 296 + (true, params) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/structs.rs:266:25 [INFO] [stdout] | [INFO] [stdout] 266 | .filter(|a| a.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!a.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/src/structs.rs:270:25 [INFO] [stdout] | [INFO] [stdout] 270 | .filter(|a| a.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!a.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/src/structs.rs:276:12 [INFO] [stdout] | [INFO] [stdout] 276 | if parts_input.len() == 0 && parts_pattern.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `parts_input.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/src/structs.rs:276:38 [INFO] [stdout] | [INFO] [stdout] 276 | if parts_input.len() == 0 && parts_pattern.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `parts_pattern.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: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/src/structs.rs:283:17 [INFO] [stdout] | [INFO] [stdout] 283 | parts_pattern[i].contains("[") == false && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!parts_pattern[i].contains("[")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/src/structs.rs:284:17 [INFO] [stdout] | [INFO] [stdout] 284 | parts_pattern[i].contains("]") == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!parts_pattern[i].contains("]")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:309:9 [INFO] [stdout] | [INFO] [stdout] 309 | / return Cookie { [INFO] [stdout] 310 | | name: name, [INFO] [stdout] 311 | | value: value, [INFO] [stdout] 312 | | path: "".to_string(), [INFO] [stdout] 313 | | expires: "".to_string(), [INFO] [stdout] 314 | | }; [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] 309 ~ Cookie { [INFO] [stdout] 310 + name: name, [INFO] [stdout] 311 + value: value, [INFO] [stdout] 312 + path: "".to_string(), [INFO] [stdout] 313 + expires: "".to_string(), [INFO] [stdout] 314 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/src/structs.rs:331:49 [INFO] [stdout] | [INFO] [stdout] 331 | pub fn generate_set_cookie_headers(cookies: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 331 - pub fn generate_set_cookie_headers(cookies: &Vec) -> String { [INFO] [stdout] 331 + pub fn generate_set_cookie_headers(cookies: &[Cookie]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:347:9 [INFO] [stdout] | [INFO] [stdout] 347 | / return Header { [INFO] [stdout] 348 | | name: name.to_owned(), [INFO] [stdout] 349 | | value: value.to_owned(), [INFO] [stdout] 350 | | }; [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] 347 ~ Header { [INFO] [stdout] 348 + name: name.to_owned(), [INFO] [stdout] 349 + value: value.to_owned(), [INFO] [stdout] 350 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/structs.rs:359:12 [INFO] [stdout] | [INFO] [stdout] 359 | if headers.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `headers.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/src/structs.rs:397:9 [INFO] [stdout] | [INFO] [stdout] 397 | / return EndPoint { [INFO] [stdout] 398 | | path: path, [INFO] [stdout] 399 | | req_type: req_type, [INFO] [stdout] 400 | | handle: handle, [INFO] [stdout] 401 | | }; [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] 397 ~ EndPoint { [INFO] [stdout] 398 + path: path, [INFO] [stdout] 399 + req_type: req_type, [INFO] [stdout] 400 + handle: handle, [INFO] [stdout] 401 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/src/structs.rs:416:5 [INFO] [stdout] | [INFO] [stdout] 416 | / pub fn default() -> BodyItemInfo { [INFO] [stdout] 417 | | return BodyItemInfo { [INFO] [stdout] 418 | | content_type: ContentType::None, [INFO] [stdout] 419 | | name: None, [INFO] [stdout] ... | [INFO] [stdout] 422 | | }; [INFO] [stdout] 423 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:417:9 [INFO] [stdout] | [INFO] [stdout] 417 | / return BodyItemInfo { [INFO] [stdout] 418 | | content_type: ContentType::None, [INFO] [stdout] 419 | | name: None, [INFO] [stdout] 420 | | file_name: None, [INFO] [stdout] 421 | | value: None, [INFO] [stdout] 422 | | }; [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] 417 ~ BodyItemInfo { [INFO] [stdout] 418 + content_type: ContentType::None, [INFO] [stdout] 419 + name: None, [INFO] [stdout] 420 + file_name: None, [INFO] [stdout] 421 + value: None, [INFO] [stdout] 422 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:425:9 [INFO] [stdout] | [INFO] [stdout] 425 | / return BodyItemInfo { [INFO] [stdout] 426 | | content_type: content_type, [INFO] [stdout] 427 | | name: None, [INFO] [stdout] 428 | | file_name: None, [INFO] [stdout] 429 | | value: None, [INFO] [stdout] 430 | | }; [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] 425 ~ BodyItemInfo { [INFO] [stdout] 426 + content_type: content_type, [INFO] [stdout] 427 + name: None, [INFO] [stdout] 428 + file_name: None, [INFO] [stdout] 429 + value: None, [INFO] [stdout] 430 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:433:9 [INFO] [stdout] | [INFO] [stdout] 433 | / return BodyItemInfo { [INFO] [stdout] 434 | | content_type: ContentType::UrlEncoded, [INFO] [stdout] 435 | | name: Some(name), [INFO] [stdout] 436 | | file_name: None, [INFO] [stdout] 437 | | value: Some(value), [INFO] [stdout] 438 | | }; [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] 433 ~ BodyItemInfo { [INFO] [stdout] 434 + content_type: ContentType::UrlEncoded, [INFO] [stdout] 435 + name: Some(name), [INFO] [stdout] 436 + file_name: None, [INFO] [stdout] 437 + value: Some(value), [INFO] [stdout] 438 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:441:9 [INFO] [stdout] | [INFO] [stdout] 441 | return BodyItem::new_url(self, self.value.clone().unwrap_or_default()); [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] 441 - return BodyItem::new_url(self, self.value.clone().unwrap_or_default()); [INFO] [stdout] 441 + BodyItem::new_url(self, self.value.clone().unwrap_or_default()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option) -> bool>` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:214:26 [INFO] [stdout] | [INFO] [stdout] 214 | let middleware = self.middleware.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.middleware` [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 `usize` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:217:34 [INFO] [stdout] | [INFO] [stdout] 217 | let max_content_length = self.max_content_length.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.max_content_length` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:230:48 [INFO] [stdout] | [INFO] [stdout] 230 | let max_content_length_clone = max_content_length.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `max_content_length` [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: called `unwrap_err` on `res` after checking its variant with `is_err` [INFO] [stdout] --> src/lib.rs:245:33 [INFO] [stdout] | [INFO] [stdout] 244 | if res.is_err() { [INFO] [stdout] | --------------- help: try: `if let Err() = res` [INFO] [stdout] 245 | logger(&res.unwrap_err()); [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: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/src/structs.rs:443:5 [INFO] [stdout] | [INFO] [stdout] 443 | / pub fn from_str(input: &str) -> Result { [INFO] [stdout] 444 | | let lines: Vec<&str> = input.lines().collect(); [INFO] [stdout] 445 | | [INFO] [stdout] 446 | | let mut body_item = BodyItemInfo::default(); [INFO] [stdout] ... | [INFO] [stdout] 485 | | return Ok(body_item); [INFO] [stdout] 486 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/lib.rs:260:21 [INFO] [stdout] | [INFO] [stdout] 260 | middleware: Option< [INFO] [stdout] | _____________________^ [INFO] [stdout] 261 | | fn(url: &Url, req: &Request, res: &mut Response, public_var: &Option) -> bool [INFO] [stdout] 262 | | >, [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 `middleware` after checking its variant with `is_some` [INFO] [stdout] --> src/lib.rs:327:26 [INFO] [stdout] | [INFO] [stdout] 326 | if middleware.is_some() { [INFO] [stdout] | ----------------------- help: try: `if let Some() = middleware` [INFO] [stdout] 327 | let result = middleware.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 `metadata` after checking its variant with `is_ok` [INFO] [stdout] --> src/lib.rs:401:45 [INFO] [stdout] | [INFO] [stdout] 400 | ... if metadata.is_ok() { [INFO] [stdout] | ------------------- help: try: `if let Ok() = metadata` [INFO] [stdout] 401 | ... size = Some(metadata.unwrap().len()); [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: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:434:9 [INFO] [stdout] | [INFO] [stdout] 434 | return Ok(()); [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] 434 - return Ok(()); [INFO] [stdout] 434 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:293:12 [INFO] [stdout] | [INFO] [stdout] 293 | if lines.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `lines.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: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/lib.rs:300:9 [INFO] [stdout] | [INFO] [stdout] 300 | if let Some(socket) = stream.peer_addr().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(socket)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 300 - if let Some(socket) = stream.peer_addr().ok() { [INFO] [stdout] 300 + if let Ok(socket) = stream.peer_addr() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:485:9 [INFO] [stdout] | [INFO] [stdout] 485 | return Ok(body_item); [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] 485 - return Ok(body_item); [INFO] [stdout] 485 + Ok(body_item) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/lib.rs:337:16 [INFO] [stdout] | [INFO] [stdout] 337 | if result == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `!result` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/src/structs.rs:448:12 [INFO] [stdout] | [INFO] [stdout] 448 | if lines.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `lines.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: equality checks against true are unnecessary [INFO] [stdout] --> src/lib.rs:347:16 [INFO] [stdout] | [INFO] [stdout] 347 | if match_pattern.0 == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `match_pattern.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:355:12 [INFO] [stdout] | [INFO] [stdout] 355 | if matching_routes.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!matching_routes.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/lib.rs:361:16 [INFO] [stdout] | [INFO] [stdout] 361 | if routes.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `routes.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/lib.rs:386:20 [INFO] [stdout] | [INFO] [stdout] 386 | if parts.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `parts.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/src/structs.rs:479:12 [INFO] [stdout] | [INFO] [stdout] 479 | if name.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `name.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/src/structs.rs:496:9 [INFO] [stdout] | [INFO] [stdout] 496 | / return BodyItem { [INFO] [stdout] 497 | | info: info, [INFO] [stdout] 498 | | data: data, [INFO] [stdout] 499 | | value: "".to_owned(), [INFO] [stdout] 500 | | }; [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] 496 ~ BodyItem { [INFO] [stdout] 497 + info: info, [INFO] [stdout] 498 + data: data, [INFO] [stdout] 499 + value: "".to_owned(), [INFO] [stdout] 500 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/lib.rs:430:12 [INFO] [stdout] | [INFO] [stdout] 430 | if sent == false { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `!sent` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/lib.rs:445:52 [INFO] [stdout] | [INFO] [stdout] 445 | fn order_routes(routes: &mut Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 445 - fn order_routes(routes: &mut Vec>) { [INFO] [stdout] 445 + fn order_routes(routes: &mut [EndPoint]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:461:9 [INFO] [stdout] | [INFO] [stdout] 461 | return Ordering::Equal; [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] 461 - return Ordering::Equal; [INFO] [stdout] 461 + Ordering::Equal [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/src/structs.rs:503:9 [INFO] [stdout] | [INFO] [stdout] 503 | / return BodyItem { [INFO] [stdout] 504 | | info: info, [INFO] [stdout] 505 | | data: &[], [INFO] [stdout] 506 | | value: value, [INFO] [stdout] 507 | | }; [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] 503 ~ BodyItem { [INFO] [stdout] 504 + info: info, [INFO] [stdout] 505 + data: &[], [INFO] [stdout] 506 + value: value, [INFO] [stdout] 507 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `src::structs::ResponseCode` [INFO] [stdout] --> src/src/structs.rs:569:5 [INFO] [stdout] | [INFO] [stdout] 569 | / pub fn to_string(&self) -> String { [INFO] [stdout] 570 | | self.as_u16().to_string() [INFO] [stdout] 571 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `src::structs::ResponseCode` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/src/utils/mod.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod utils; [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 `return` statement [INFO] [stdout] --> src/src/utils/utils.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | return input.contains("\t") || input.contains(" "); [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] 16 - return input.contains("\t") || input.contains(" "); [INFO] [stdout] 16 + input.contains("\t") || input.contains(" ") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/lib.rs:34:17 [INFO] [stdout] | [INFO] [stdout] 34 | middleware: Option< [INFO] [stdout] | _________________^ [INFO] [stdout] 35 | | fn(url: &Url, req: &Request, res: &mut Response, public_var: &Option) -> bool [INFO] [stdout] 36 | | >, [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: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:45:9 [INFO] [stdout] | [INFO] [stdout] 45 | / return Server { [INFO] [stdout] 46 | | active: false, [INFO] [stdout] 47 | | max_content_length: max_content_length.unwrap_or_default(), [INFO] [stdout] 48 | | endpoints: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 52 | | logger: None, [INFO] [stdout] 53 | | }; [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] 45 ~ Server { [INFO] [stdout] 46 + active: false, [INFO] [stdout] 47 + max_content_length: max_content_length.unwrap_or_default(), [INFO] [stdout] 48 + endpoints: Vec::new(), [INFO] [stdout] 49 + static_endpoints: HashMap::new(), [INFO] [stdout] 50 + public_var: public_var, [INFO] [stdout] 51 + middleware: None, [INFO] [stdout] 52 + logger: None, [INFO] [stdout] 53 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/lib.rs:75:12 [INFO] [stdout] | [INFO] [stdout] 75 | if self.active == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `self.active` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/lib.rs:80:12 [INFO] [stdout] | [INFO] [stdout] 80 | if path_.is_dir() == false || path_.exists() == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!path_.is_dir()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/lib.rs:80:39 [INFO] [stdout] | [INFO] [stdout] 80 | if path_.is_dir() == false || path_.exists() == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!path_.exists()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:87:14 [INFO] [stdout] | [INFO] [stdout] 87 | (self.endpoints.len() > 0 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.endpoints.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/lib.rs:89:14 [INFO] [stdout] | [INFO] [stdout] 89 | (self.static_endpoints.len() > 0 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.static_endpoints.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: needlessly taken reference of both operands [INFO] [stdout] --> src/lib.rs:90:54 [INFO] [stdout] | [INFO] [stdout] 90 | self.static_endpoints.iter().any(|x| &x.0.0 == &path)) [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] 90 - self.static_endpoints.iter().any(|x| &x.0.0 == &path)) [INFO] [stdout] 90 + self.static_endpoints.iter().any(|x| x.0.0 == path)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/src/request.rs:165:17 [INFO] [stdout] | [INFO] [stdout] 165 | pub fn body(&self) -> Vec { [INFO] [stdout] | ^^^^^ ^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 165 | pub fn body(&self) -> Vec> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/lib.rs:110:12 [INFO] [stdout] | [INFO] [stdout] 110 | if self.active == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `self.active` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:115:14 [INFO] [stdout] | [INFO] [stdout] 115 | (self.endpoints.len() > 0 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.endpoints.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/lib.rs:117:14 [INFO] [stdout] | [INFO] [stdout] 117 | (self.static_endpoints.len() > 0 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.static_endpoints.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: needlessly taken reference of both operands [INFO] [stdout] --> src/lib.rs:118:54 [INFO] [stdout] | [INFO] [stdout] 118 | self.static_endpoints.iter().any(|x| &x.0.0 == &path)) [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] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 118 - self.static_endpoints.iter().any(|x| &x.0.0 == &path)) [INFO] [stdout] 118 + self.static_endpoints.iter().any(|x| x.0.0 == path)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/lib.rs:205:12 [INFO] [stdout] | [INFO] [stdout] 205 | if self.active == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `self.active` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option) -> bool>` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:214:26 [INFO] [stdout] | [INFO] [stdout] 214 | let middleware = self.middleware.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.middleware` [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 `usize` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:217:34 [INFO] [stdout] | [INFO] [stdout] 217 | let max_content_length = self.max_content_length.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.max_content_length` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:230:48 [INFO] [stdout] | [INFO] [stdout] 230 | let max_content_length_clone = max_content_length.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `max_content_length` [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: called `unwrap_err` on `res` after checking its variant with `is_err` [INFO] [stdout] --> src/lib.rs:245:33 [INFO] [stdout] | [INFO] [stdout] 244 | if res.is_err() { [INFO] [stdout] | --------------- help: try: `if let Err() = res` [INFO] [stdout] 245 | logger(&res.unwrap_err()); [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/lib.rs:260:21 [INFO] [stdout] | [INFO] [stdout] 260 | middleware: Option< [INFO] [stdout] | _____________________^ [INFO] [stdout] 261 | | fn(url: &Url, req: &Request, res: &mut Response, public_var: &Option) -> bool [INFO] [stdout] 262 | | >, [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 `middleware` after checking its variant with `is_some` [INFO] [stdout] --> src/lib.rs:327:26 [INFO] [stdout] | [INFO] [stdout] 326 | if middleware.is_some() { [INFO] [stdout] | ----------------------- help: try: `if let Some() = middleware` [INFO] [stdout] 327 | let result = middleware.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 `metadata` after checking its variant with `is_ok` [INFO] [stdout] --> src/lib.rs:401:45 [INFO] [stdout] | [INFO] [stdout] 400 | ... if metadata.is_ok() { [INFO] [stdout] | ------------------- help: try: `if let Ok() = metadata` [INFO] [stdout] 401 | ... size = Some(metadata.unwrap().len()); [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: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:434:9 [INFO] [stdout] | [INFO] [stdout] 434 | return Ok(()); [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] 434 - return Ok(()); [INFO] [stdout] 434 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:293:12 [INFO] [stdout] | [INFO] [stdout] 293 | if lines.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `lines.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: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/lib.rs:300:9 [INFO] [stdout] | [INFO] [stdout] 300 | if let Some(socket) = stream.peer_addr().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(socket)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 300 - if let Some(socket) = stream.peer_addr().ok() { [INFO] [stdout] 300 + if let Ok(socket) = stream.peer_addr() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/src/structs.rs:440:25 [INFO] [stdout] | [INFO] [stdout] 440 | pub fn to_body_item(&self) -> BodyItem { [INFO] [stdout] | ^^^^^ ^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 440 | pub fn to_body_item(&self) -> BodyItem<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/lib.rs:337:16 [INFO] [stdout] | [INFO] [stdout] 337 | if result == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `!result` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/lib.rs:347:16 [INFO] [stdout] | [INFO] [stdout] 347 | if match_pattern.0 == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `match_pattern.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:355:12 [INFO] [stdout] | [INFO] [stdout] 355 | if matching_routes.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!matching_routes.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/lib.rs:361:16 [INFO] [stdout] | [INFO] [stdout] 361 | if routes.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `routes.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/lib.rs:386:20 [INFO] [stdout] | [INFO] [stdout] 386 | if parts.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `parts.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: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/lib.rs:430:12 [INFO] [stdout] | [INFO] [stdout] 430 | if sent == false { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `!sent` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/lib.rs:445:52 [INFO] [stdout] | [INFO] [stdout] 445 | fn order_routes(routes: &mut Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 445 - fn order_routes(routes: &mut Vec>) { [INFO] [stdout] 445 + fn order_routes(routes: &mut [EndPoint]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:461:9 [INFO] [stdout] | [INFO] [stdout] 461 | return Ordering::Equal; [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] 461 - return Ordering::Equal; [INFO] [stdout] 461 + Ordering::Equal [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/src/request.rs:165:17 [INFO] [stdout] | [INFO] [stdout] 165 | pub fn body(&self) -> Vec { [INFO] [stdout] | ^^^^^ ^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 165 | pub fn body(&self) -> Vec> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/src/structs.rs:440:25 [INFO] [stdout] | [INFO] [stdout] 440 | pub fn to_body_item(&self) -> BodyItem { [INFO] [stdout] | ^^^^^ ^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 440 | pub fn to_body_item(&self) -> BodyItem<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `self` [INFO] [stdout] --> src/main.rs:1:16 [INFO] [stdout] | [INFO] [stdout] 1 | use std::fs::{ self, File }; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `SeekFrom`, `Seek`, and `Write` [INFO] [stdout] --> src/main.rs:2:33 [INFO] [stdout] | [INFO] [stdout] 2 | use std::io::{ BufReader, Read, Seek, SeekFrom, Write }; [INFO] [stdout] | ^^^^ ^^^^^^^^ ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Header` [INFO] [stdout] --> src/main.rs:6:41 [INFO] [stdout] | [INFO] [stdout] 6 | use choki::src::structs::{ ContentType, Header, HttpServerError, RequestType, ResponseCode, Url }; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:47:28 [INFO] [stdout] | [INFO] [stdout] 47 | .get("/filetest", |mut req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:55:17 [INFO] [stdout] | [INFO] [stdout] 55 | let mut file = File::open("./tests/static/index.html").unwrap(); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `req` [INFO] [stdout] --> src/main.rs:54:20 [INFO] [stdout] | [INFO] [stdout] 54 | .get("/", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_req` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:54:53 [INFO] [stdout] | [INFO] [stdout] 54 | .get("/", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `size` [INFO] [stdout] --> src/main.rs:56:17 [INFO] [stdout] | [INFO] [stdout] 56 | let size = file.metadata().unwrap().len(); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_size` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `req` [INFO] [stdout] --> src/main.rs:47:28 [INFO] [stdout] | [INFO] [stdout] 47 | .get("/filetest", |mut req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_req` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:47:65 [INFO] [stdout] | [INFO] [stdout] 47 | .get("/filetest", |mut req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:40:62 [INFO] [stdout] | [INFO] [stdout] 40 | .post("/filetest", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `body` [INFO] [stdout] --> src/main.rs:42:17 [INFO] [stdout] | [INFO] [stdout] 42 | let body: Vec> = req.body(); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_body` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `req` [INFO] [stdout] --> src/main.rs:35:24 [INFO] [stdout] | [INFO] [stdout] 35 | .get("/test", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_req` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:35:57 [INFO] [stdout] | [INFO] [stdout] 35 | .get("/test", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `req` [INFO] [stdout] --> src/main.rs:30:30 [INFO] [stdout] | [INFO] [stdout] 30 | .get("/watch/[id]", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_req` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:30:63 [INFO] [stdout] | [INFO] [stdout] 30 | .get("/watch/[id]", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `req` [INFO] [stdout] --> src/main.rs:23:14 [INFO] [stdout] | [INFO] [stdout] 23 | |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_req` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:23:47 [INFO] [stdout] | [INFO] [stdout] 23 | |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `url` [INFO] [stdout] --> src/main.rs:12:28 [INFO] [stdout] | [INFO] [stdout] 12 | server.use_middleware(|url: &Url, req: &Request, res: &mut Response, public_var: &Option| { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_url` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `res` [INFO] [stdout] --> src/main.rs:12:54 [INFO] [stdout] | [INFO] [stdout] 12 | server.use_middleware(|url: &Url, req: &Request, res: &mut Response, public_var: &Option| { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_res` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:12:74 [INFO] [stdout] | [INFO] [stdout] 12 | server.use_middleware(|url: &Url, req: &Request, res: &mut Response, public_var: &Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 14 - return true; [INFO] [stdout] 14 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `self` [INFO] [stdout] --> src/main.rs:1:16 [INFO] [stdout] | [INFO] [stdout] 1 | use std::fs::{ self, File }; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `SeekFrom`, `Seek`, and `Write` [INFO] [stdout] --> src/main.rs:2:33 [INFO] [stdout] | [INFO] [stdout] 2 | use std::io::{ BufReader, Read, Seek, SeekFrom, Write }; [INFO] [stdout] | ^^^^ ^^^^^^^^ ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Header` [INFO] [stdout] --> src/main.rs:6:41 [INFO] [stdout] | [INFO] [stdout] 6 | use choki::src::structs::{ ContentType, Header, HttpServerError, RequestType, ResponseCode, Url }; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:47:28 [INFO] [stdout] | [INFO] [stdout] 47 | .get("/filetest", |mut req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:55:17 [INFO] [stdout] | [INFO] [stdout] 55 | let mut file = File::open("./tests/static/index.html").unwrap(); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `req` [INFO] [stdout] --> src/main.rs:54:20 [INFO] [stdout] | [INFO] [stdout] 54 | .get("/", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_req` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:54:53 [INFO] [stdout] | [INFO] [stdout] 54 | .get("/", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `size` [INFO] [stdout] --> src/main.rs:56:17 [INFO] [stdout] | [INFO] [stdout] 56 | let size = file.metadata().unwrap().len(); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_size` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `req` [INFO] [stdout] --> src/main.rs:47:28 [INFO] [stdout] | [INFO] [stdout] 47 | .get("/filetest", |mut req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_req` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:47:65 [INFO] [stdout] | [INFO] [stdout] 47 | .get("/filetest", |mut req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:40:62 [INFO] [stdout] | [INFO] [stdout] 40 | .post("/filetest", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `body` [INFO] [stdout] --> src/main.rs:42:17 [INFO] [stdout] | [INFO] [stdout] 42 | let body: Vec> = req.body(); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_body` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `req` [INFO] [stdout] --> src/main.rs:35:24 [INFO] [stdout] | [INFO] [stdout] 35 | .get("/test", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_req` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:35:57 [INFO] [stdout] | [INFO] [stdout] 35 | .get("/test", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `req` [INFO] [stdout] --> src/main.rs:30:30 [INFO] [stdout] | [INFO] [stdout] 30 | .get("/watch/[id]", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_req` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:30:63 [INFO] [stdout] | [INFO] [stdout] 30 | .get("/watch/[id]", |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `req` [INFO] [stdout] --> src/main.rs:23:14 [INFO] [stdout] | [INFO] [stdout] 23 | |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_req` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:23:47 [INFO] [stdout] | [INFO] [stdout] 23 | |req: Request, mut res: Response, public_var: Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `url` [INFO] [stdout] --> src/main.rs:12:28 [INFO] [stdout] | [INFO] [stdout] 12 | server.use_middleware(|url: &Url, req: &Request, res: &mut Response, public_var: &Option| { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_url` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `res` [INFO] [stdout] --> src/main.rs:12:54 [INFO] [stdout] | [INFO] [stdout] 12 | server.use_middleware(|url: &Url, req: &Request, res: &mut Response, public_var: &Option| { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_res` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `public_var` [INFO] [stdout] --> src/main.rs:12:74 [INFO] [stdout] | [INFO] [stdout] 12 | server.use_middleware(|url: &Url, req: &Request, res: &mut Response, public_var: &Option| { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_public_var` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 14 - return true; [INFO] [stdout] 14 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.87s [INFO] running `Command { std: "docker" "inspect" "43f9f4f3a182f8cc0b0cd1b0250115664366fe9a8690beacb4a3006466a57e0b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "43f9f4f3a182f8cc0b0cd1b0250115664366fe9a8690beacb4a3006466a57e0b", kill_on_drop: false }` [INFO] [stdout] 43f9f4f3a182f8cc0b0cd1b0250115664366fe9a8690beacb4a3006466a57e0b