Skip to content

Commit

Permalink
fix wording in local/global docs (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Mart committed Jan 31, 2024
1 parent 912142f commit ada018d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/module/globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ impl ModuleGlobals {
})
}

/// Gets a reference to a memory given its id
/// Gets a reference to a global given its id
pub fn get(&self, id: GlobalId) -> &Global {
&self.arena[id]
}

/// Gets a reference to a memory given its id
/// Gets a reference to a global given its id
pub fn get_mut(&mut self, id: GlobalId) -> &mut Global {
&mut self.arena[id]
}
Expand Down
6 changes: 3 additions & 3 deletions src/module/locals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ impl ModuleLocals {
id
}

/// Get the local for an ID
/// Gets a reference to a local given its id
pub fn get(&self, id: LocalId) -> &Local {
&self.arena[id]
}

/// Get the set of locals for this module.
/// Gets a reference to a local given its id
pub fn get_mut(&mut self, id: LocalId) -> &mut Local {
&mut self.arena[id]
}

/// Get a shared reference to this module's globals.
/// Get a shared reference to this module's locals.
pub fn iter(&self) -> impl Iterator<Item = &Local> {
self.arena.iter().map(|(_, f)| f)
}
Expand Down

0 comments on commit ada018d

Please sign in to comment.