Add get_fn_metadata_list.

This commit is contained in:
Stephen Chung
2020-11-23 19:11:32 +08:00
parent 8d410dfc71
commit b43223a94f
6 changed files with 162 additions and 47 deletions

View File

@@ -97,11 +97,11 @@ impl Imports {
}
/// Get an iterator to this stack of imported modules in reverse order.
#[allow(dead_code)]
pub fn iter(&self) -> impl Iterator<Item = (&str, Shared<Module>)> {
pub fn iter<'a>(&'a self) -> impl Iterator<Item = (ImmutableString, Shared<Module>)> + 'a {
self.0.iter().flat_map(|lib| {
lib.iter()
.rev()
.map(|(name, module)| (name.as_str(), module.clone()))
.map(|(name, module)| (name.clone(), module.clone()))
})
}
/// Get an iterator to this stack of imported modules in reverse order.