clippy --fix fixes

This commit is contained in:
Folkert 2023-04-21 12:05:51 +02:00
parent 9973d4b8d2
commit 4cd8f0a056
57 changed files with 366 additions and 374 deletions

View file

@ -948,7 +948,7 @@ impl<'a, I: ImportDispatcher> Instance<'a, I> {
let memory_index = self.fetch_immediate_u32(module);
assert_eq!(memory_index, 0);
let old_bytes = self.memory.len() as u32;
let old_pages = old_bytes / MemorySection::PAGE_SIZE as u32;
let old_pages = old_bytes / MemorySection::PAGE_SIZE;
let grow_pages = self.value_store.pop_u32()?;
let grow_bytes = grow_pages * MemorySection::PAGE_SIZE;
let new_bytes = old_bytes + grow_bytes;
@ -1700,7 +1700,7 @@ impl<'a, I: ImportDispatcher> Instance<'a, I> {
} else {
// For calls, we print special debug stuff in do_call
let base = self.current_frame.locals_start + self.current_frame.locals_count;
let slice = self.value_store.get_slice(base as usize);
let slice = self.value_store.get_slice(base);
eprintln!("{:06x} {:17} {:x?}", file_offset, debug_string, slice);
}
let is_return = op_code == RETURN || (op_code == END && implicit_return);

View file

@ -37,7 +37,7 @@ fn test_loop_help(end: i32, expected: i32) {
// loop <void>
buf.push(OpCode::LOOP as u8);
buf.push(ValueType::VOID as u8);
buf.push(ValueType::VOID);
// local.get $i
buf.push(OpCode::GETLOCAL as u8);
@ -135,7 +135,7 @@ fn test_if_else_help(condition: i32, expected: i32) {
// if <blocktype>
buf.push(OpCode::IF as u8);
buf.push(ValueType::VOID as u8);
buf.push(ValueType::VOID);
// i32.const 111
buf.push(OpCode::I32CONST as u8);
@ -599,7 +599,7 @@ fn test_call_return_no_args() {
ValueType::I32 as u8,
OpCode::BLOCK as u8, /* */
// call from inside a block. callee's implicit return should still work correctly.
ValueType::VOID as u8,
ValueType::VOID,
OpCode::CALL as u8,
1, // function 1
OpCode::SETLOCAL as u8,