fn trim_exports(&self, module: &mut Module) -> bool {
        if let Some(section) = module.export_section_mut() {
            let new_section = ExportSection::with_entries(
                section
                    .entries()
                    .iter()
                    .cloned()
                    .filter(|entry| self.whitelist.lookup(entry))
                    .collect(),
            );

            if new_section.entries().len() < section.entries().len() {
                *section = new_section;
                return true;
            }

            false
        } else {
            false
        }
    }
/// Iterates over the export section, if there is one, and removes
/// unnecessary entries.
Iterates over the export section, if there is one, and removes
unnecessary entries.
Iterates over the export section if there is one and removes unnecessary entries .
fn trim_exports(&self, module: &mut Module) -> bool {
        if let Some(section) = module.export_section_mut() {
            let new_section = ExportSection::with_entries(
                section
                    .entries()
                    .iter()
                    .cloned()
                    .filter(|entry| self.whitelist.lookup(entry))
                    .collect(),
            );
            if new_section.entries().len() < section.entries().len() {
                *section = new_section;
                return true;
            }
            false
        } else {
            false
        }
    }
fn trim_exports ( & self , module : & mut Module ) -> bool { if let Some ( section ) = module . export_section_mut ( ) { let new_section = ExportSection :: with_entries ( section . entries ( ) . iter ( ) . cloned ( ) . filter ( | entry | self . whitelist . lookup ( entry ) ) . collect ( ) , ) ; if new_section . entries ( ) . len ( ) < section . entries ( ) . len ( ) { * section = new_section ; return true ; } false } else { false } }
Iterates over the export section, if there is one, and removes
unnecessary entries.
Iterates over the export section if there is one and removes unnecessary entries .
&self
module
&mut Module