Make scan_imports_raw public.

This commit is contained in:
Stephen Chung 2022-01-26 22:14:53 +08:00
parent c8357de1c8
commit 14e42f436f
2 changed files with 3 additions and 2 deletions

View File

@ -52,7 +52,8 @@ impl<'x, 'px, 'm, 'pm, 'pt> EvalContext<'_, 'x, 'px, 'm, 'pm, '_, '_, '_, '_, 'p
pub fn scope_mut(&mut self) -> &mut &'x mut Scope<'px> {
&mut self.scope
}
/// Get an iterator over the current set of modules imported via `import` statements.
/// Get an iterator over the current set of modules imported via `import` statements,
/// in reverse order (i.e. modules imported last come first).
#[cfg(not(feature = "no_module"))]
#[inline(always)]
pub fn iter_imports(&self) -> impl Iterator<Item = (&str, &Module)> {

View File

@ -147,7 +147,7 @@ impl GlobalRuntimeState<'_> {
/// Get an iterator to the stack of globally-imported [modules][Module] in forward order.
#[allow(dead_code)]
#[inline]
pub(crate) fn scan_imports_raw(&self) -> impl Iterator<Item = (&Identifier, &Shared<Module>)> {
pub fn scan_imports_raw(&self) -> impl Iterator<Item = (&Identifier, &Shared<Module>)> {
self.keys.iter().zip(self.modules.iter())
}
/// Does the specified function hash key exist in the stack of globally-imported [modules][Module]?