From 80cf746b50513af77203f382f5f53bd036087358 Mon Sep 17 00:00:00 2001 From: Henry Date: Sun, 12 Apr 2026 21:16:49 +0200 Subject: feat: remove lifetimes from runtime objects Signed-off-by: Henry --- crates/parser/src/conversion.rs | 4 ++-- crates/parser/src/module.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/parser/src') diff --git a/crates/parser/src/conversion.rs b/crates/parser/src/conversion.rs index dfd5415..63a42b2 100644 --- a/crates/parser/src/conversion.rs +++ b/crates/parser/src/conversion.rs @@ -86,7 +86,7 @@ pub(crate) fn convert_module_import(import: wasmparser::Import<'_>) -> Result ImportKind::Memory(convert_module_memory(ty)), wasmparser::TypeRef::Global(ty) => { - ImportKind::Global(GlobalType { mutable: ty.mutable, ty: convert_valtype(&ty.content_type) }) + ImportKind::Global(GlobalType::new(convert_valtype(&ty.content_type), ty.mutable)) } wasmparser::TypeRef::Tag(ty) => { return Err(crate::ParseError::UnsupportedOperator(format!("Unsupported import kind: {ty:?}"))); @@ -140,7 +140,7 @@ pub(crate) fn convert_module_globals( let global = global?; let ty = convert_valtype(&global.ty.content_type); let ops = global.init_expr.get_operators_reader(); - Ok(Global { init: process_const_operators(ops)?, ty: GlobalType { mutable: global.ty.mutable, ty } }) + Ok(Global { init: process_const_operators(ops)?, ty: GlobalType::new(ty, global.ty.mutable) }) }) .collect::>>() } diff --git a/crates/parser/src/module.rs b/crates/parser/src/module.rs index b53dfd6..8405c6d 100644 --- a/crates/parser/src/module.rs +++ b/crates/parser/src/module.rs @@ -158,9 +158,9 @@ impl ModuleReader { validator.end(offset)?; self.end_reached = true; } - Payload::CustomSection(_reader) => { + Payload::CustomSection(reader) => { debug!("Found custom section"); - debug!("Skipping custom section: {:?}", _reader.name()); + debug!("Skipping custom section: {:?}", reader.name()); } Payload::UnknownSection { .. } => return Err(ParseError::UnsupportedSection("Unknown section".into())), section => return Err(ParseError::UnsupportedSection(format!("Unsupported section: {section:?}"))), -- cgit v1.3.1