Skip to content

Commit

Permalink
piecrust: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
miloszm committed Apr 10, 2024
1 parent 7062a00 commit 2e9c763
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions piecrust/src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ pub(crate) fn c(

let with_memory = |memory: &mut [u8]| -> Result<_, Error> {
let arg_buf = &memory[argbuf_ofs..][..ARGBUF_LEN];
let arg_buf_b = &memory[argbuf_b_ofs..][..ARGBUF_B_LEN as usize];
let arg_buf_b = &memory[argbuf_b_ofs..][..ARGBUF_B_LEN];

let mut mod_id = ContractId::uninitialized();
mod_id.as_bytes_mut().copy_from_slice(
Expand All @@ -252,7 +252,7 @@ pub(crate) fn c(
let name = core::str::from_utf8(&memory[name_ofs..][..name_len])?;

let arg = &arg_buf[..arg_len as usize];
let arg_b = &arg_buf_b[..ARGBUF_B_LEN as usize];
let arg_b = &arg_buf_b[..ARGBUF_B_LEN];

callee.write_argument(arg);
callee.write_argument_b(arg_b);
Expand All @@ -263,9 +263,7 @@ pub(crate) fn c(

// copy back result
callee.read_argument(&mut memory[argbuf_ofs..][..ret_len as usize]);
callee.read_argument_b(
&mut memory[argbuf_b_ofs..][..ARGBUF_B_LEN as usize],
);
callee.read_argument_b(&mut memory[argbuf_b_ofs..][..ARGBUF_B_LEN]);

let callee_remaining = callee.get_remaining_gas();
let callee_spent = callee_limit - callee_remaining;
Expand Down

0 comments on commit 2e9c763

Please sign in to comment.