Skip to content

Commit

Permalink
clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Oct 10, 2023
1 parent e333549 commit e335988
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
9 changes: 4 additions & 5 deletions contracts/foundry/foundrylike/src/test_adder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub trait TestAdder {
let adder = self.adder_address().get();

let mut adder_init_args = ManagedArgBuffer::new();
adder_init_args.push_arg(&value); // initial sum
adder_init_args.push_arg(value); // initial sum

// start a prank and call 'adder' from 'owner'
self.test_raw().start_prank(&owner);
Expand All @@ -102,9 +102,8 @@ pub trait TestAdder {
);
self.test_raw().stop_prank();

match res {
Result::Err(_) => panic!("call failed"),
Result::Ok(_) => (),
};
if res.is_err() {
panic!("call failed");
}
}
}
12 changes: 6 additions & 6 deletions contracts/foundry/test_multisig/src/test_multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ pub trait TestMultisigContract {
fn get_quorum(&self, multisig: &ManagedAddress) -> BigUint {
let bs = self
.test_raw()
.get_storage(&multisig, &ManagedBuffer::from(b"quorum"));
.get_storage(multisig, &ManagedBuffer::from(b"quorum"));
BigUint::from(bs)
}

fn get_num_board_members(&self, multisig: &ManagedAddress) -> BigUint {
let bs = self
.test_raw()
.get_storage(&multisig, &ManagedBuffer::from(b"num_board_members"));
.get_storage(multisig, &ManagedBuffer::from(b"num_board_members"));
BigUint::from(bs)
}

Expand Down Expand Up @@ -92,9 +92,9 @@ pub trait TestMultisigContract {
let mut args = ManagedArgBuffer::new();
args.push_arg(value);

self.test_raw().start_prank(&proposer);
self.test_raw().start_prank(proposer);
let _ = self.send_raw().direct_egld_execute(
&multisig,
multisig,
&BigUint::from(0u32),
5000000,
&ManagedBuffer::from(b"proposeChangeQuorum"),
Expand All @@ -109,7 +109,7 @@ pub trait TestMultisigContract {

self.test_raw().start_prank(signer);
let _ = self.send_raw().direct_egld_execute(
&multisig,
multisig,
&BigUint::from(0u32),
5000000,
&ManagedBuffer::from(b"sign"),
Expand All @@ -124,7 +124,7 @@ pub trait TestMultisigContract {

self.test_raw().start_prank(performer);
let _ = self.send_raw().direct_egld_execute(
&multisig,
multisig,
&BigUint::from(0u32),
5000000,
&ManagedBuffer::from(b"performAction"),
Expand Down
1 change: 0 additions & 1 deletion vm/src/mem_conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ where
f(bytes.as_ptr() as MemPtr, bytes.len() as MemLength)
}

#[allow(clippy::needless_pass_by_ref_mut)]
pub fn with_mem_ptr_mut<F, R>(bytes: &mut [u8], f: F) -> R
where
F: FnOnce(MemPtr, MemLength) -> R,
Expand Down

0 comments on commit e335988

Please sign in to comment.