[INFO] fetching crate rsmtp 0.1.3... [INFO] linting rsmtp-0.1.3 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate rsmtp 0.1.3 into /workspace/builds/worker-7-tc1/source [INFO] started tweaking crates.io crate rsmtp 0.1.3 [INFO] finished tweaking crates.io crate rsmtp 0.1.3 [INFO] tweaked toml for crates.io crate rsmtp 0.1.3 written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate rsmtp 0.1.3 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 rsmtp 0.1.3 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] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 332271b01dbf600e43d9e55fbf5a7a20368200d0bd5945da56d7b19c5ab40d45 [INFO] running `Command { std: "docker" "start" "-a" "332271b01dbf600e43d9e55fbf5a7a20368200d0bd5945da56d7b19c5ab40d45", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "332271b01dbf600e43d9e55fbf5a7a20368200d0bd5945da56d7b19c5ab40d45", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "332271b01dbf600e43d9e55fbf5a7a20368200d0bd5945da56d7b19c5ab40d45", kill_on_drop: false }` [INFO] [stdout] 332271b01dbf600e43d9e55fbf5a7a20368200d0bd5945da56d7b19c5ab40d45 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 373613fac05e89dfe6e5ee6a26ea33438f34cc8260789769b91e657628cb865c [INFO] running `Command { std: "docker" "start" "-a" "373613fac05e89dfe6e5ee6a26ea33438f34cc8260789769b91e657628cb865c", kill_on_drop: false }` [INFO] [stderr] Checking rsmtp v0.1.3 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/common/mailbox.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 218 | local_part: local_part, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `local_part` [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/common/mailbox.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 218 | local_part: local_part, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `local_part` [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/common/mailbox.rs:219:17 [INFO] [stdout] | [INFO] [stdout] 219 | foreign_part: foreign_part, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `foreign_part` [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/common/mailbox.rs:219:17 [INFO] [stdout] | [INFO] [stdout] 219 | foreign_part: foreign_part, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `foreign_part` [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/common/stream.rs:112:13 [INFO] [stdout] | [INFO] [stdout] 112 | max_line_size: max_line_size, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `max_line_size` [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/common/stream.rs:117:13 [INFO] [stdout] | [INFO] [stdout] 117 | debug: debug, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `debug` [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/common/stream.rs:224:13 [INFO] [stdout] | [INFO] [stdout] 224 | debug: debug, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `debug` [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::error::Error` [INFO] [stdout] --> src/common/stream.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | use std::error::Error; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/common/stream.rs:112:13 [INFO] [stdout] | [INFO] [stdout] 112 | max_line_size: max_line_size, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `max_line_size` [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/common/stream.rs:117:13 [INFO] [stdout] | [INFO] [stdout] 117 | debug: debug, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `debug` [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/common/stream.rs:224:13 [INFO] [stdout] | [INFO] [stdout] 224 | debug: debug, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `debug` [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/server/mod.rs:159:13 [INFO] [stdout] | [INFO] [stdout] 159 | callback: callback, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `callback` [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/server/mod.rs:253:13 [INFO] [stdout] | [INFO] [stdout] 253 | container: container, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `container` [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/server/mod.rs:159:13 [INFO] [stdout] | [INFO] [stdout] 159 | callback: callback, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `callback` [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/server/mod.rs:253:13 [INFO] [stdout] | [INFO] [stdout] 253 | container: container, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `container` [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: method `ready` is never used [INFO] [stdout] --> src/server/mod.rs:175:8 [INFO] [stdout] | [INFO] [stdout] 134 | impl Command { [INFO] [stdout] | ---------------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 175 | fn ready(&self) -> bool { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `set_hostname`, `set_max_recipients`, `set_max_message_size`, `increase_max_command_line_size`, and `increase_max_text_line_size` are never used [INFO] [stdout] --> src/server/mod.rs:257:8 [INFO] [stdout] | [INFO] [stdout] 236 | impl Server { [INFO] [stdout] | -------------------------------------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 257 | fn set_hostname(&mut self, hostname: &str) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 261 | fn set_max_recipients(&mut self, max: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 268 | fn set_max_message_size(&mut self, max: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 283 | fn increase_max_command_line_size(&mut self, bytes: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 287 | fn increase_max_text_line_size(&mut self, bytes: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `index` is used as a loop counter [INFO] [stdout] --> src/common/stream.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | for byte in buf.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (index, byte) in buf.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/common/stream.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | / match self.last_crlf { [INFO] [stdout] 126 | | Some(p) => { [INFO] [stdout] ... | [INFO] [stdout] 132 | | _ => {} [INFO] [stdout] 133 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 125 ~ if let Some(p) = self.last_crlf { [INFO] [stdout] 126 + // TODO: This could probably be optimised by shifting bytes instead [INFO] [stdout] 127 + // of re-allocating. [INFO] [stdout] 128 + self.buf = self.buf[p + 2..].to_vec(); [INFO] [stdout] 129 + self.buf.reserve(self.max_line_size); [INFO] [stdout] 130 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:203:69 [INFO] [stdout] | [INFO] [stdout] 203 | println!("rsmtp: imsg: {}", String::from_utf8_lossy(bytes.as_ref())); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `bytes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] = note: `#[warn(clippy::useless_asref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common/utils.rs:31:8 [INFO] [stdout] | [INFO] [stdout] 31 | if s.len() > 0 && is_alnum(s.chars().nth(0).unwrap()) { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/common/utils.rs:31:32 [INFO] [stdout] | [INFO] [stdout] 31 | if s.len() > 0 && is_alnum(s.chars().nth(0).unwrap()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `s.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/common/utils.rs:198:5 [INFO] [stdout] | [INFO] [stdout] 198 | / match c { [INFO] [stdout] 199 | | '!' | '#' | '$' | '%' | '&' | '\'' | '*' | '+' | '-' | '/' | '=' | '?' | '^' | '_' [INFO] [stdout] 200 | | | '`' | '{' | '|' | '}' | '~' => true, [INFO] [stdout] 201 | | 'A'..='Z' => true, [INFO] [stdout] ... | [INFO] [stdout] 204 | | _ => false, [INFO] [stdout] 205 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 198 ~ matches!(c, '!' | '#' | '$' | '%' | '&' | '\'' | '*' | '+' | '-' | '/' | '=' | '?' | '^' | '_' [INFO] [stdout] 199 + | '`' | '{' | '|' | '}' | '~' | 'A'..='Z' | 'a'..='z' | '0'..='9') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/common/utils.rs:266:5 [INFO] [stdout] | [INFO] [stdout] 266 | / match c { [INFO] [stdout] 267 | | 'A'..='Z' | 'a'..='z' | '0'..='9' => true, [INFO] [stdout] 268 | | _ => false, [INFO] [stdout] 269 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 266 - match c { [INFO] [stdout] 267 - 'A'..='Z' | 'a'..='z' | '0'..='9' => true, [INFO] [stdout] 268 - _ => false, [INFO] [stdout] 269 - } [INFO] [stdout] 266 + matches!(c, 'A'..='Z' | 'a'..='z' | '0'..='9') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/common/utils.rs:299:19 [INFO] [stdout] | [INFO] [stdout] 299 | if sl >= 2 && s.chars().nth(0).unwrap() == '"' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `s.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/common/utils.rs:351:5 [INFO] [stdout] | [INFO] [stdout] 351 | / match c as isize { [INFO] [stdout] 352 | | 32..=33 | 35..=91 | 93..=126 => true, [INFO] [stdout] 353 | | _ => false, [INFO] [stdout] 354 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 351 - match c as isize { [INFO] [stdout] 352 - 32..=33 | 35..=91 | 93..=126 => true, [INFO] [stdout] 353 - _ => false, [INFO] [stdout] 354 - } [INFO] [stdout] 351 + matches!(c as isize, 32..=33 | 35..=91 | 93..=126) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/common/utils.rs:396:23 [INFO] [stdout] | [INFO] [stdout] 396 | if s.len() > 1 && s.chars().nth(0).unwrap() == '@' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `s.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/common/utils.rs:425:5 [INFO] [stdout] | [INFO] [stdout] 425 | / loop { [INFO] [stdout] 426 | | // Get the current source route. [INFO] [stdout] 427 | | match get_at_domain(&s[len..]) { [INFO] [stdout] 428 | | Some(ad) => { [INFO] [stdout] ... | [INFO] [stdout] 442 | | } [INFO] [stdout] | |_____^ help: try: `while let Some(ad) = get_at_domain(&s[len..]) { .. }` [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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/common/utils.rs:506:12 [INFO] [stdout] | [INFO] [stdout] 506 | || ip.chars().nth(0).unwrap() != '[' [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `ip.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/server/commands/mod.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | fn handle_domain(&mut self, domain: &str) -> Result<(), ()>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/server/commands/mod.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | fn handle_sender_address(&mut self, mailbox: Option) -> Result<(), ()>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/server/commands/mod.rs:57:5 [INFO] [stdout] | [INFO] [stdout] 57 | fn handle_receiver_address(&mut self, mailbox: Mailbox) -> Result<(), ()>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Command` [INFO] [stdout] --> src/server/mod.rs:136:5 [INFO] [stdout] | [INFO] [stdout] 136 | / pub fn new() -> Command { [INFO] [stdout] 137 | | Command { [INFO] [stdout] 138 | | start: None, [INFO] [stdout] 139 | | front_middleware: None, [INFO] [stdout] 140 | | } [INFO] [stdout] 141 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 134 + impl Default for Command { [INFO] [stdout] 135 + fn default() -> Self { [INFO] [stdout] 136 + Self::new() [INFO] [stdout] 137 + } [INFO] [stdout] 138 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/server/mod.rs:148:24 [INFO] [stdout] | [INFO] [stdout] 148 | fn last_middleware<'a>(prev: &'a mut NextMiddleware) -> &'a mut NextMiddleware { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 148 - fn last_middleware<'a>(prev: &'a mut NextMiddleware) -> &'a mut NextMiddleware { [INFO] [stdout] 148 + fn last_middleware(prev: &mut NextMiddleware) -> &mut NextMiddleware { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/server/mod.rs:169:17 [INFO] [stdout] | [INFO] [stdout] 169 | / Command::last_middleware(self.front_middleware.as_mut().unwrap()).next = [INFO] [stdout] 170 | | Box::new(next); [INFO] [stdout] | |__________________________________^ help: replace existing content with inner value instead: `*Command::last_middleware(self.front_middleware.as_mut().unwrap()).next = next` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] = note: `#[warn(clippy::replace_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/server/mod.rs:408:12 [INFO] [stdout] | [INFO] [stdout] 408 | if self.config.hostname.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.config.hostname.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: method `ready` is never used [INFO] [stdout] --> src/server/mod.rs:175:8 [INFO] [stdout] | [INFO] [stdout] 134 | impl Command { [INFO] [stdout] | ---------------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 175 | fn ready(&self) -> bool { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `set_hostname`, `set_max_recipients`, `set_max_message_size`, `increase_max_command_line_size`, and `increase_max_text_line_size` are never used [INFO] [stdout] --> src/server/mod.rs:257:8 [INFO] [stdout] | [INFO] [stdout] 236 | impl Server { [INFO] [stdout] | -------------------------------------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 257 | fn set_hostname(&mut self, hostname: &str) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 261 | fn set_max_recipients(&mut self, max: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 268 | fn set_max_message_size(&mut self, max: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 283 | fn increase_max_command_line_size(&mut self, bytes: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 287 | fn increase_max_text_line_size(&mut self, bytes: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/common/mailbox.rs:227:35 [INFO] [stdout] | [INFO] [stdout] 227 | let mut s = String::from_iter(repeat('a').take(MAX_MAILBOX_LOCAL_PART_LEN)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n('a', MAX_MAILBOX_LOCAL_PART_LEN)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/common/mailbox.rs:230:35 [INFO] [stdout] | [INFO] [stdout] 230 | let mut s = String::from_iter(repeat('a').take(MAX_MAILBOX_LOCAL_PART_LEN + 1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n('a', MAX_MAILBOX_LOCAL_PART_LEN + 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/common/mailbox.rs:257:53 [INFO] [stdout] | [INFO] [stdout] 257 | ("rust@".to_owned() + String::from_iter(repeat('a').take(MAX_DOMAIN_LEN)).as_str()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n('a', MAX_DOMAIN_LEN)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/common/mailbox.rs:264:53 [INFO] [stdout] | [INFO] [stdout] 264 | ("rust@".to_owned() + String::from_iter(repeat('a').take(MAX_DOMAIN_LEN + 1)).as_ref()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n('a', MAX_DOMAIN_LEN + 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/common/mailbox.rs:269:49 [INFO] [stdout] | [INFO] [stdout] 269 | ("rust@".to_owned() + String::from_iter(repeat('a').take(MAX_MAILBOX_LEN - 5)).as_str()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n('a', MAX_MAILBOX_LEN - 5)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/common/mailbox.rs:277:37 [INFO] [stdout] | [INFO] [stdout] 277 | + String::from_iter(repeat('a').take(MAX_MAILBOX_LEN - 4)).as_str()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n('a', MAX_MAILBOX_LEN - 4)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `index` is used as a loop counter [INFO] [stdout] --> src/common/stream.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | for byte in buf.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (index, byte) in buf.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/common/stream.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | / match self.last_crlf { [INFO] [stdout] 126 | | Some(p) => { [INFO] [stdout] ... | [INFO] [stdout] 132 | | _ => {} [INFO] [stdout] 133 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 125 ~ if let Some(p) = self.last_crlf { [INFO] [stdout] 126 + // TODO: This could probably be optimised by shifting bytes instead [INFO] [stdout] 127 + // of re-allocating. [INFO] [stdout] 128 + self.buf = self.buf[p + 2..].to_vec(); [INFO] [stdout] 129 + self.buf.reserve(self.max_line_size); [INFO] [stdout] 130 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:203:69 [INFO] [stdout] | [INFO] [stdout] 203 | println!("rsmtp: imsg: {}", String::from_utf8_lossy(bytes.as_ref())); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `bytes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] = note: `#[warn(clippy::useless_asref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/common/stream.rs:303:13 [INFO] [stdout] | [INFO] [stdout] 303 | assert!(!stream.read_line().is_ok()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/common/stream.rs:310:13 [INFO] [stdout] | [INFO] [stdout] 310 | assert!(!stream.read_line().is_ok()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/common/stream.rs:317:13 [INFO] [stdout] | [INFO] [stdout] 317 | assert!(!stream.read_line().is_ok()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/common/stream.rs:330:13 [INFO] [stdout] | [INFO] [stdout] 330 | assert!(!stream.read_line().is_ok()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/common/stream.rs:343:13 [INFO] [stdout] | [INFO] [stdout] 343 | assert!(!stream.read_line().is_ok()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/common/stream.rs:362:13 [INFO] [stdout] | [INFO] [stdout] 362 | assert!(!stream.read_line().is_ok()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/common/stream.rs:406:13 [INFO] [stdout] | [INFO] [stdout] 406 | assert!(!stream.read_line().is_ok()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/common/stream.rs:296:5 [INFO] [stdout] | [INFO] [stdout] 296 | let expected: String; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ created here [INFO] [stdout] ... [INFO] [stdout] 364 | expected = String::from_iter(repeat('x').take(62)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `expected` here [INFO] [stdout] | [INFO] [stdout] 296 ~ [INFO] [stdout] 297 | [INFO] [stdout] ... [INFO] [stdout] 363 | [INFO] [stdout] 364 ~ let expected: String = String::from_iter(repeat('x').take(62)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/common/stream.rs:325:9 [INFO] [stdout] | [INFO] [stdout] 325 | / String::from_utf8_lossy(stream.read_line().unwrap().as_ref()) [INFO] [stdout] 326 | | .to_owned() [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] = note: `#[warn(clippy::suspicious_to_owned)]` on by default [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 326 | .into_owned() [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 326 - .to_owned() [INFO] [stdout] 326 + .clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:325:33 [INFO] [stdout] | [INFO] [stdout] 325 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/common/stream.rs:338:9 [INFO] [stdout] | [INFO] [stdout] 338 | / String::from_utf8_lossy(stream.read_line().unwrap().as_ref()) [INFO] [stdout] 339 | | .to_owned() [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 339 | .into_owned() [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 339 - .to_owned() [INFO] [stdout] 339 + .clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:338:33 [INFO] [stdout] | [INFO] [stdout] 338 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/common/stream.rs:351:9 [INFO] [stdout] | [INFO] [stdout] 351 | / String::from_utf8_lossy(stream.read_line().unwrap().as_ref()) [INFO] [stdout] 352 | | .to_owned() [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 352 | .into_owned() [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 352 - .to_owned() [INFO] [stdout] 352 + .clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:351:33 [INFO] [stdout] | [INFO] [stdout] 351 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/common/stream.rs:357:9 [INFO] [stdout] | [INFO] [stdout] 357 | / String::from_utf8_lossy(stream.read_line().unwrap().as_ref()) [INFO] [stdout] 358 | | .to_owned() [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 358 | .into_owned() [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 358 - .to_owned() [INFO] [stdout] 358 + .clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:357:33 [INFO] [stdout] | [INFO] [stdout] 357 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/common/stream.rs:364:34 [INFO] [stdout] | [INFO] [stdout] 364 | expected = String::from_iter(repeat('x').take(62)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n('x', 62)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/common/stream.rs:371:9 [INFO] [stdout] | [INFO] [stdout] 371 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 371 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).into_owned(), [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 371 - String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] 371 + String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).clone(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:371:33 [INFO] [stdout] | [INFO] [stdout] 371 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/common/stream.rs:375:9 [INFO] [stdout] | [INFO] [stdout] 375 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 375 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).into_owned(), [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 375 - String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] 375 + String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).clone(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:375:33 [INFO] [stdout] | [INFO] [stdout] 375 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/common/stream.rs:379:9 [INFO] [stdout] | [INFO] [stdout] 379 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 379 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).into_owned(), [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 379 - String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] 379 + String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).clone(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:379:33 [INFO] [stdout] | [INFO] [stdout] 379 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/common/stream.rs:383:9 [INFO] [stdout] | [INFO] [stdout] 383 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 383 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).into_owned(), [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 383 - String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] 383 + String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).clone(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:383:33 [INFO] [stdout] | [INFO] [stdout] 383 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/common/stream.rs:387:9 [INFO] [stdout] | [INFO] [stdout] 387 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 387 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).into_owned(), [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 387 - String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] 387 + String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).clone(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:387:33 [INFO] [stdout] | [INFO] [stdout] 387 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/common/stream.rs:391:9 [INFO] [stdout] | [INFO] [stdout] 391 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 391 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).into_owned(), [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 391 - String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] 391 + String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).clone(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:391:33 [INFO] [stdout] | [INFO] [stdout] 391 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/common/stream.rs:395:9 [INFO] [stdout] | [INFO] [stdout] 395 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 395 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).into_owned(), [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 395 - String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] 395 + String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).clone(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:395:33 [INFO] [stdout] | [INFO] [stdout] 395 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/common/stream.rs:399:9 [INFO] [stdout] | [INFO] [stdout] 399 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 399 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).into_owned(), [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 399 - String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] 399 + String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).clone(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:399:33 [INFO] [stdout] | [INFO] [stdout] 399 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned [INFO] [stdout] --> src/common/stream.rs:403:9 [INFO] [stdout] | [INFO] [stdout] 403 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned [INFO] [stdout] help: depending on intent, either make the `Cow` an `Owned` variant [INFO] [stdout] | [INFO] [stdout] 403 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).into_owned(), [INFO] [stdout] | ++ [INFO] [stdout] help: or clone the `Cow` itself [INFO] [stdout] | [INFO] [stdout] 403 - String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] 403 + String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).clone(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/common/stream.rs:403:33 [INFO] [stdout] | [INFO] [stdout] 403 | String::from_utf8_lossy(stream.read_line().unwrap().as_ref()).to_owned(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stream.read_line().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common/utils.rs:31:8 [INFO] [stdout] | [INFO] [stdout] 31 | if s.len() > 0 && is_alnum(s.chars().nth(0).unwrap()) { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/common/utils.rs:31:32 [INFO] [stdout] | [INFO] [stdout] 31 | if s.len() > 0 && is_alnum(s.chars().nth(0).unwrap()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `s.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> examples/server.rs:49:12 [INFO] [stdout] | [INFO] [stdout] 49 | if let Err(_) = server.listen(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 2525) { [INFO] [stdout] | -------^^^^^^--------------------------------------------------------------- help: try: `if server.listen(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 2525).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/common/utils.rs:198:5 [INFO] [stdout] | [INFO] [stdout] 198 | / match c { [INFO] [stdout] 199 | | '!' | '#' | '$' | '%' | '&' | '\'' | '*' | '+' | '-' | '/' | '=' | '?' | '^' | '_' [INFO] [stdout] 200 | | | '`' | '{' | '|' | '}' | '~' => true, [INFO] [stdout] 201 | | 'A'..='Z' => true, [INFO] [stdout] ... | [INFO] [stdout] 204 | | _ => false, [INFO] [stdout] 205 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 198 ~ matches!(c, '!' | '#' | '$' | '%' | '&' | '\'' | '*' | '+' | '-' | '/' | '=' | '?' | '^' | '_' [INFO] [stdout] 199 + | '`' | '{' | '|' | '}' | '~' | 'A'..='Z' | 'a'..='z' | '0'..='9') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/common/utils.rs:266:5 [INFO] [stdout] | [INFO] [stdout] 266 | / match c { [INFO] [stdout] 267 | | 'A'..='Z' | 'a'..='z' | '0'..='9' => true, [INFO] [stdout] 268 | | _ => false, [INFO] [stdout] 269 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 266 - match c { [INFO] [stdout] 267 - 'A'..='Z' | 'a'..='z' | '0'..='9' => true, [INFO] [stdout] 268 - _ => false, [INFO] [stdout] 269 - } [INFO] [stdout] 266 + matches!(c, 'A'..='Z' | 'a'..='z' | '0'..='9') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/common/utils.rs:277:45 [INFO] [stdout] | [INFO] [stdout] 277 | if c >= 'A' as u8 && c <= 'Z' as u8 { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 278 | | assert!(is_alnum(c as char)); [INFO] [stdout] 279 | | } else if c >= 'a' as u8 && c <= 'z' as u8 { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/common/utils.rs:279:52 [INFO] [stdout] | [INFO] [stdout] 279 | } else if c >= 'a' as u8 && c <= 'z' as u8 { [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 280 | | assert!(is_alnum(c as char)); [INFO] [stdout] 281 | | } else if c >= '0' as u8 && c <= '9' as u8 { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/common/utils.rs:279:52 [INFO] [stdout] | [INFO] [stdout] 279 | } else if c >= 'a' as u8 && c <= 'z' as u8 { [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 280 | | assert!(is_alnum(c as char)); [INFO] [stdout] 281 | | } else if c >= '0' as u8 && c <= '9' as u8 { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/common/utils.rs:281:52 [INFO] [stdout] | [INFO] [stdout] 281 | } else if c >= '0' as u8 && c <= '9' as u8 { [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 282 | | assert!(is_alnum(c as char)); [INFO] [stdout] 283 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/common/utils.rs:277:17 [INFO] [stdout] | [INFO] [stdout] 277 | if c >= 'A' as u8 && c <= 'Z' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'A'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/common/utils.rs:277:35 [INFO] [stdout] | [INFO] [stdout] 277 | if c >= 'A' as u8 && c <= 'Z' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'Z'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/common/utils.rs:279:24 [INFO] [stdout] | [INFO] [stdout] 279 | } else if c >= 'a' as u8 && c <= 'z' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/common/utils.rs:279:42 [INFO] [stdout] | [INFO] [stdout] 279 | } else if c >= 'a' as u8 && c <= 'z' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'z'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/common/utils.rs:281:24 [INFO] [stdout] | [INFO] [stdout] 281 | } else if c >= '0' as u8 && c <= '9' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/common/utils.rs:281:42 [INFO] [stdout] | [INFO] [stdout] 281 | } else if c >= '0' as u8 && c <= '9' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'9'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/common/utils.rs:299:19 [INFO] [stdout] | [INFO] [stdout] 299 | if sl >= 2 && s.chars().nth(0).unwrap() == '"' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `s.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/common/utils.rs:351:5 [INFO] [stdout] | [INFO] [stdout] 351 | / match c as isize { [INFO] [stdout] 352 | | 32..=33 | 35..=91 | 93..=126 => true, [INFO] [stdout] 353 | | _ => false, [INFO] [stdout] 354 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 351 - match c as isize { [INFO] [stdout] 352 - 32..=33 | 35..=91 | 93..=126 => true, [INFO] [stdout] 353 - _ => false, [INFO] [stdout] 354 - } [INFO] [stdout] 351 + matches!(c as isize, 32..=33 | 35..=91 | 93..=126) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/common/utils.rs:396:23 [INFO] [stdout] | [INFO] [stdout] 396 | if s.len() > 1 && s.chars().nth(0).unwrap() == '@' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `s.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/common/utils.rs:425:5 [INFO] [stdout] | [INFO] [stdout] 425 | / loop { [INFO] [stdout] 426 | | // Get the current source route. [INFO] [stdout] 427 | | match get_at_domain(&s[len..]) { [INFO] [stdout] 428 | | Some(ad) => { [INFO] [stdout] ... | [INFO] [stdout] 442 | | } [INFO] [stdout] | |_____^ help: try: `while let Some(ad) = get_at_domain(&s[len..]) { .. }` [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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/common/utils.rs:506:12 [INFO] [stdout] | [INFO] [stdout] 506 | || ip.chars().nth(0).unwrap() != '[' [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `ip.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/server/commands/mod.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | fn handle_domain(&mut self, domain: &str) -> Result<(), ()>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/server/commands/mod.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | fn handle_sender_address(&mut self, mailbox: Option) -> Result<(), ()>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/server/commands/mod.rs:57:5 [INFO] [stdout] | [INFO] [stdout] 57 | fn handle_receiver_address(&mut self, mailbox: Mailbox) -> Result<(), ()>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Command` [INFO] [stdout] --> src/server/mod.rs:136:5 [INFO] [stdout] | [INFO] [stdout] 136 | / pub fn new() -> Command { [INFO] [stdout] 137 | | Command { [INFO] [stdout] 138 | | start: None, [INFO] [stdout] 139 | | front_middleware: None, [INFO] [stdout] 140 | | } [INFO] [stdout] 141 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 134 + impl Default for Command { [INFO] [stdout] 135 + fn default() -> Self { [INFO] [stdout] 136 + Self::new() [INFO] [stdout] 137 + } [INFO] [stdout] 138 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/server/mod.rs:148:24 [INFO] [stdout] | [INFO] [stdout] 148 | fn last_middleware<'a>(prev: &'a mut NextMiddleware) -> &'a mut NextMiddleware { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 148 - fn last_middleware<'a>(prev: &'a mut NextMiddleware) -> &'a mut NextMiddleware { [INFO] [stdout] 148 + fn last_middleware(prev: &mut NextMiddleware) -> &mut NextMiddleware { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/server/mod.rs:169:17 [INFO] [stdout] | [INFO] [stdout] 169 | / Command::last_middleware(self.front_middleware.as_mut().unwrap()).next = [INFO] [stdout] 170 | | Box::new(next); [INFO] [stdout] | |__________________________________^ help: replace existing content with inner value instead: `*Command::last_middleware(self.front_middleware.as_mut().unwrap()).next = next` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] = note: `#[warn(clippy::replace_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/server/mod.rs:408:12 [INFO] [stdout] | [INFO] [stdout] 408 | if self.config.hostname.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.config.hostname.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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.49s [INFO] running `Command { std: "docker" "inspect" "373613fac05e89dfe6e5ee6a26ea33438f34cc8260789769b91e657628cb865c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "373613fac05e89dfe6e5ee6a26ea33438f34cc8260789769b91e657628cb865c", kill_on_drop: false }` [INFO] [stdout] 373613fac05e89dfe6e5ee6a26ea33438f34cc8260789769b91e657628cb865c