From 1ef05d71ed3e2ff8b774fbc29bc4e0a7429d96cd Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Thu, 10 Jun 2021 14:29:59 +0300 Subject: [PATCH] Strip custom sections in wasm-prune (#150) * strip custom sections * line width --- src/optimizer.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/optimizer.rs b/src/optimizer.rs index 2d7b429..16854aa 100644 --- a/src/optimizer.rs +++ b/src/optimizer.rs @@ -330,6 +330,10 @@ pub fn optimize( } } + // Also drop all custom sections + module.sections_mut() + .retain(|section| if let elements::Section::Custom(_) = section { false } else { true }); + Ok(()) }