From 06f81026eca6446d737e3759951ca15001a819c5 Mon Sep 17 00:00:00 2001 From: Henry Gressmann Date: Mon, 12 Aug 2024 16:12:07 +0200 Subject: chore: clean up code Signed-off-by: Henry Gressmann --- crates/parser/src/module.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/parser/src/module.rs') diff --git a/crates/parser/src/module.rs b/crates/parser/src/module.rs index 74da1d9..20ed00d 100644 --- a/crates/parser/src/module.rs +++ b/crates/parser/src/module.rs @@ -168,12 +168,12 @@ impl ModuleReader { validator.end(offset)?; self.end_reached = true; } - CustomSection(_reader) => { + CustomSection(reader) => { debug!("Found custom section"); - debug!("Skipping custom section: {:?}", _reader.name()); + debug!("Skipping custom section: {:?}", reader.name()); } UnknownSection { .. } => return Err(ParseError::UnsupportedSection("Unknown section".into())), - section => return Err(ParseError::UnsupportedSection(format!("Unsupported section: {:?}", section))), + section => return Err(ParseError::UnsupportedSection(format!("Unsupported section: {section:?}"))), }; Ok(()) @@ -196,7 +196,7 @@ impl ModuleReader { .map(|((instructions, locals), ty_idx)| { let mut params = ValueCountsSmall::default(); let ty = self.func_types.get(ty_idx as usize).expect("No func type for func, this is a bug").clone(); - for param in ty.params.iter() { + for param in &ty.params { match param { ValType::I32 | ValType::F32 => params.c32 += 1, ValType::I64 | ValType::F64 => params.c64 += 1, @@ -204,7 +204,7 @@ impl ModuleReader { ValType::RefExtern | ValType::RefFunc => params.cref += 1, } } - WasmFunction { instructions, params, locals, ty } + WasmFunction { instructions, locals, params, ty } }) .collect::>() .into_boxed_slice(); -- cgit v1.3.1