diff --git a/piecrust/src/session.rs b/piecrust/src/session.rs index 0b81bdbe..e5e940c6 100644 --- a/piecrust/src/session.rs +++ b/piecrust/src/session.rs @@ -761,7 +761,7 @@ impl Session { io: Arc::new(err), })?; - let arg_len = instance.write_bytes_to_arg_buffer(&fdata); + let arg_len = instance.write_bytes_to_arg_buffer(&fdata)?; instance.clear_arg_buffer_b(); let ret_len = instance .call(fname, arg_len, limit) @@ -779,7 +779,7 @@ impl Session { .map_err(Error::normalize)?; let ret = instance.read_bytes_from_arg_buffer(ret_len as u32); let ret_b = instance.read_from_arg_buffer_b(); - let allowance = *ret_b.get(0).unwrap_or(&0u64); + let allowance = *ret_b.first().unwrap_or(&0u64); let charge = *ret_b.get(1).unwrap_or(&0u64); let mut spent = limit - instance.get_remaining_gas();