Skip to content

Commit 6b1b135

Browse files
authored
Fix issues identified by latest clippy update (#489)
1 parent 81e09dd commit 6b1b135

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

ext/src/ruby_api/caller.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ impl<'a> Caller<'a> {
100100
Ok(())
101101
}
102102

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

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

ext/src/ruby_api/instance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl Instance {
108108
/// @def export(name)
109109
/// @param name [String]
110110
/// @return [Extern, nil] The export if it exists, nil otherwise.
111-
pub fn export(&self, str: RString) -> Result<Option<super::externals::Extern>, Error> {
111+
pub fn export(&self, str: RString) -> Result<Option<super::externals::Extern<'_>>, Error> {
112112
let export = self
113113
.inner
114114
.get_export(self.store.context_mut(), unsafe { str.as_str()? });

ext/src/ruby_api/linker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl Linker {
175175
store: Obj<Store>,
176176
module: RString,
177177
name: RString,
178-
) -> Result<Option<Extern>, Error> {
178+
) -> Result<Option<Extern<'_>>, Error> {
179179
let ext =
180180
self.inner
181181
.borrow()
@@ -306,7 +306,7 @@ impl Linker {
306306
/// @param store [Store]
307307
/// @param mod [String] Module name
308308
/// @return [Func]
309-
pub fn get_default(&self, store: Obj<Store>, module: RString) -> Result<Func, Error> {
309+
pub fn get_default(&self, store: Obj<Store>, module: RString) -> Result<Func<'_>, Error> {
310310
self.inner
311311
.borrow()
312312
.get_default(store.context_mut(), unsafe { module.as_str() }?)

ext/src/ruby_api/pooling_allocation_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ impl PoolingAllocationConfig {
239239
))
240240
}
241241

242-
fn borrow_mut(&self) -> Result<std::cell::RefMut<PoolingAllocationConfigImpl>, Error> {
242+
fn borrow_mut(&self) -> Result<std::cell::RefMut<'_, PoolingAllocationConfigImpl>, Error> {
243243
if let Ok(inner) = self.inner.try_borrow_mut() {
244244
Ok(inner)
245245
} else {

ext/src/ruby_api/store.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ impl Store {
236236
.max_linear_memory_consumed()
237237
}
238238

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

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

@@ -288,15 +288,15 @@ impl StoreContextValue<'_> {
288288
}
289289
}
290290

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

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

0 commit comments

Comments
 (0)