[INFO] cloning repository https://github.com/defghij/disassembler [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/defghij/disassembler" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdefghij%2Fdisassembler", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdefghij%2Fdisassembler'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 8f82b8cb0779db6776bb53096c0107be75aaa62c [INFO] linting defghij/disassembler against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdefghij%2Fdisassembler" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/defghij/disassembler [INFO] finished tweaking git repo https://github.com/defghij/disassembler [INFO] tweaked toml for git repo https://github.com/defghij/disassembler written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/defghij/disassembler 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/defghij/disassembler already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded tracing-test-macro v0.2.5 [INFO] [stderr] Downloaded tracing-test v0.2.5 [INFO] [stderr] Downloaded bon-macros v3.7.2 [INFO] [stderr] Downloaded bon v3.7.2 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 40f4516d69c1bb1373e33b53c6196907ce18dcbf4c74bf7935f3e8386e6f5540 [INFO] running `Command { std: "docker" "start" "-a" "40f4516d69c1bb1373e33b53c6196907ce18dcbf4c74bf7935f3e8386e6f5540", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "40f4516d69c1bb1373e33b53c6196907ce18dcbf4c74bf7935f3e8386e6f5540", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "40f4516d69c1bb1373e33b53c6196907ce18dcbf4c74bf7935f3e8386e6f5540", kill_on_drop: false }` [INFO] [stdout] 40f4516d69c1bb1373e33b53c6196907ce18dcbf4c74bf7935f3e8386e6f5540 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] e9d908d3b22eebc7ae10f035541fa40b59eaec1369ebd905fb70e9fb8084c0ec [INFO] running `Command { std: "docker" "start" "-a" "e9d908d3b22eebc7ae10f035541fa40b59eaec1369ebd905fb70e9fb8084c0ec", kill_on_drop: false }` [INFO] [stderr] Compiling prettyplease v0.2.37 [INFO] [stderr] Checking regex-automata v0.4.10 [INFO] [stderr] Compiling phf_shared v0.13.1 [INFO] [stderr] Compiling fastrand v2.3.0 [INFO] [stderr] Compiling syn v2.0.106 [INFO] [stderr] Checking getrandom v0.3.3 [INFO] [stderr] Checking clap_builder v4.5.47 [INFO] [stderr] Compiling phf_generator v0.13.1 [INFO] [stderr] Checking rand_core v0.9.3 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Checking rand v0.9.2 [INFO] [stderr] Checking matchers v0.2.0 [INFO] [stderr] Checking clap v4.5.47 [INFO] [stderr] Compiling darling_core v0.21.3 [INFO] [stderr] Compiling tracing-attributes v0.1.30 [INFO] [stderr] Compiling phf_macros v0.13.1 [INFO] [stderr] Compiling tracing-test-macro v0.2.5 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Checking phf v0.13.1 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Checking tracing-subscriber v0.3.20 [INFO] [stderr] Compiling darling_macro v0.21.3 [INFO] [stderr] Compiling darling v0.21.3 [INFO] [stderr] Compiling bon-macros v3.7.2 [INFO] [stderr] Checking tracing-test v0.2.5 [INFO] [stderr] Checking serde v1.0.219 [INFO] [stderr] Checking bon v3.7.2 [INFO] [stderr] Checking disassembler v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/decode.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | /// is used in the creation of relative displacements or labels. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] = note: `#[warn(clippy::doc_lazy_continuation)]` on by default [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 56 | /// is used in the creation of relative displacements or labels. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/decode.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 59 | /// can be interpreted as an [Instruction] and returned as [Bytes]. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 59 | /// can be interpreted as an [Instruction] and returned as [Bytes]. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/decode.rs:154:20 [INFO] [stdout] | [INFO] [stdout] 154 | if !extensions.as_ref().is_some_and(|exts| exts.len() == 1) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `extensions.as_ref().is_none_or(|exts| exts.len() != 1)` [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/decode.rs:285:20 [INFO] [stdout] | [INFO] [stdout] 285 | if !extensions.as_ref().is_some_and(|exts| exts.len() == 2) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `extensions.as_ref().is_none_or(|exts| exts.len() != 2)` [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/decode.rs:376:20 [INFO] [stdout] | [INFO] [stdout] 376 | if !extensions.as_ref().is_some_and(|exts| exts.len() == 2) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `extensions.as_ref().is_none_or(|exts| exts.len() != 2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/decode.rs:67:12 [INFO] [stdout] | [INFO] [stdout] 67 | if bytes.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `bytes.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: useless conversion to the same type: `instruction::encoding::operands::Register` [INFO] [stdout] --> src/decode.rs:313:55 [INFO] [stdout] | [INFO] [stdout] 313 | instruction.add(Operand::Register(Register::from(modrm.1))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `Register::from()`: `modrm.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `instruction::encoding::operands::Register` [INFO] [stdout] --> src/decode.rs:332:55 [INFO] [stdout] | [INFO] [stdout] 332 | instruction.add(Operand::Register(Register::from(modrm.1))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `Register::from()`: `modrm.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `instruction::encoding::operands::Register` [INFO] [stdout] --> src/decode.rs:359:55 [INFO] [stdout] | [INFO] [stdout] 359 | instruction.add(Operand::Register(Register::from(modrm.1))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `Register::from()`: `modrm.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/decode.rs:584:9 [INFO] [stdout] | [INFO] [stdout] 584 | / match self { [INFO] [stdout] 585 | | Bytes::Uknown(_) | Bytes::_Illegal(_) | Bytes::None => false, [INFO] [stdout] 586 | | _ => true, [INFO] [stdout] 587 | | } [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] 584 - match self { [INFO] [stdout] 585 - Bytes::Uknown(_) | Bytes::_Illegal(_) | Bytes::None => false, [INFO] [stdout] 586 - _ => true, [INFO] [stdout] 587 - } [INFO] [stdout] 584 + !matches!(self, Bytes::Uknown(_) | Bytes::_Illegal(_) | Bytes::None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/decode.rs:617:65 [INFO] [stdout] | [INFO] [stdout] 617 | Bytes::Uknown(byte) | Bytes::_Illegal(byte) => vec![byte.clone()], [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*byte` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/decode.rs:634:1 [INFO] [stdout] | [INFO] [stdout] 634 | / impl Default for Bytes { [INFO] [stdout] 635 | | fn default() -> Self { [INFO] [stdout] 636 | | Bytes::None [INFO] [stdout] 637 | | } [INFO] [stdout] 638 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 37 + #[derive(Default)] [INFO] [stdout] 38 | pub enum Bytes { [INFO] [stdout] 39 | /// Bytes representing a decoded instruction. [INFO] [stdout] ... [INFO] [stdout] 49 | _Illegal(u8), [INFO] [stdout] 50 ~ #[default] [INFO] [stdout] 51 ~ None, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/decode.rs:672:10 [INFO] [stdout] | [INFO] [stdout] 672 | ) -> ( [INFO] [stdout] | __________^ [INFO] [stdout] 673 | | &'static str, [INFO] [stdout] 674 | | Option, [INFO] [stdout] 675 | | OpCode, [INFO] [stdout] ... | [INFO] [stdout] 678 | | Option, [INFO] [stdout] 679 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decode.rs:697:13 [INFO] [stdout] | [INFO] [stdout] 697 | return Err(DecodeError::InvalidAddressingMode); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 697 - return Err(DecodeError::InvalidAddressingMode); [INFO] [stdout] 697 + Err(DecodeError::InvalidAddressingMode) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `ext_set` after checking its variant with `is_some` [INFO] [stdout] --> src/decode.rs:790:30 [INFO] [stdout] | [INFO] [stdout] 789 | if ext_set.is_some() { [INFO] [stdout] | -------------------- help: try: `if let Some() = &ext_set` [INFO] [stdout] 790 | let extensions = ext_set.as_ref().expect("Should be some due to conditional"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `addr_mode` after checking its variant with `is_some` [INFO] [stdout] --> src/decode.rs:808:35 [INFO] [stdout] | [INFO] [stdout] 807 | if addr_mode.is_some() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = &addr_mode` [INFO] [stdout] 808 | let addressing_mode = addr_mode [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 809 | | .as_ref() [INFO] [stdout] 810 | | .expect("Should be some due to conditional"); [INFO] [stdout] | |____________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `extensions` after checking its variant with `is_some` [INFO] [stdout] --> src/decode.rs:824:30 [INFO] [stdout] | [INFO] [stdout] 823 | if op_encoding == OpEn::I && extensions.is_some() { [INFO] [stdout] | -------------------- the check is happening here [INFO] [stdout] 824 | let extensions = extensions.expect("Should be Some by virtue of above conditional"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decode.rs:830:25 [INFO] [stdout] | [INFO] [stdout] 830 | return Some(Register::AL); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 830 - return Some(Register::AL); [INFO] [stdout] 830 + Some(Register::AL) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decode.rs:832:25 [INFO] [stdout] | [INFO] [stdout] 832 | return Some(Register::AX); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 832 - return Some(Register::AX); [INFO] [stdout] 832 + Some(Register::AX) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decode.rs:834:25 [INFO] [stdout] | [INFO] [stdout] 834 | return Some(Register::EAX); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 834 - return Some(Register::EAX); [INFO] [stdout] 834 + Some(Register::EAX) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decode.rs:836:25 [INFO] [stdout] | [INFO] [stdout] 836 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 836 - return None; [INFO] [stdout] 836 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/decode.rs:851:9 [INFO] [stdout] | [INFO] [stdout] 851 | / match self.mnemonic() { [INFO] [stdout] 852 | | "call" | "jmp" | "jz" | "jnz" => true, [INFO] [stdout] 853 | | _ => false, [INFO] [stdout] 854 | | } [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] 851 - match self.mnemonic() { [INFO] [stdout] 852 - "call" | "jmp" | "jz" | "jnz" => true, [INFO] [stdout] 853 - _ => false, [INFO] [stdout] 854 - } [INFO] [stdout] 851 + matches!(self.mnemonic(), "call" | "jmp" | "jz" | "jnz") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decode.rs:904:13 [INFO] [stdout] | [INFO] [stdout] 904 | format!("{}", mnemonic) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `mnemonic.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | i.mnemonic = mnemonic; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Instruction { mnemonic: mnemonic, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | let mut i = Instruction::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/instruction.rs:90:17 [INFO] [stdout] | [INFO] [stdout] 85 | / let offset = match o { [INFO] [stdout] 86 | | Operand::Displacement(displacement) => displacement.clone().into(), [INFO] [stdout] 87 | | Operand::Label(offset) => (*offset).clone(), [INFO] [stdout] 88 | | _ => panic!("Should be unreachable due to the filter"), [INFO] [stdout] 89 | | }; [INFO] [stdout] | |__________________- unnecessary `let` binding [INFO] [stdout] 90 | offset [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 85 ~ [INFO] [stdout] 86 ~ match o { [INFO] [stdout] 87 + Operand::Displacement(displacement) => displacement.clone().into(), [INFO] [stdout] 88 + Operand::Label(offset) => (*offset).clone(), [INFO] [stdout] 89 + _ => panic!("Should be unreachable due to the filter"), [INFO] [stdout] 90 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/instruction.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | / match self.mnemonic { [INFO] [stdout] 103 | | "call" | "jmp" | "jz" | "jnz" | "jne" => true, [INFO] [stdout] 104 | | _ => false, [INFO] [stdout] 105 | | } [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] 102 - match self.mnemonic { [INFO] [stdout] 103 - "call" | "jmp" | "jz" | "jnz" | "jne" => true, [INFO] [stdout] 104 - _ => false, [INFO] [stdout] 105 - } [INFO] [stdout] 102 + matches!(self.mnemonic, "call" | "jmp" | "jz" | "jnz" | "jne") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/instruction.rs:108:1 [INFO] [stdout] | [INFO] [stdout] 108 | / impl Default for Instruction { [INFO] [stdout] 109 | | fn default() -> Self { [INFO] [stdout] 110 | | Instruction { [INFO] [stdout] 111 | | prefix: None, [INFO] [stdout] ... | [INFO] [stdout] 116 | | } [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] 46 + #[derive(Default)] [INFO] [stdout] 47 | pub struct Instruction { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RMI` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:169:5 [INFO] [stdout] | [INFO] [stdout] 169 | RMI, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Rmi` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/instruction.rs:174:9 [INFO] [stdout] | [INFO] [stdout] 174 | / match self { [INFO] [stdout] 175 | | OpEn::RM | OpEn::MR | OpEn::MI | OpEn::M | OpEn::M1 | OpEn::RMI => true, [INFO] [stdout] 176 | | _ => false, [INFO] [stdout] 177 | | } [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] 174 - match self { [INFO] [stdout] 175 - OpEn::RM | OpEn::MR | OpEn::MI | OpEn::M | OpEn::M1 | OpEn::RMI => true, [INFO] [stdout] 176 - _ => false, [INFO] [stdout] 177 - } [INFO] [stdout] 174 + matches!(self, OpEn::RM | OpEn::MR | OpEn::MI | OpEn::M | OpEn::M1 | OpEn::RMI) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `ModBits` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:283:14 [INFO] [stdout] | [INFO] [stdout] 283 | (self.0.clone(), self.1.clone(), self.2.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Register` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:283:30 [INFO] [stdout] | [INFO] [stdout] 283 | (self.0.clone(), self.1.clone(), self.2.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Register` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:283:46 [INFO] [stdout] | [INFO] [stdout] 283 | (self.0.clone(), self.1.clone(), self.2.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `sib` after checking its variant with `is_some` [INFO] [stdout] --> src/instruction.rs:315:39 [INFO] [stdout] | [INFO] [stdout] 314 | if sib.is_some() { [INFO] [stdout] | ---------------- help: try: `if let Some() = sib` [INFO] [stdout] 315 | let sib = sib.expect("Is some due to conditional"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/instruction.rs:330:48 [INFO] [stdout] | [INFO] [stdout] 330 | if self.2 == Register::ESP { [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 331 | | 1 /* SIB w/ disp8*/ [INFO] [stdout] 332 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/instruction.rs:332:28 [INFO] [stdout] | [INFO] [stdout] 332 | } else { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 333 | | 1 [INFO] [stdout] 334 | | } [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/instruction.rs:337:48 [INFO] [stdout] | [INFO] [stdout] 337 | if self.2 == Register::ESP { [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 338 | | 4 /*SIB w/ disp32*/ [INFO] [stdout] 339 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/instruction.rs:339:28 [INFO] [stdout] | [INFO] [stdout] 339 | } else { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 340 | | 4 [INFO] [stdout] 341 | | } [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: this operation has no effect [INFO] [stdout] --> src/instruction.rs:375:45 [INFO] [stdout] | [INFO] [stdout] 375 | let rmbits = Register::try_from((value & 0b00000111) >> 0)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `((value & 0b00000111))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `ModBits` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:381:27 [INFO] [stdout] | [INFO] [stdout] 381 | let modbits = value.0.clone() as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `value.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Register` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:382:27 [INFO] [stdout] | [INFO] [stdout] 382 | let regbits = value.1.clone() as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `value.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Register` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:383:26 [INFO] [stdout] | [INFO] [stdout] 383 | let rmbits = value.2.clone() as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `value.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/instruction.rs:385:47 [INFO] [stdout] | [INFO] [stdout] 385 | (modbits << 6) | (regbits << 3) | (rmbits << 0) [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider reducing it to: `rmbits` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Register` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:407:13 [INFO] [stdout] | [INFO] [stdout] 407 | self.1.clone() [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Register` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:410:13 [INFO] [stdout] | [INFO] [stdout] 410 | self.2.clone() [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constructor `sib` has the same name as the type [INFO] [stdout] --> src/instruction.rs:418:9 [INFO] [stdout] | [INFO] [stdout] 418 | / pub fn sib(bytes: &[u8], idx: usize) -> Result { [INFO] [stdout] 419 | | let Some(sib) = bytes.get(idx) else { [INFO] [stdout] 420 | | error!("Unable to create Sib. Bytes length incorrect"); [INFO] [stdout] 421 | | return Err(DecodeError::InvalidLength); [INFO] [stdout] 422 | | }; [INFO] [stdout] 423 | | Sib::try_from(*sib) [INFO] [stdout] 424 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructors [INFO] [stdout] = note: `#[warn(clippy::self_named_constructors)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/instruction.rs:432:43 [INFO] [stdout] | [INFO] [stdout] 432 | let base = Register::try_from((value & 0b00000111) >> 0)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `((value & 0b00000111))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/instruction.rs:542:25 [INFO] [stdout] | [INFO] [stdout] 542 | !(scale == Scale::One && !use_base_register) && modrm.uses_displacement(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(use_base_register || scale != Scale::One) && modrm.uses_displacement()` [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/instruction.rs:542:25 [INFO] [stdout] | [INFO] [stdout] 542 | !(scale == Scale::One && !use_base_register) && modrm.uses_displacement(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `scale != Scale::One || use_base_register` [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: useless use of `format!` [INFO] [stdout] --> src/instruction.rs:764:21 [INFO] [stdout] | [INFO] [stdout] 764 | format!("") [INFO] [stdout] | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EAX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:867:13 [INFO] [stdout] | [INFO] [stdout] 867 | EAX = 0, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Eax` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ECX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:868:13 [INFO] [stdout] | [INFO] [stdout] 868 | ECX = 1, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Ecx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EDX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:869:13 [INFO] [stdout] | [INFO] [stdout] 869 | EDX = 2, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Edx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EBX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:870:13 [INFO] [stdout] | [INFO] [stdout] 870 | EBX = 3, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Ebx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ESP` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:871:13 [INFO] [stdout] | [INFO] [stdout] 871 | ESP = 4, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Esp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EBP` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:872:13 [INFO] [stdout] | [INFO] [stdout] 872 | EBP = 5, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Ebp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ESI` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:873:13 [INFO] [stdout] | [INFO] [stdout] 873 | ESI = 6, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Esi` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EDI` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:874:13 [INFO] [stdout] | [INFO] [stdout] 874 | EDI = 7, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Edi` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RAX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:880:13 [INFO] [stdout] | [INFO] [stdout] 880 | RAX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Rax` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RBX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:884:13 [INFO] [stdout] | [INFO] [stdout] 884 | RBX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Rbx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RCX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:888:13 [INFO] [stdout] | [INFO] [stdout] 888 | RCX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Rcx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RDX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:892:13 [INFO] [stdout] | [INFO] [stdout] 892 | RDX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Rdx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/instruction.rs:982:21 [INFO] [stdout] | [INFO] [stdout] 982 | format!("") [INFO] [stdout] | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u32` -> `u32`) [INFO] [stdout] --> src/instruction.rs:1046:36 [INFO] [stdout] | [INFO] [stdout] 1046 | let base = base as u32 + 4 /*bytes*/; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `base` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u32` -> `u32`) [INFO] [stdout] --> src/instruction.rs:1118:56 [INFO] [stdout] | [INFO] [stdout] 1118 | let target = displacement as u32 + base as u32; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `base` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u32` -> `u32`) [INFO] [stdout] --> src/instruction.rs:1150:34 [INFO] [stdout] | [INFO] [stdout] 1150 | let target = displacement as u32 + base as u32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `displacement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u32` -> `u32`) [INFO] [stdout] --> src/instruction.rs:1150:56 [INFO] [stdout] | [INFO] [stdout] 1150 | let target = displacement as u32 + base as u32; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `base` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/instruction.rs:1162:9 [INFO] [stdout] | [INFO] [stdout] 1162 | / impl Default for Displacement { [INFO] [stdout] 1163 | | fn default() -> Self { [INFO] [stdout] 1164 | | Displacement::None [INFO] [stdout] 1165 | | } [INFO] [stdout] 1166 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 957 ~ #[derive(Default)] [INFO] [stdout] 958 ~ pub enum Displacement { [INFO] [stdout] 959 ~ #[default] [INFO] [stdout] 960 ~ None, [INFO] [stdout] 961 | Rel8(u8), [INFO] [stdout] ... [INFO] [stdout] 1163 | } [INFO] [stdout] 1164 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `lhs` after checking its variant with `is_err` [INFO] [stdout] --> src/instruction.rs:1392:39 [INFO] [stdout] | [INFO] [stdout] 1389 | if lhs.is_err() { [INFO] [stdout] | --------------- help: try: `if let Ok() = lhs` [INFO] [stdout] ... [INFO] [stdout] 1392 | let lhs = lhs.expect("Should be Ok from conditional"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/instruction.rs:1451:26 [INFO] [stdout] | [INFO] [stdout] 1451 | _ => return false, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1451 - _ => return false, [INFO] [stdout] 1451 + _ => false, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `rules.get(0)` [INFO] [stdout] --> src/opcodes.rs:79:20 [INFO] [stdout] | [INFO] [stdout] 79 | let rule = rules.get(0).expect("Should be only one element"); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `rules.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: doc list item without indentation [INFO] [stdout] --> src/decode.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | /// is used in the creation of relative displacements or labels. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] = note: `#[warn(clippy::doc_lazy_continuation)]` on by default [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 56 | /// is used in the creation of relative displacements or labels. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/decode.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 59 | /// can be interpreted as an [Instruction] and returned as [Bytes]. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 59 | /// can be interpreted as an [Instruction] and returned as [Bytes]. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/decode.rs:154:20 [INFO] [stdout] | [INFO] [stdout] 154 | if !extensions.as_ref().is_some_and(|exts| exts.len() == 1) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `extensions.as_ref().is_none_or(|exts| exts.len() != 1)` [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/decode.rs:285:20 [INFO] [stdout] | [INFO] [stdout] 285 | if !extensions.as_ref().is_some_and(|exts| exts.len() == 2) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `extensions.as_ref().is_none_or(|exts| exts.len() != 2)` [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/decode.rs:376:20 [INFO] [stdout] | [INFO] [stdout] 376 | if !extensions.as_ref().is_some_and(|exts| exts.len() == 2) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `extensions.as_ref().is_none_or(|exts| exts.len() != 2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/decode.rs:67:12 [INFO] [stdout] | [INFO] [stdout] 67 | if bytes.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `bytes.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: useless conversion to the same type: `instruction::encoding::operands::Register` [INFO] [stdout] --> src/decode.rs:313:55 [INFO] [stdout] | [INFO] [stdout] 313 | instruction.add(Operand::Register(Register::from(modrm.1))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `Register::from()`: `modrm.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `instruction::encoding::operands::Register` [INFO] [stdout] --> src/decode.rs:332:55 [INFO] [stdout] | [INFO] [stdout] 332 | instruction.add(Operand::Register(Register::from(modrm.1))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `Register::from()`: `modrm.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `instruction::encoding::operands::Register` [INFO] [stdout] --> src/decode.rs:359:55 [INFO] [stdout] | [INFO] [stdout] 359 | instruction.add(Operand::Register(Register::from(modrm.1))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `Register::from()`: `modrm.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/decode.rs:584:9 [INFO] [stdout] | [INFO] [stdout] 584 | / match self { [INFO] [stdout] 585 | | Bytes::Uknown(_) | Bytes::_Illegal(_) | Bytes::None => false, [INFO] [stdout] 586 | | _ => true, [INFO] [stdout] 587 | | } [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] 584 - match self { [INFO] [stdout] 585 - Bytes::Uknown(_) | Bytes::_Illegal(_) | Bytes::None => false, [INFO] [stdout] 586 - _ => true, [INFO] [stdout] 587 - } [INFO] [stdout] 584 + !matches!(self, Bytes::Uknown(_) | Bytes::_Illegal(_) | Bytes::None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/decode.rs:617:65 [INFO] [stdout] | [INFO] [stdout] 617 | Bytes::Uknown(byte) | Bytes::_Illegal(byte) => vec![byte.clone()], [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*byte` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/decode.rs:634:1 [INFO] [stdout] | [INFO] [stdout] 634 | / impl Default for Bytes { [INFO] [stdout] 635 | | fn default() -> Self { [INFO] [stdout] 636 | | Bytes::None [INFO] [stdout] 637 | | } [INFO] [stdout] 638 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 37 + #[derive(Default)] [INFO] [stdout] 38 | pub enum Bytes { [INFO] [stdout] 39 | /// Bytes representing a decoded instruction. [INFO] [stdout] ... [INFO] [stdout] 49 | _Illegal(u8), [INFO] [stdout] 50 ~ #[default] [INFO] [stdout] 51 ~ None, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/decode.rs:672:10 [INFO] [stdout] | [INFO] [stdout] 672 | ) -> ( [INFO] [stdout] | __________^ [INFO] [stdout] 673 | | &'static str, [INFO] [stdout] 674 | | Option, [INFO] [stdout] 675 | | OpCode, [INFO] [stdout] ... | [INFO] [stdout] 678 | | Option, [INFO] [stdout] 679 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decode.rs:697:13 [INFO] [stdout] | [INFO] [stdout] 697 | return Err(DecodeError::InvalidAddressingMode); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 697 - return Err(DecodeError::InvalidAddressingMode); [INFO] [stdout] 697 + Err(DecodeError::InvalidAddressingMode) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `ext_set` after checking its variant with `is_some` [INFO] [stdout] --> src/decode.rs:790:30 [INFO] [stdout] | [INFO] [stdout] 789 | if ext_set.is_some() { [INFO] [stdout] | -------------------- help: try: `if let Some() = &ext_set` [INFO] [stdout] 790 | let extensions = ext_set.as_ref().expect("Should be some due to conditional"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `addr_mode` after checking its variant with `is_some` [INFO] [stdout] --> src/decode.rs:808:35 [INFO] [stdout] | [INFO] [stdout] 807 | if addr_mode.is_some() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = &addr_mode` [INFO] [stdout] 808 | let addressing_mode = addr_mode [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 809 | | .as_ref() [INFO] [stdout] 810 | | .expect("Should be some due to conditional"); [INFO] [stdout] | |____________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `extensions` after checking its variant with `is_some` [INFO] [stdout] --> src/decode.rs:824:30 [INFO] [stdout] | [INFO] [stdout] 823 | if op_encoding == OpEn::I && extensions.is_some() { [INFO] [stdout] | -------------------- the check is happening here [INFO] [stdout] 824 | let extensions = extensions.expect("Should be Some by virtue of above conditional"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decode.rs:830:25 [INFO] [stdout] | [INFO] [stdout] 830 | return Some(Register::AL); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 830 - return Some(Register::AL); [INFO] [stdout] 830 + Some(Register::AL) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decode.rs:832:25 [INFO] [stdout] | [INFO] [stdout] 832 | return Some(Register::AX); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 832 - return Some(Register::AX); [INFO] [stdout] 832 + Some(Register::AX) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decode.rs:834:25 [INFO] [stdout] | [INFO] [stdout] 834 | return Some(Register::EAX); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 834 - return Some(Register::EAX); [INFO] [stdout] 834 + Some(Register::EAX) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decode.rs:836:25 [INFO] [stdout] | [INFO] [stdout] 836 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 836 - return None; [INFO] [stdout] 836 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/decode.rs:851:9 [INFO] [stdout] | [INFO] [stdout] 851 | / match self.mnemonic() { [INFO] [stdout] 852 | | "call" | "jmp" | "jz" | "jnz" => true, [INFO] [stdout] 853 | | _ => false, [INFO] [stdout] 854 | | } [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] 851 - match self.mnemonic() { [INFO] [stdout] 852 - "call" | "jmp" | "jz" | "jnz" => true, [INFO] [stdout] 853 - _ => false, [INFO] [stdout] 854 - } [INFO] [stdout] 851 + matches!(self.mnemonic(), "call" | "jmp" | "jz" | "jnz") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decode.rs:904:13 [INFO] [stdout] | [INFO] [stdout] 904 | format!("{}", mnemonic) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `mnemonic.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/instruction.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | i.mnemonic = mnemonic; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `instruction::Instruction { mnemonic: mnemonic, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/instruction.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | let mut i = Instruction::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/instruction.rs:90:17 [INFO] [stdout] | [INFO] [stdout] 85 | / let offset = match o { [INFO] [stdout] 86 | | Operand::Displacement(displacement) => displacement.clone().into(), [INFO] [stdout] 87 | | Operand::Label(offset) => (*offset).clone(), [INFO] [stdout] 88 | | _ => panic!("Should be unreachable due to the filter"), [INFO] [stdout] 89 | | }; [INFO] [stdout] | |__________________- unnecessary `let` binding [INFO] [stdout] 90 | offset [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 85 ~ [INFO] [stdout] 86 ~ match o { [INFO] [stdout] 87 + Operand::Displacement(displacement) => displacement.clone().into(), [INFO] [stdout] 88 + Operand::Label(offset) => (*offset).clone(), [INFO] [stdout] 89 + _ => panic!("Should be unreachable due to the filter"), [INFO] [stdout] 90 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/instruction.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | / match self.mnemonic { [INFO] [stdout] 103 | | "call" | "jmp" | "jz" | "jnz" | "jne" => true, [INFO] [stdout] 104 | | _ => false, [INFO] [stdout] 105 | | } [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] 102 - match self.mnemonic { [INFO] [stdout] 103 - "call" | "jmp" | "jz" | "jnz" | "jne" => true, [INFO] [stdout] 104 - _ => false, [INFO] [stdout] 105 - } [INFO] [stdout] 102 + matches!(self.mnemonic, "call" | "jmp" | "jz" | "jnz" | "jne") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/instruction.rs:108:1 [INFO] [stdout] | [INFO] [stdout] 108 | / impl Default for Instruction { [INFO] [stdout] 109 | | fn default() -> Self { [INFO] [stdout] 110 | | Instruction { [INFO] [stdout] 111 | | prefix: None, [INFO] [stdout] ... | [INFO] [stdout] 116 | | } [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] 46 + #[derive(Default)] [INFO] [stdout] 47 | pub struct Instruction { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RMI` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:169:5 [INFO] [stdout] | [INFO] [stdout] 169 | RMI, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Rmi` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/instruction.rs:174:9 [INFO] [stdout] | [INFO] [stdout] 174 | / match self { [INFO] [stdout] 175 | | OpEn::RM | OpEn::MR | OpEn::MI | OpEn::M | OpEn::M1 | OpEn::RMI => true, [INFO] [stdout] 176 | | _ => false, [INFO] [stdout] 177 | | } [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] 174 - match self { [INFO] [stdout] 175 - OpEn::RM | OpEn::MR | OpEn::MI | OpEn::M | OpEn::M1 | OpEn::RMI => true, [INFO] [stdout] 176 - _ => false, [INFO] [stdout] 177 - } [INFO] [stdout] 174 + matches!(self, OpEn::RM | OpEn::MR | OpEn::MI | OpEn::M | OpEn::M1 | OpEn::RMI) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `ModBits` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:283:14 [INFO] [stdout] | [INFO] [stdout] 283 | (self.0.clone(), self.1.clone(), self.2.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Register` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:283:30 [INFO] [stdout] | [INFO] [stdout] 283 | (self.0.clone(), self.1.clone(), self.2.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Register` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:283:46 [INFO] [stdout] | [INFO] [stdout] 283 | (self.0.clone(), self.1.clone(), self.2.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `sib` after checking its variant with `is_some` [INFO] [stdout] --> src/instruction.rs:315:39 [INFO] [stdout] | [INFO] [stdout] 314 | if sib.is_some() { [INFO] [stdout] | ---------------- help: try: `if let Some() = sib` [INFO] [stdout] 315 | let sib = sib.expect("Is some due to conditional"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/instruction.rs:330:48 [INFO] [stdout] | [INFO] [stdout] 330 | if self.2 == Register::ESP { [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 331 | | 1 /* SIB w/ disp8*/ [INFO] [stdout] 332 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/instruction.rs:332:28 [INFO] [stdout] | [INFO] [stdout] 332 | } else { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 333 | | 1 [INFO] [stdout] 334 | | } [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/instruction.rs:337:48 [INFO] [stdout] | [INFO] [stdout] 337 | if self.2 == Register::ESP { [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 338 | | 4 /*SIB w/ disp32*/ [INFO] [stdout] 339 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/instruction.rs:339:28 [INFO] [stdout] | [INFO] [stdout] 339 | } else { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 340 | | 4 [INFO] [stdout] 341 | | } [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: this operation has no effect [INFO] [stdout] --> src/instruction.rs:375:45 [INFO] [stdout] | [INFO] [stdout] 375 | let rmbits = Register::try_from((value & 0b00000111) >> 0)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `((value & 0b00000111))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `ModBits` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:381:27 [INFO] [stdout] | [INFO] [stdout] 381 | let modbits = value.0.clone() as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `value.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Register` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:382:27 [INFO] [stdout] | [INFO] [stdout] 382 | let regbits = value.1.clone() as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `value.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Register` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:383:26 [INFO] [stdout] | [INFO] [stdout] 383 | let rmbits = value.2.clone() as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `value.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/instruction.rs:385:47 [INFO] [stdout] | [INFO] [stdout] 385 | (modbits << 6) | (regbits << 3) | (rmbits << 0) [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider reducing it to: `rmbits` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Register` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:407:13 [INFO] [stdout] | [INFO] [stdout] 407 | self.1.clone() [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Register` which implements the `Copy` trait [INFO] [stdout] --> src/instruction.rs:410:13 [INFO] [stdout] | [INFO] [stdout] 410 | self.2.clone() [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constructor `sib` has the same name as the type [INFO] [stdout] --> src/instruction.rs:418:9 [INFO] [stdout] | [INFO] [stdout] 418 | / pub fn sib(bytes: &[u8], idx: usize) -> Result { [INFO] [stdout] 419 | | let Some(sib) = bytes.get(idx) else { [INFO] [stdout] 420 | | error!("Unable to create Sib. Bytes length incorrect"); [INFO] [stdout] 421 | | return Err(DecodeError::InvalidLength); [INFO] [stdout] 422 | | }; [INFO] [stdout] 423 | | Sib::try_from(*sib) [INFO] [stdout] 424 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructors [INFO] [stdout] = note: `#[warn(clippy::self_named_constructors)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/instruction.rs:432:43 [INFO] [stdout] | [INFO] [stdout] 432 | let base = Register::try_from((value & 0b00000111) >> 0)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `((value & 0b00000111))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/instruction.rs:542:25 [INFO] [stdout] | [INFO] [stdout] 542 | !(scale == Scale::One && !use_base_register) && modrm.uses_displacement(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(use_base_register || scale != Scale::One) && modrm.uses_displacement()` [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/instruction.rs:542:25 [INFO] [stdout] | [INFO] [stdout] 542 | !(scale == Scale::One && !use_base_register) && modrm.uses_displacement(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `scale != Scale::One || use_base_register` [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: useless use of `format!` [INFO] [stdout] --> src/instruction.rs:764:21 [INFO] [stdout] | [INFO] [stdout] 764 | format!("") [INFO] [stdout] | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EAX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:867:13 [INFO] [stdout] | [INFO] [stdout] 867 | EAX = 0, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Eax` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ECX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:868:13 [INFO] [stdout] | [INFO] [stdout] 868 | ECX = 1, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Ecx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EDX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:869:13 [INFO] [stdout] | [INFO] [stdout] 869 | EDX = 2, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Edx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EBX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:870:13 [INFO] [stdout] | [INFO] [stdout] 870 | EBX = 3, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Ebx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ESP` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:871:13 [INFO] [stdout] | [INFO] [stdout] 871 | ESP = 4, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Esp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EBP` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:872:13 [INFO] [stdout] | [INFO] [stdout] 872 | EBP = 5, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Ebp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ESI` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:873:13 [INFO] [stdout] | [INFO] [stdout] 873 | ESI = 6, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Esi` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EDI` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:874:13 [INFO] [stdout] | [INFO] [stdout] 874 | EDI = 7, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Edi` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RAX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:880:13 [INFO] [stdout] | [INFO] [stdout] 880 | RAX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Rax` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RBX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:884:13 [INFO] [stdout] | [INFO] [stdout] 884 | RBX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Rbx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RCX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:888:13 [INFO] [stdout] | [INFO] [stdout] 888 | RCX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Rcx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RDX` contains a capitalized acronym [INFO] [stdout] --> src/instruction.rs:892:13 [INFO] [stdout] | [INFO] [stdout] 892 | RDX, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Rdx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/instruction.rs:982:21 [INFO] [stdout] | [INFO] [stdout] 982 | format!("") [INFO] [stdout] | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u32` -> `u32`) [INFO] [stdout] --> src/instruction.rs:1046:36 [INFO] [stdout] | [INFO] [stdout] 1046 | let base = base as u32 + 4 /*bytes*/; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `base` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u32` -> `u32`) [INFO] [stdout] --> src/instruction.rs:1118:56 [INFO] [stdout] | [INFO] [stdout] 1118 | let target = displacement as u32 + base as u32; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `base` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u32` -> `u32`) [INFO] [stdout] --> src/instruction.rs:1150:34 [INFO] [stdout] | [INFO] [stdout] 1150 | let target = displacement as u32 + base as u32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `displacement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u32` -> `u32`) [INFO] [stdout] --> src/instruction.rs:1150:56 [INFO] [stdout] | [INFO] [stdout] 1150 | let target = displacement as u32 + base as u32; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `base` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/instruction.rs:1162:9 [INFO] [stdout] | [INFO] [stdout] 1162 | / impl Default for Displacement { [INFO] [stdout] 1163 | | fn default() -> Self { [INFO] [stdout] 1164 | | Displacement::None [INFO] [stdout] 1165 | | } [INFO] [stdout] 1166 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 957 ~ #[derive(Default)] [INFO] [stdout] 958 ~ pub enum Displacement { [INFO] [stdout] 959 ~ #[default] [INFO] [stdout] 960 ~ None, [INFO] [stdout] 961 | Rel8(u8), [INFO] [stdout] ... [INFO] [stdout] 1163 | } [INFO] [stdout] 1164 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `lhs` after checking its variant with `is_err` [INFO] [stdout] --> src/instruction.rs:1392:39 [INFO] [stdout] | [INFO] [stdout] 1389 | if lhs.is_err() { [INFO] [stdout] | --------------- help: try: `if let Ok() = lhs` [INFO] [stdout] ... [INFO] [stdout] 1392 | let lhs = lhs.expect("Should be Ok from conditional"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/instruction.rs:1451:26 [INFO] [stdout] | [INFO] [stdout] 1451 | _ => return false, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1451 - _ => return false, [INFO] [stdout] 1451 + _ => false, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `insert_line` after checking its variant with `is_some` [INFO] [stdout] --> src/output.rs:126:24 [INFO] [stdout] | [INFO] [stdout] 125 | if insert_line.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = insert_line` [INFO] [stdout] 126 | let line = insert_line.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/output.rs:127:45 [INFO] [stdout] | [INFO] [stdout] 127 | let l = line.get_or_insert_with(|| Line::default()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Line::default` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/output.rs:145:21 [INFO] [stdout] | [INFO] [stdout] 145 | let width = format!("{}", i.bytes()).len(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `i.bytes().to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `decode_attempt` after checking its variant with `is_ok` [INFO] [stdout] --> src/output.rs:251:29 [INFO] [stdout] | [INFO] [stdout] 250 | let instruction = if decode_attempt.is_ok() { [INFO] [stdout] | ------------------------- help: try: `if let Ok() = decode_attempt` [INFO] [stdout] 251 | decode_attempt.expect("Ok due to conditional") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `decode_attempt` after checking its variant with `is_ok` [INFO] [stdout] --> src/output.rs:290:47 [INFO] [stdout] | [INFO] [stdout] 288 | let instruction = if decode_attempt.is_ok() { [INFO] [stdout] | ------------------------- help: try: `if let Ok() = decode_attempt` [INFO] [stdout] 289 | debug!("Successfully decoded: {decode_attempt:?}"); [INFO] [stdout] 290 | let instruction = decode_attempt.expect("Ok due to conditional"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/output.rs:257:25 [INFO] [stdout] | [INFO] [stdout] 250 | / let instruction = if decode_attempt.is_ok() { [INFO] [stdout] 251 | | decode_attempt.expect("Ok due to conditional") [INFO] [stdout] 252 | | } else { [INFO] [stdout] 253 | | info!("Decode unsuccessful"); [INFO] [stdout] 254 | | continue; [INFO] [stdout] 255 | | }; [INFO] [stdout] | |__________________________- unnecessary `let` binding [INFO] [stdout] 256 | [INFO] [stdout] 257 | instruction [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 250 ~ [INFO] [stdout] 251 | [INFO] [stdout] 252 ~ if decode_attempt.is_ok() { [INFO] [stdout] 253 + decode_attempt.expect("Ok due to conditional") [INFO] [stdout] 254 + } else { [INFO] [stdout] 255 + info!("Decode unsuccessful"); [INFO] [stdout] 256 + continue; [INFO] [stdout] 257 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/output.rs:296:25 [INFO] [stdout] | [INFO] [stdout] 288 | / let instruction = if decode_attempt.is_ok() { [INFO] [stdout] 289 | | debug!("Successfully decoded: {decode_attempt:?}"); [INFO] [stdout] 290 | | let instruction = decode_attempt.expect("Ok due to conditional"); [INFO] [stdout] 291 | | instruction [INFO] [stdout] ... | [INFO] [stdout] 294 | | continue; [INFO] [stdout] 295 | | }; [INFO] [stdout] | |__________________________- unnecessary `let` binding [INFO] [stdout] 296 | instruction [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 288 ~ [INFO] [stdout] 289 ~ if decode_attempt.is_ok() { [INFO] [stdout] 290 + debug!("Successfully decoded: {decode_attempt:?}"); [INFO] [stdout] 291 + let instruction = decode_attempt.expect("Ok due to conditional"); [INFO] [stdout] 292 + instruction [INFO] [stdout] 293 + } else { [INFO] [stdout] 294 + info!("Decode unsuccessful"); [INFO] [stdout] 295 + continue; [INFO] [stdout] 296 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/output.rs:291:29 [INFO] [stdout] | [INFO] [stdout] 290 | ... let instruction = decode_attempt.expect("Ok due to conditional"); [INFO] [stdout] | ----------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 291 | ... instruction [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 290 ~ [INFO] [stdout] 291 ~ decode_attempt.expect("Ok due to conditional") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/output.rs:340:30 [INFO] [stdout] | [INFO] [stdout] 340 | let string = format!("{}", l.string_with_width(width)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `l.string_with_width(width).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/tests/instruction.rs:145:17 [INFO] [stdout] | [INFO] [stdout] 145 | assert!(bytes.len() >= 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!bytes.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:20:17 [INFO] [stdout] | [INFO] [stdout] 20 | let bytes = result.ok().expect("Error should have been handled above"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] = note: `#[warn(clippy::ok_expect)]` on by default [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 20 - let bytes = result.ok().expect("Error should have been handled above"); [INFO] [stdout] 20 + let bytes = result.expect("Error should have been handled above"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/output.rs:352:20 [INFO] [stdout] | [INFO] [stdout] 352 | let expected = vec!["00000000: 74 0F jz offset_00000018h"].join("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `["00000000: 74 0F jz offset_00000018h"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/output.rs:369:20 [INFO] [stdout] | [INFO] [stdout] 369 | let expected = vec![ [INFO] [stdout] | ____________________^ [INFO] [stdout] 370 | | "00000000: 58 pop eax", [INFO] [stdout] 371 | | "00000001: 8F db 0x8F", [INFO] [stdout] 372 | | "00000002: C0 db 0xC0", [INFO] [stdout] 373 | | ] [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 369 ~ let expected = ["00000000: 58 pop eax", [INFO] [stdout] 370 + "00000001: 8F db 0x8F", [INFO] [stdout] 371 + "00000002: C0 db 0xC0"] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/output.rs:395:20 [INFO] [stdout] | [INFO] [stdout] 395 | let expected = vec![ [INFO] [stdout] | ____________________^ [INFO] [stdout] 396 | | "00000000: 74 0F jz offset_00000018h", [INFO] [stdout] 397 | | "00000002: 01 D1 add ecx, edx", [INFO] [stdout] 398 | | //"00000004: 8B 4D 0C mov ecx,[ebp+0x0000000c]", [INFO] [stdout] 399 | | ] [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 395 ~ let expected = ["00000000: 74 0F jz offset_00000018h", [INFO] [stdout] 396 + "00000002: 01 D1 add ecx, edx"] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/output.rs:437:20 [INFO] [stdout] | [INFO] [stdout] 437 | let expected = vec![ [INFO] [stdout] | ____________________^ [INFO] [stdout] 438 | | "00000000: 74 0F jz offset_00000018h", [INFO] [stdout] 439 | | "offset_00000002h:", [INFO] [stdout] 440 | | "00000002: 01 D1 add ecx, edx", [INFO] [stdout] 441 | | ] [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 437 ~ let expected = ["00000000: 74 0F jz offset_00000018h", [INFO] [stdout] 438 + "offset_00000002h:", [INFO] [stdout] 439 + "00000002: 01 D1 add ecx, edx"] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `insert_line` after checking its variant with `is_some` [INFO] [stdout] --> src/output.rs:126:24 [INFO] [stdout] | [INFO] [stdout] 125 | if insert_line.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = insert_line` [INFO] [stdout] 126 | let line = insert_line.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/output.rs:127:45 [INFO] [stdout] | [INFO] [stdout] 127 | let l = line.get_or_insert_with(|| Line::default()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Line::default` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/output.rs:145:21 [INFO] [stdout] | [INFO] [stdout] 145 | let width = format!("{}", i.bytes()).len(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `i.bytes().to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `decode_attempt` after checking its variant with `is_ok` [INFO] [stdout] --> src/output.rs:251:29 [INFO] [stdout] | [INFO] [stdout] 250 | let instruction = if decode_attempt.is_ok() { [INFO] [stdout] | ------------------------- help: try: `if let Ok() = decode_attempt` [INFO] [stdout] 251 | decode_attempt.expect("Ok due to conditional") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `expect` on `decode_attempt` after checking its variant with `is_ok` [INFO] [stdout] --> src/output.rs:290:47 [INFO] [stdout] | [INFO] [stdout] 288 | let instruction = if decode_attempt.is_ok() { [INFO] [stdout] | ------------------------- help: try: `if let Ok() = decode_attempt` [INFO] [stdout] 289 | debug!("Successfully decoded: {decode_attempt:?}"); [INFO] [stdout] 290 | let instruction = decode_attempt.expect("Ok due to conditional"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/output.rs:257:25 [INFO] [stdout] | [INFO] [stdout] 250 | / let instruction = if decode_attempt.is_ok() { [INFO] [stdout] 251 | | decode_attempt.expect("Ok due to conditional") [INFO] [stdout] 252 | | } else { [INFO] [stdout] 253 | | info!("Decode unsuccessful"); [INFO] [stdout] 254 | | continue; [INFO] [stdout] 255 | | }; [INFO] [stdout] | |__________________________- unnecessary `let` binding [INFO] [stdout] 256 | [INFO] [stdout] 257 | instruction [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 250 ~ [INFO] [stdout] 251 | [INFO] [stdout] 252 ~ if decode_attempt.is_ok() { [INFO] [stdout] 253 + decode_attempt.expect("Ok due to conditional") [INFO] [stdout] 254 + } else { [INFO] [stdout] 255 + info!("Decode unsuccessful"); [INFO] [stdout] 256 + continue; [INFO] [stdout] 257 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/output.rs:296:25 [INFO] [stdout] | [INFO] [stdout] 288 | / let instruction = if decode_attempt.is_ok() { [INFO] [stdout] 289 | | debug!("Successfully decoded: {decode_attempt:?}"); [INFO] [stdout] 290 | | let instruction = decode_attempt.expect("Ok due to conditional"); [INFO] [stdout] 291 | | instruction [INFO] [stdout] ... | [INFO] [stdout] 294 | | continue; [INFO] [stdout] 295 | | }; [INFO] [stdout] | |__________________________- unnecessary `let` binding [INFO] [stdout] 296 | instruction [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 288 ~ [INFO] [stdout] 289 ~ if decode_attempt.is_ok() { [INFO] [stdout] 290 + debug!("Successfully decoded: {decode_attempt:?}"); [INFO] [stdout] 291 + let instruction = decode_attempt.expect("Ok due to conditional"); [INFO] [stdout] 292 + instruction [INFO] [stdout] 293 + } else { [INFO] [stdout] 294 + info!("Decode unsuccessful"); [INFO] [stdout] 295 + continue; [INFO] [stdout] 296 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/output.rs:291:29 [INFO] [stdout] | [INFO] [stdout] 290 | ... let instruction = decode_attempt.expect("Ok due to conditional"); [INFO] [stdout] | ----------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 291 | ... instruction [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 290 ~ [INFO] [stdout] 291 ~ decode_attempt.expect("Ok due to conditional") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/output.rs:340:30 [INFO] [stdout] | [INFO] [stdout] 340 | let string = format!("{}", l.string_with_width(width)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `l.string_with_width(width).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:20:17 [INFO] [stdout] | [INFO] [stdout] 20 | let bytes = result.ok().expect("Error should have been handled above"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] = note: `#[warn(clippy::ok_expect)]` on by default [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 20 - let bytes = result.ok().expect("Error should have been handled above"); [INFO] [stdout] 20 + let bytes = result.expect("Error should have been handled above"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 25.24s [INFO] running `Command { std: "docker" "inspect" "e9d908d3b22eebc7ae10f035541fa40b59eaec1369ebd905fb70e9fb8084c0ec", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e9d908d3b22eebc7ae10f035541fa40b59eaec1369ebd905fb70e9fb8084c0ec", kill_on_drop: false }` [INFO] [stdout] e9d908d3b22eebc7ae10f035541fa40b59eaec1369ebd905fb70e9fb8084c0ec