Uncomment code

This commit is contained in:
Syrus Akbary
2021-07-14 03:55:49 -07:00
parent bfbd08871c
commit 8c7ba3740c

View File

@@ -236,13 +236,13 @@ impl<'a, I> ExportsIterator<'a, I>
where
I: Iterator<Item = (&'a String, &'a Extern)> + Sized,
{
// /// Get only the functions.
// pub fn functions(self) -> impl Iterator<Item = (&'a String, &'a Function)> + Sized {
// self.iter.filter_map(|(name, export)| match export {
// Extern::Function(function) => Some((name, function)),
// _ => None,
// })
// }
/// Get only the functions.
pub fn functions(self) -> impl Iterator<Item = (&'a String, &'a Function)> + Sized {
self.iter.filter_map(|(name, export)| match export {
Extern::Function(function) => Some((name, function)),
_ => None,
})
}
/// Get only the memories.
pub fn memories(self) -> impl Iterator<Item = (&'a String, &'a Memory)> + Sized {
@@ -252,21 +252,21 @@ where
})
}
// /// Get only the globals.
// pub fn globals(self) -> impl Iterator<Item = (&'a String, &'a Global)> + Sized {
// self.iter.filter_map(|(name, export)| match export {
// Extern::Global(global) => Some((name, global)),
// _ => None,
// })
// }
/// Get only the globals.
pub fn globals(self) -> impl Iterator<Item = (&'a String, &'a Global)> + Sized {
self.iter.filter_map(|(name, export)| match export {
Extern::Global(global) => Some((name, global)),
_ => None,
})
}
// /// Get only the tables.
// pub fn tables(self) -> impl Iterator<Item = (&'a String, &'a Table)> + Sized {
// self.iter.filter_map(|(name, export)| match export {
// Extern::Table(table) => Some((name, table)),
// _ => None,
// })
// }
/// Get only the tables.
pub fn tables(self) -> impl Iterator<Item = (&'a String, &'a Table)> + Sized {
self.iter.filter_map(|(name, export)| match export {
Extern::Table(table) => Some((name, table)),
_ => None,
})
}
}
impl FromIterator<(String, Extern)> for Exports {