mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
make with_module_exposed_type read-only
This commit is contained in:
parent
b72c8705e5
commit
4f14c0a8ea
1 changed files with 4 additions and 4 deletions
|
@ -51,12 +51,12 @@ impl WorldAbilities {
|
|||
|
||||
#[inline(always)]
|
||||
pub fn with_module_exposed_type<T>(
|
||||
&mut self,
|
||||
&self,
|
||||
module: ModuleId,
|
||||
mut f: impl FnMut(&mut ExposedTypesStorageSubs) -> T,
|
||||
mut f: impl FnMut(&ExposedTypesStorageSubs) -> T,
|
||||
) -> T {
|
||||
let mut world = self.world.write().unwrap();
|
||||
let (_, exposed_types) = world.get_mut(&module).expect("module not in the world");
|
||||
let world = self.world.read().unwrap();
|
||||
let (_, exposed_types) = world.get(&module).expect("module not in the world");
|
||||
|
||||
f(exposed_types)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue