Skip to content

Fix issues identified by latest clippy update #489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/src/ruby_api/caller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ impl<'a> Caller<'a> {
Ok(())
}

pub fn context(&self) -> Result<StoreContext<StoreData>, Error> {
pub fn context(&self) -> Result<StoreContext<'_, StoreData>, Error> {
self.handle.get().map(|c| c.as_context())
}

pub fn context_mut(&self) -> Result<StoreContextMut<StoreData>, Error> {
pub fn context_mut(&self) -> Result<StoreContextMut<'_, StoreData>, Error> {
self.handle.get_mut().map(|c| c.as_context_mut())
}

Expand Down
2 changes: 1 addition & 1 deletion ext/src/ruby_api/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Option<super::externals::Extern>, Error> {
pub fn export(&self, str: RString) -> Result<Option<super::externals::Extern<'_>>, Error> {
let export = self
.inner
.get_export(self.store.context_mut(), unsafe { str.as_str()? });
Expand Down
4 changes: 2 additions & 2 deletions ext/src/ruby_api/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl Linker {
store: Obj<Store>,
module: RString,
name: RString,
) -> Result<Option<Extern>, Error> {
) -> Result<Option<Extern<'_>>, Error> {
let ext =
self.inner
.borrow()
Expand Down Expand Up @@ -306,7 +306,7 @@ impl Linker {
/// @param store [Store]
/// @param mod [String] Module name
/// @return [Func]
pub fn get_default(&self, store: Obj<Store>, module: RString) -> Result<Func, Error> {
pub fn get_default(&self, store: Obj<Store>, module: RString) -> Result<Func<'_>, Error> {
self.inner
.borrow()
.get_default(store.context_mut(), unsafe { module.as_str() }?)
Expand Down
2 changes: 1 addition & 1 deletion ext/src/ruby_api/pooling_allocation_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl PoolingAllocationConfig {
))
}

fn borrow_mut(&self) -> Result<std::cell::RefMut<PoolingAllocationConfigImpl>, Error> {
fn borrow_mut(&self) -> Result<std::cell::RefMut<'_, PoolingAllocationConfigImpl>, Error> {
if let Ok(inner) = self.inner.try_borrow_mut() {
Ok(inner)
} else {
Expand Down
8 changes: 4 additions & 4 deletions ext/src/ruby_api/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,11 @@ impl Store {
.max_linear_memory_consumed()
}

pub fn context(&self) -> StoreContext<StoreData> {
pub fn context(&self) -> StoreContext<'_, StoreData> {
unsafe { (*self.inner.get()).as_context() }
}

pub fn context_mut(&self) -> StoreContextMut<StoreData> {
pub fn context_mut(&self) -> StoreContextMut<'_, StoreData> {
unsafe { (*self.inner.get()).as_context_mut() }
}

Expand Down Expand Up @@ -288,15 +288,15 @@ impl StoreContextValue<'_> {
}
}

pub fn context(&self) -> Result<StoreContext<StoreData>, Error> {
pub fn context(&self) -> Result<StoreContext<'_, StoreData>, Error> {
let ruby = Ruby::get().unwrap();
match self {
Self::Store(store) => Ok(ruby.get_inner_ref(store).context()),
Self::Caller(caller) => ruby.get_inner_ref(caller).context(),
}
}

pub fn context_mut(&self) -> Result<StoreContextMut<StoreData>, Error> {
pub fn context_mut(&self) -> Result<StoreContextMut<'_, StoreData>, Error> {
let ruby = Ruby::get().unwrap();
match self {
Self::Store(store) => Ok(ruby.get_inner_ref(store).context_mut()),
Expand Down
Loading