Satisfy clippy

This commit is contained in:
Rerumu 2021-11-27 04:14:12 -05:00
parent 820588b5e7
commit 185799eecc
2 changed files with 5 additions and 5 deletions

View File

@ -387,11 +387,11 @@ impl<'a> Transformer<'a> {
} }
fn new_if(&mut self, cond: Expression, list: &mut &[Instruction]) -> If { fn new_if(&mut self, cond: Expression, list: &mut &[Instruction]) -> If {
let copied = list.clone(); let copied = <&[Instruction]>::clone(list);
let truthy = self.new_stored_body(list); let truthy = self.new_stored_body(list);
let last = copied.len() - list.len() - 1; let end = copied.len() - list.len() - 1;
let falsey = is_else_stat(&copied[last]).then(|| self.new_stored_body(list)); let falsey = is_else_stat(&copied[end]).then(|| self.new_stored_body(list));
If { If {
cond, cond,

View File

@ -267,7 +267,7 @@ impl<'a> Module<'a> {
write!(w, "}} end ") write!(w, "}} end ")
} }
fn gen_localize(&self, func_list: &[Function], w: &mut dyn Write) -> Result<()> { fn gen_localize(func_list: &[Function], w: &mut dyn Write) -> Result<()> {
let mut loc_set = BTreeSet::new(); let mut loc_set = BTreeSet::new();
for func in func_list { for func in func_list {
@ -286,7 +286,7 @@ impl<'a> Module<'a> {
.map(|i| Transformer::new(self.wasm, &self.arity, i).consume()) .map(|i| Transformer::new(self.wasm, &self.arity, i).consume())
.collect(); .collect();
self.gen_localize(&func_list, w)?; Self::gen_localize(&func_list, w)?;
gen_nil_array("FUNC_LIST", self.wasm.functions_space(), w)?; gen_nil_array("FUNC_LIST", self.wasm.functions_space(), w)?;
gen_nil_array("TABLE_LIST", self.wasm.table_space(), w)?; gen_nil_array("TABLE_LIST", self.wasm.table_space(), w)?;