feat(runtime-core) Instance.exports takes &self instead of &mut self.

There is no reason for `exports` to take a mutable reference.
This commit is contained in:
Ivan Enderlin
2019-04-10 12:17:16 -07:00
parent 80b809383e
commit 20297d1751
2 changed files with 4 additions and 4 deletions

View File

@ -40,13 +40,13 @@ impl FuncPointer {
} }
pub struct ExportIter<'a> { pub struct ExportIter<'a> {
inner: &'a mut InstanceInner, inner: &'a InstanceInner,
iter: hash_map::Iter<'a, String, ExportIndex>, iter: hash_map::Iter<'a, String, ExportIndex>,
module: &'a ModuleInner, module: &'a ModuleInner,
} }
impl<'a> ExportIter<'a> { impl<'a> ExportIter<'a> {
pub(crate) fn new(module: &'a ModuleInner, inner: &'a mut InstanceInner) -> Self { pub(crate) fn new(module: &'a ModuleInner, inner: &'a InstanceInner) -> Self {
Self { Self {
inner, inner,
iter: module.info.exports.iter(), iter: module.info.exports.iter(),

View File

@ -279,8 +279,8 @@ impl Instance {
/// Returns an iterator over all of the items /// Returns an iterator over all of the items
/// exported from this instance. /// exported from this instance.
pub fn exports(&mut self) -> ExportIter { pub fn exports(&self) -> ExportIter {
ExportIter::new(&self.module, &mut self.inner) ExportIter::new(&self.module, &self.inner)
} }
/// The module used to instantiate this Instance. /// The module used to instantiate this Instance.