diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-08-12 16:12:07 +0200 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2024-08-12 16:12:07 +0200 |
| commit | 06f81026eca6446d737e3759951ca15001a819c5 (patch) | |
| tree | e06d747eb225cac6e24557faa2694895d52741ae /crates/parser/src/module.rs | |
| parent | d33a0c66a17316755e572b3620fb030ec1e52f61 (diff) | |
chore: clean up code
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser/src/module.rs')
| -rw-r--r-- | crates/parser/src/module.rs | 10 |
1 files changed, 5 insertions, 5 deletions
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::<Vec<_>>() .into_boxed_slice(); |
