From ef4dbf261d13a72931887dad8db02d53a695a810 Mon Sep 17 00:00:00 2001 From: Henry Gressmann Date: Tue, 5 Dec 2023 23:45:45 +0100 Subject: feat: block stack, make cargofmt a bit more sane Signed-off-by: Henry Gressmann --- crates/parser/src/module.rs | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'crates/parser/src/module.rs') diff --git a/crates/parser/src/module.rs b/crates/parser/src/module.rs index 2beba9e..5bdbcd8 100644 --- a/crates/parser/src/module.rs +++ b/crates/parser/src/module.rs @@ -58,18 +58,12 @@ impl ModuleReader { use wasmparser::Payload::*; match payload { - Version { - num, - encoding, - range, - } => { + Version { num, encoding, range } => { validator.version(num, encoding, &range)?; self.version = Some(num); match encoding { wasmparser::Encoding::Module => {} - wasmparser::Encoding::Component => { - return Err(ParseError::InvalidEncoding(encoding)) - } + wasmparser::Encoding::Component => return Err(ParseError::InvalidEncoding(encoding)), } } StartSection { func, range } => { @@ -88,10 +82,7 @@ impl ModuleReader { FunctionSection(reader) => { debug!("Found function section"); validator.function_section(&reader)?; - self.function_section = reader - .into_iter() - .map(|f| Ok(f?)) - .collect::>>()?; + self.function_section = reader.into_iter().map(|f| Ok(f?)).collect::>>()?; } TableSection(_reader) => { return Err(ParseError::UnsupportedSection("Table section".into())); @@ -135,8 +126,7 @@ impl ModuleReader { debug!("Found code section entry"); validator.code_section_entry(&function)?; - self.code_section - .push(conversion::convert_module_code(function)?); + self.code_section.push(conversion::convert_module_code(function)?); } ImportSection(_reader) => { return Err(ParseError::UnsupportedSection("Import section".into())); @@ -166,9 +156,7 @@ impl ModuleReader { debug!("Found custom section"); debug!("Skipping custom section: {:?}", reader.name()); } - UnknownSection { .. } => { - return Err(ParseError::UnsupportedSection("Unknown section".into())) - } + UnknownSection { .. } => return Err(ParseError::UnsupportedSection("Unknown section".into())), section => { return Err(ParseError::UnsupportedSection(format!( "Unsupported section: {:?}", -- cgit v1.3.1