Skip to content

Commit

Permalink
chore: fix linter issues in AVM (AztecProtocol#6057)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench authored May 15, 2024
1 parent ed6df8e commit c2e72b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions avm-transpiler/src/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions avm-transpiler/src/opcodes.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 3 additions & 6 deletions avm-transpiler/src/transpile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -735,7 +735,7 @@ fn handle_send_l2_to_l1_msg(
destinations: &Vec<ValueOrArray>,
inputs: &Vec<ValueOrArray>,
) {
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(),
Expand Down Expand Up @@ -1268,10 +1268,7 @@ pub fn map_brillig_pcs_to_avm_pcs(brillig_bytecode: &[BrilligOpcode]) -> Vec<usi
}

fn is_integral_bit_size(bit_size: u32) -> 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 {
Expand Down

0 comments on commit c2e72b1

Please sign in to comment.