From a6511071048873786fd3c14733e0beb5bc163e9f Mon Sep 17 00:00:00 2001 From: Dennis Ranke Date: Sun, 3 Sep 2023 10:19:30 +0200 Subject: [PATCH] add start and snd functions to filter exports exclude list --- uw8-tool/src/filter_exports.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/uw8-tool/src/filter_exports.rs b/uw8-tool/src/filter_exports.rs index 00f96c9..a59d622 100644 --- a/uw8-tool/src/filter_exports.rs +++ b/uw8-tool/src/filter_exports.rs @@ -1,13 +1,17 @@ -use std::path::Path; use anyhow::Result; +use std::path::Path; pub fn filter_exports(in_path: &Path, out_path: &Path) -> Result<()> { let mut module = walrus::Module::from_file(in_path)?; - let exports_to_delete: Vec<_> = module.exports.iter().filter_map(|export| match export.name.as_str() { - "upd" => None, - _ => Some(export.id()) - }).collect(); + let exports_to_delete: Vec<_> = module + .exports + .iter() + .filter_map(|export| match export.name.as_str() { + "start" | "upd" | "snd" => None, + _ => Some(export.id()), + }) + .collect(); for id in exports_to_delete { module.exports.delete(id); @@ -18,4 +22,4 @@ pub fn filter_exports(in_path: &Path, out_path: &Path) -> Result<()> { module.emit_wasm_file(out_path)?; Ok(()) -} \ No newline at end of file +}