diff --git a/avm-transpiler/src/instructions.rs b/avm-transpiler/src/instructions.rs index 4a51dad5570..f2e56b451eb 100644 --- a/avm-transpiler/src/instructions.rs +++ b/avm-transpiler/src/instructions.rs @@ -88,6 +88,7 @@ impl Default for AvmInstruction { } /// AVM instructions may include a type tag +#[allow(clippy::upper_case_acronyms, dead_code)] #[derive(Copy, Clone, Debug)] pub enum AvmTypeTag { UNINITIALIZED, diff --git a/avm-transpiler/src/opcodes.rs b/avm-transpiler/src/opcodes.rs index 44d2fa7cffe..17253127137 100644 --- a/avm-transpiler/src/opcodes.rs +++ b/avm-transpiler/src/opcodes.rs @@ -1,5 +1,6 @@ /// All AVM opcodes /// Keep updated with TS, cpp, and docs protocol specs! +#[allow(clippy::upper_case_acronyms, dead_code)] #[derive(PartialEq, Copy, Clone, Debug)] pub enum AvmOpcode { // Compute diff --git a/avm-transpiler/src/transpile.rs b/avm-transpiler/src/transpile.rs index d5368a3b0ef..79aaba337fc 100644 --- a/avm-transpiler/src/transpile.rs +++ b/avm-transpiler/src/transpile.rs @@ -425,7 +425,7 @@ fn handle_external_call( _ => panic!("Call instruction's success destination should be a basic MemoryAddress",), }; avm_instrs.push(AvmInstruction { - opcode: opcode, + opcode, // (left to right) // * selector direct // * success offset direct @@ -735,7 +735,7 @@ fn handle_send_l2_to_l1_msg( destinations: &Vec, inputs: &Vec, ) { - if destinations.len() != 0 || inputs.len() != 2 { + if !destinations.is_empty() || inputs.len() != 2 { panic!( "Transpiler expects ForeignCall::SENDL2TOL1MSG to have 0 destinations and 2 inputs, got {} and {}", destinations.len(), @@ -1268,10 +1268,7 @@ pub fn map_brillig_pcs_to_avm_pcs(brillig_bytecode: &[BrilligOpcode]) -> Vec bool { - match bit_size { - 1 | 8 | 16 | 32 | 64 | 128 => true, - _ => false, - } + matches!(bit_size, 1 | 8 | 16 | 32 | 64 | 128) } fn tag_from_bit_size(bit_size: u32) -> AvmTypeTag {