diff --git a/ext/src/ruby_api/caller.rs b/ext/src/ruby_api/caller.rs index 614c9cad..f1ee2440 100644 --- a/ext/src/ruby_api/caller.rs +++ b/ext/src/ruby_api/caller.rs @@ -100,11 +100,11 @@ impl<'a> Caller<'a> { Ok(()) } - pub fn context(&self) -> Result, Error> { + pub fn context(&self) -> Result, Error> { self.handle.get().map(|c| c.as_context()) } - pub fn context_mut(&self) -> Result, Error> { + pub fn context_mut(&self) -> Result, Error> { self.handle.get_mut().map(|c| c.as_context_mut()) } diff --git a/ext/src/ruby_api/instance.rs b/ext/src/ruby_api/instance.rs index 39748b58..0a8acf90 100644 --- a/ext/src/ruby_api/instance.rs +++ b/ext/src/ruby_api/instance.rs @@ -108,7 +108,7 @@ impl Instance { /// @def export(name) /// @param name [String] /// @return [Extern, nil] The export if it exists, nil otherwise. - pub fn export(&self, str: RString) -> Result, Error> { + pub fn export(&self, str: RString) -> Result>, Error> { let export = self .inner .get_export(self.store.context_mut(), unsafe { str.as_str()? }); diff --git a/ext/src/ruby_api/linker.rs b/ext/src/ruby_api/linker.rs index 69d63de6..6e1c3190 100644 --- a/ext/src/ruby_api/linker.rs +++ b/ext/src/ruby_api/linker.rs @@ -175,7 +175,7 @@ impl Linker { store: Obj, module: RString, name: RString, - ) -> Result, Error> { + ) -> Result>, Error> { let ext = self.inner .borrow() @@ -306,7 +306,7 @@ impl Linker { /// @param store [Store] /// @param mod [String] Module name /// @return [Func] - pub fn get_default(&self, store: Obj, module: RString) -> Result { + pub fn get_default(&self, store: Obj, module: RString) -> Result, Error> { self.inner .borrow() .get_default(store.context_mut(), unsafe { module.as_str() }?) diff --git a/ext/src/ruby_api/pooling_allocation_config.rs b/ext/src/ruby_api/pooling_allocation_config.rs index 38fa5e8a..a3a9ac03 100644 --- a/ext/src/ruby_api/pooling_allocation_config.rs +++ b/ext/src/ruby_api/pooling_allocation_config.rs @@ -239,7 +239,7 @@ impl PoolingAllocationConfig { )) } - fn borrow_mut(&self) -> Result, Error> { + fn borrow_mut(&self) -> Result, Error> { if let Ok(inner) = self.inner.try_borrow_mut() { Ok(inner) } else { diff --git a/ext/src/ruby_api/store.rs b/ext/src/ruby_api/store.rs index 37eb4490..1ad12c95 100644 --- a/ext/src/ruby_api/store.rs +++ b/ext/src/ruby_api/store.rs @@ -236,11 +236,11 @@ impl Store { .max_linear_memory_consumed() } - pub fn context(&self) -> StoreContext { + pub fn context(&self) -> StoreContext<'_, StoreData> { unsafe { (*self.inner.get()).as_context() } } - pub fn context_mut(&self) -> StoreContextMut { + pub fn context_mut(&self) -> StoreContextMut<'_, StoreData> { unsafe { (*self.inner.get()).as_context_mut() } } @@ -288,7 +288,7 @@ impl StoreContextValue<'_> { } } - pub fn context(&self) -> Result, Error> { + pub fn context(&self) -> Result, Error> { let ruby = Ruby::get().unwrap(); match self { Self::Store(store) => Ok(ruby.get_inner_ref(store).context()), @@ -296,7 +296,7 @@ impl StoreContextValue<'_> { } } - pub fn context_mut(&self) -> Result, Error> { + pub fn context_mut(&self) -> Result, Error> { let ruby = Ruby::get().unwrap(); match self { Self::Store(store) => Ok(ruby.get_inner_ref(store).context_mut()),