diff --git a/piecrust/src/imports.rs b/piecrust/src/imports.rs index aae5d8e0..4c375143 100644 --- a/piecrust/src/imports.rs +++ b/piecrust/src/imports.rs @@ -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( @@ -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); @@ -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;