From 534f58cc7cdaa069e36435766765384c14fc7675 Mon Sep 17 00:00:00 2001 From: angie Date: Sun, 28 Jan 2024 12:29:44 -0300 Subject: [PATCH] clippy --- .github/workflows/publish_crate.yml | 4 +++- rust/src/instruction.rs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_crate.yml b/.github/workflows/publish_crate.yml index cfdb8113..a72d4641 100644 --- a/.github/workflows/publish_crate.yml +++ b/.github/workflows/publish_crate.yml @@ -25,7 +25,9 @@ jobs: run: rustup component add clippy - name: Run clippy - run: cargo clippy --all-targets --all-features -- -D warnings + run: | + cargo clippy --version + cargo clippy --all-targets --all-features -- -D warnings - name: Build Rust package run: cargo build --release --workspace diff --git a/rust/src/instruction.rs b/rust/src/instruction.rs index 5708a712..f89f2452 100644 --- a/rust/src/instruction.rs +++ b/rust/src/instruction.rs @@ -458,14 +458,14 @@ impl Instruction { utils::shiftr(self.flags, 0, 2).try_into().unwrap() } pub fn flags_set_r5900_disasm_as_data(&mut self, value: utils::TrinaryValue) { - self.flags = utils::bitrepack(self.flags, value.try_into().unwrap(), 0, 2); + self.flags = utils::bitrepack(self.flags, value.into(), 0, 2); } pub fn flags_get_r5900_use_dollar(&self) -> utils::TrinaryValue { utils::shiftr(self.flags, 2, 2).try_into().unwrap() } pub fn flags_set_r5900_use_dollar(&mut self, value: utils::TrinaryValue) { - self.flags = utils::bitrepack(self.flags, value.try_into().unwrap(), 2, 2); + self.flags = utils::bitrepack(self.flags, value.into(), 2, 2); } pub fn instr_id_type_name(&self) -> &'static str {