diff --git a/Cargo.toml b/Cargo.toml index fcb576e..2686bae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ rand = "0.8" wat = "1" wasmparser = "0.96" wasmprinter = "0.2" -wasmi = "0.20" +wasmi = "0.21" [features] default = ["std"] diff --git a/benches/benches.rs b/benches/benches.rs index 155bb18..a777028 100644 --- a/benches/benches.rs +++ b/benches/benches.rs @@ -28,7 +28,7 @@ where { for entry in read_dir(fixture_dir()).unwrap() { let entry = entry.unwrap(); - let bytes = read(&entry.path()).unwrap(); + let bytes = read(entry.path()).unwrap(); group.throughput(Throughput::Bytes(bytes.len().try_into().unwrap())); group.bench_with_input(entry.file_name().to_str().unwrap(), &bytes, |bench, input| { bench.iter(|| f(deserialize_buffer(input).unwrap())) diff --git a/src/stack_limiter/max_height.rs b/src/stack_limiter/max_height.rs index 4be939b..fc0a030 100644 --- a/src/stack_limiter/max_height.rs +++ b/src/stack_limiter/max_height.rs @@ -176,7 +176,7 @@ pub fn compute(func_idx: u32, module: &elements::Module) -> Result {}, Block(ty) | Loop(ty) | If(ty) => { - let end_arity = if *ty == BlockType::NoResult { 0 } else { 1 }; + let end_arity = u32::from(*ty != BlockType::NoResult); let branch_arity = if let Loop(_) = *opcode { 0 } else { end_arity }; if let If(_) = *opcode { stack.pop_values(1)?; diff --git a/tests/overhead.rs b/tests/overhead.rs index c629275..7a57a97 100644 --- a/tests/overhead.rs +++ b/tests/overhead.rs @@ -48,9 +48,9 @@ fn size_overheads_all(files: ReadDir) -> Vec { let (original_module_len, orig_module) = { let bytes = match entry.path().extension().unwrap().to_str() { - Some("wasm") => read(&entry.path()).unwrap(), + Some("wasm") => read(entry.path()).unwrap(), Some("wat") => - wat::parse_bytes(&read(&entry.path()).unwrap()).unwrap().into_owned(), + wat::parse_bytes(&read(entry.path()).unwrap()).unwrap().into_owned(), _ => panic!("expected fixture_dir containing .wasm or .wat files only"), };