Make clippy happy again
This commit is contained in:
parent
740cfd9b4c
commit
babb4f0af1
@ -683,11 +683,14 @@ impl<'a> LuaJIT<'a> {
|
||||
|
||||
/// # Errors
|
||||
/// Returns `Err` if writing to `Writer` failed.
|
||||
///
|
||||
/// # Panics
|
||||
/// If the number of functions overflows 32 bits.
|
||||
pub fn gen_func_list(&self, func_list: &[Function], w: Writer) -> Result<()> {
|
||||
let o = self.arity.len_ex();
|
||||
|
||||
func_list.iter().enumerate().try_for_each(|(i, v)| {
|
||||
write_func_name(self.wasm, i as u32, o as u32, w)?;
|
||||
write_func_name(self.wasm, i.try_into().unwrap(), o.try_into().unwrap(), w)?;
|
||||
|
||||
v.visit(&mut Visitor::default(), w)
|
||||
})
|
||||
|
@ -694,7 +694,7 @@ impl<'a> Luau<'a> {
|
||||
let o = self.arity.len_ex();
|
||||
|
||||
func_list.iter().enumerate().try_for_each(|(i, v)| {
|
||||
write_func_name(self.wasm, i as u32, o as u32, w)?;
|
||||
write_func_name(self.wasm, i.try_into().unwrap(), o.try_into().unwrap(), w)?;
|
||||
|
||||
v.visit(&mut Visitor::default(), w)
|
||||
})
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::{io::Result, ops::Range};
|
||||
|
||||
use parity_wasm::elements::{Internal, Module, ResizableLimits};
|
||||
use parity_wasm::elements::{Internal, Module, NameSection, ResizableLimits};
|
||||
|
||||
use crate::ast::node::Function;
|
||||
|
||||
@ -36,7 +36,7 @@ pub fn write_memory_init(limit: &ResizableLimits, w: Writer) -> Result<()> {
|
||||
pub fn write_func_name(wasm: &Module, index: u32, offset: u32, w: Writer) -> Result<()> {
|
||||
let opt = wasm
|
||||
.names_section()
|
||||
.and_then(|v| v.functions())
|
||||
.and_then(NameSection::functions)
|
||||
.and_then(|v| v.names().get(index));
|
||||
|
||||
write!(w, "FUNC_LIST")?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user