[INFO] cloning repository https://github.com/JonasAlmaas/modbus-rs [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/JonasAlmaas/modbus-rs" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FJonasAlmaas%2Fmodbus-rs", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FJonasAlmaas%2Fmodbus-rs'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 9e174125eb2a0678a32f1f300550f5b9556dde37 [INFO] linting JonasAlmaas/modbus-rs against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FJonasAlmaas%2Fmodbus-rs" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/JonasAlmaas/modbus-rs [INFO] finished tweaking git repo https://github.com/JonasAlmaas/modbus-rs [INFO] tweaked toml for git repo https://github.com/JonasAlmaas/modbus-rs written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/JonasAlmaas/modbus-rs on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/JonasAlmaas/modbus-rs 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-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] 190e7e7d35958c99bf81f43731b3f71ead63cc22dad78d3887e450b8f972cc4f [INFO] running `Command { std: "docker" "start" "-a" "190e7e7d35958c99bf81f43731b3f71ead63cc22dad78d3887e450b8f972cc4f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "190e7e7d35958c99bf81f43731b3f71ead63cc22dad78d3887e450b8f972cc4f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "190e7e7d35958c99bf81f43731b3f71ead63cc22dad78d3887e450b8f972cc4f", kill_on_drop: false }` [INFO] [stdout] 190e7e7d35958c99bf81f43731b3f71ead63cc22dad78d3887e450b8f972cc4f [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] b7f4c33f05d76fe2dc4cccdac805c43d4015dd3ebc6ec7334874c95614ce50c1 [INFO] running `Command { std: "docker" "start" "-a" "b7f4c33f05d76fe2dc4cccdac805c43d4015dd3ebc6ec7334874c95614ce50c1", kill_on_drop: false }` [INFO] [stderr] Checking mbrs v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/adu_tcp.rs:10:1 [INFO] [stdout] | [INFO] [stdout] 10 | / /// - Unit id (1 byte) (Same as Modbus serial slave address) [INFO] [stdout] 11 | | [INFO] [stdout] | |_^ [INFO] [stdout] 12 | const MBAP_POS_TRANS_ID: usize = 0; [INFO] [stdout] | ----------------------- the comment documents this constant item [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/adu_tcp.rs:10:1 [INFO] [stdout] | [INFO] [stdout] 10 | / /// - Unit id (1 byte) (Same as Modbus serial slave address) [INFO] [stdout] 11 | | [INFO] [stdout] | |_^ [INFO] [stdout] 12 | const MBAP_POS_TRANS_ID: usize = 0; [INFO] [stdout] | ----------------------- the comment documents this constant item [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/adu.rs:38:8 [INFO] [stdout] | [INFO] [stdout] 38 | if !inst.serial.is_some() || buf.len() < SIZE_MIN || buf.len() > SIZE_MAX { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `inst.serial.is_none()` [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 `impl` can be derived [INFO] [stdout] --> src/coil.rs:33:1 [INFO] [stdout] | [INFO] [stdout] 33 | / impl<'a> Default for Descriptor<'a> { [INFO] [stdout] 34 | | fn default() -> Self { [INFO] [stdout] 35 | | Self { [INFO] [stdout] 36 | | address: Default::default(), [INFO] [stdout] ... | [INFO] [stdout] 44 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 22 + #[derive(Default)] [INFO] [stdout] 23 | pub struct Descriptor<'a> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/coil.rs:54:1 [INFO] [stdout] | [INFO] [stdout] 54 | / impl<'a> PartialOrd for Descriptor<'a> { [INFO] [stdout] 55 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 56 | | self.address.partial_cmp(&other.address) [INFO] [stdout] 57 | | } [INFO] [stdout] 58 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 55 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 56 - self.address.partial_cmp(&other.address) [INFO] [stdout] 57 - } [INFO] [stdout] 55 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/func/coils.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::u16; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `u16::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/func/coils.rs:58:22 [INFO] [stdout] | [INFO] [stdout] 58 | let byte_count = (quantity as usize + 7) / 8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(quantity as usize).div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` 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/func/coils.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | / match coil::find(addr, coils) { [INFO] [stdout] 68 | | Some(c) => match c.read() { [INFO] [stdout] 69 | | Ok(v) => { [INFO] [stdout] 70 | | if v { [INFO] [stdout] ... | [INFO] [stdout] 78 | | None => (), // If coil doesn't exist, it's left as 0 [INFO] [stdout] 79 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [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] 67 ~ if let Some(c) = coil::find(addr, coils) { match c.read() { [INFO] [stdout] 68 + Ok(v) => { [INFO] [stdout] 69 + if v { [INFO] [stdout] 70 + res.p[2 + (i as usize / 8)] |= 1 << (i % 8); [INFO] [stdout] 71 + } [INFO] [stdout] 72 + } [INFO] [stdout] 73 + Err(Error::ReadNotSuppported) => (), // Leave as 0 [INFO] [stdout] 74 + Err(Error::ReadLocked) => return Ok(StatusCode::IllegalDataAddr), [INFO] [stdout] 75 + Err(..) => return Ok(StatusCode::DeviceFail), [INFO] [stdout] 76 ~ } }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/func/coils.rs:161:29 [INFO] [stdout] | [INFO] [stdout] 161 | if byte_count as u16 != ((quantity + 7) / 8) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `quantity.div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [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/pdu.rs:15:40 [INFO] [stdout] | [INFO] [stdout] 15 | Ok(FunctionCode::ReadCoils) => match func::coils::read_multiple(inst, buf, res, false) { [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 16 | | Ok(status_code) => return status_code, [INFO] [stdout] 17 | | Err(()) => (), [INFO] [stdout] 18 | | }, [INFO] [stdout] | |_________^ help: try: `if let Ok(status_code) = func::coils::read_multiple(inst, buf, res, false) { return status_code }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/pdu.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | / match func::coils::read_multiple(inst, buf, res, true) { [INFO] [stdout] 21 | | Ok(status_code) => return status_code, [INFO] [stdout] 22 | | Err(()) => (), [INFO] [stdout] 23 | | } [INFO] [stdout] | |_____________^ help: try: `if let Ok(status_code) = func::coils::read_multiple(inst, buf, res, true) { return status_code }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/pdu.rs:27:46 [INFO] [stdout] | [INFO] [stdout] 27 | Ok(FunctionCode::WriteSingleCoil) => match func::coils::write_single(inst, buf, res) { [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 28 | | Ok(status_code) => return status_code, [INFO] [stdout] 29 | | Err(()) => (), [INFO] [stdout] 30 | | }, [INFO] [stdout] | |_________^ help: try: `if let Ok(status_code) = func::coils::write_single(inst, buf, res) { return status_code }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/pdu.rs:36:49 [INFO] [stdout] | [INFO] [stdout] 36 | Ok(FunctionCode::WriteMultipleCoils) => match func::coils::write_multiple(inst, buf, res) { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 37 | | Ok(status_code) => return status_code, [INFO] [stdout] 38 | | Err(()) => (), [INFO] [stdout] 39 | | }, [INFO] [stdout] | |_________^ help: try: `if let Ok(status_code) = func::coils::write_multiple(inst, buf, res) { return status_code }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `buf.get(0)` [INFO] [stdout] --> src/pdu.rs:62:20 [INFO] [stdout] | [INFO] [stdout] 62 | let fc = match buf.get(0) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `buf.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/lib.rs:20:20 [INFO] [stdout] | [INFO] [stdout] 20 | pub handle_fn: Option StatusCode + 'a>>, [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: this `impl` can be derived [INFO] [stdout] --> src/lib.rs:27:1 [INFO] [stdout] | [INFO] [stdout] 27 | / impl<'a> Default for Instance<'a> { [INFO] [stdout] 28 | | fn default() -> Self { [INFO] [stdout] 29 | | Self { [INFO] [stdout] 30 | | disc_inputs: Default::default(), [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 16 + #[derive(Default)] [INFO] [stdout] 17 | pub struct Instance<'a> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/adu.rs:38:8 [INFO] [stdout] | [INFO] [stdout] 38 | if !inst.serial.is_some() || buf.len() < SIZE_MIN || buf.len() > SIZE_MAX { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `inst.serial.is_none()` [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 `impl` can be derived [INFO] [stdout] --> src/coil.rs:33:1 [INFO] [stdout] | [INFO] [stdout] 33 | / impl<'a> Default for Descriptor<'a> { [INFO] [stdout] 34 | | fn default() -> Self { [INFO] [stdout] 35 | | Self { [INFO] [stdout] 36 | | address: Default::default(), [INFO] [stdout] ... | [INFO] [stdout] 44 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 22 + #[derive(Default)] [INFO] [stdout] 23 | pub struct Descriptor<'a> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/coil.rs:54:1 [INFO] [stdout] | [INFO] [stdout] 54 | / impl<'a> PartialOrd for Descriptor<'a> { [INFO] [stdout] 55 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 56 | | self.address.partial_cmp(&other.address) [INFO] [stdout] 57 | | } [INFO] [stdout] 58 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 55 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 56 - self.address.partial_cmp(&other.address) [INFO] [stdout] 57 - } [INFO] [stdout] 55 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/func/coils.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::u16; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `u16::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/func/coils.rs:58:22 [INFO] [stdout] | [INFO] [stdout] 58 | let byte_count = (quantity as usize + 7) / 8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(quantity as usize).div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` 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/func/coils.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | / match coil::find(addr, coils) { [INFO] [stdout] 68 | | Some(c) => match c.read() { [INFO] [stdout] 69 | | Ok(v) => { [INFO] [stdout] 70 | | if v { [INFO] [stdout] ... | [INFO] [stdout] 78 | | None => (), // If coil doesn't exist, it's left as 0 [INFO] [stdout] 79 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [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] 67 ~ if let Some(c) = coil::find(addr, coils) { match c.read() { [INFO] [stdout] 68 + Ok(v) => { [INFO] [stdout] 69 + if v { [INFO] [stdout] 70 + res.p[2 + (i as usize / 8)] |= 1 << (i % 8); [INFO] [stdout] 71 + } [INFO] [stdout] 72 + } [INFO] [stdout] 73 + Err(Error::ReadNotSuppported) => (), // Leave as 0 [INFO] [stdout] 74 + Err(Error::ReadLocked) => return Ok(StatusCode::IllegalDataAddr), [INFO] [stdout] 75 + Err(..) => return Ok(StatusCode::DeviceFail), [INFO] [stdout] 76 ~ } }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/func/coils.rs:161:29 [INFO] [stdout] | [INFO] [stdout] 161 | if byte_count as u16 != ((quantity + 7) / 8) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `quantity.div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [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/pdu.rs:15:40 [INFO] [stdout] | [INFO] [stdout] 15 | Ok(FunctionCode::ReadCoils) => match func::coils::read_multiple(inst, buf, res, false) { [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 16 | | Ok(status_code) => return status_code, [INFO] [stdout] 17 | | Err(()) => (), [INFO] [stdout] 18 | | }, [INFO] [stdout] | |_________^ help: try: `if let Ok(status_code) = func::coils::read_multiple(inst, buf, res, false) { return status_code }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/pdu.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | / match func::coils::read_multiple(inst, buf, res, true) { [INFO] [stdout] 21 | | Ok(status_code) => return status_code, [INFO] [stdout] 22 | | Err(()) => (), [INFO] [stdout] 23 | | } [INFO] [stdout] | |_____________^ help: try: `if let Ok(status_code) = func::coils::read_multiple(inst, buf, res, true) { return status_code }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/pdu.rs:27:46 [INFO] [stdout] | [INFO] [stdout] 27 | Ok(FunctionCode::WriteSingleCoil) => match func::coils::write_single(inst, buf, res) { [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 28 | | Ok(status_code) => return status_code, [INFO] [stdout] 29 | | Err(()) => (), [INFO] [stdout] 30 | | }, [INFO] [stdout] | |_________^ help: try: `if let Ok(status_code) = func::coils::write_single(inst, buf, res) { return status_code }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/pdu.rs:36:49 [INFO] [stdout] | [INFO] [stdout] 36 | Ok(FunctionCode::WriteMultipleCoils) => match func::coils::write_multiple(inst, buf, res) { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 37 | | Ok(status_code) => return status_code, [INFO] [stdout] 38 | | Err(()) => (), [INFO] [stdout] 39 | | }, [INFO] [stdout] | |_________^ help: try: `if let Ok(status_code) = func::coils::write_multiple(inst, buf, res) { return status_code }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `buf.get(0)` [INFO] [stdout] --> src/pdu.rs:62:20 [INFO] [stdout] | [INFO] [stdout] 62 | let fc = match buf.get(0) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `buf.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/lib.rs:20:20 [INFO] [stdout] | [INFO] [stdout] 20 | pub handle_fn: Option StatusCode + 'a>>, [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: this `impl` can be derived [INFO] [stdout] --> src/lib.rs:27:1 [INFO] [stdout] | [INFO] [stdout] 27 | / impl<'a> Default for Instance<'a> { [INFO] [stdout] 28 | | fn default() -> Self { [INFO] [stdout] 29 | | Self { [INFO] [stdout] 30 | | disc_inputs: Default::default(), [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 16 + #[derive(Default)] [INFO] [stdout] 17 | pub struct Instance<'a> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.62s [INFO] running `Command { std: "docker" "inspect" "b7f4c33f05d76fe2dc4cccdac805c43d4015dd3ebc6ec7334874c95614ce50c1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "b7f4c33f05d76fe2dc4cccdac805c43d4015dd3ebc6ec7334874c95614ce50c1", kill_on_drop: false }` [INFO] [stdout] b7f4c33f05d76fe2dc4cccdac805c43d4015dd3ebc6ec7334874c95614ce50c1