Skip to content

Commit 2510004

Browse files
authored
Apply some new clippy suggestions (#1549)
apply some clippy suggestions
1 parent 6424150 commit 2510004

File tree

15 files changed

+30
-30
lines changed

15 files changed

+30
-30
lines changed

crates/collections/src/arena/dedup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ impl<Idx, T> DedupArena<Idx, T> {
6464

6565
/// Returns an iterator over the shared reference of the [`Arena`] entities.
6666
#[inline]
67-
pub fn iter(&self) -> Iter<Idx, T> {
67+
pub fn iter(&self) -> Iter<'_, Idx, T> {
6868
self.entities.iter()
6969
}
7070

7171
/// Returns an iterator over the exclusive reference of the [`Arena`] entities.
7272
#[inline]
73-
pub fn iter_mut(&mut self) -> IterMut<Idx, T> {
73+
pub fn iter_mut(&mut self) -> IterMut<'_, Idx, T> {
7474
self.entities.iter_mut()
7575
}
7676
}

crates/collections/src/arena/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl<Idx, T> Arena<Idx, T> {
8686

8787
/// Returns an iterator over the shared reference of the arena entities.
8888
#[inline]
89-
pub fn iter(&self) -> Iter<Idx, T> {
89+
pub fn iter(&self) -> Iter<'_, Idx, T> {
9090
Iter {
9191
iter: self.entities.iter().enumerate(),
9292
marker: PhantomData,
@@ -95,7 +95,7 @@ impl<Idx, T> Arena<Idx, T> {
9595

9696
/// Returns an iterator over the exclusive reference of the arena entities.
9797
#[inline]
98-
pub fn iter_mut(&mut self) -> IterMut<Idx, T> {
98+
pub fn iter_mut(&mut self) -> IterMut<'_, Idx, T> {
9999
IterMut {
100100
iter: self.entities.iter_mut().enumerate(),
101101
marker: PhantomData,

crates/core/src/table/element.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl ElementSegment {
3030
}
3131

3232
/// Returns `self` as [`ElementSegmentRef`].
33-
pub fn as_ref(&self) -> ElementSegmentRef {
33+
pub fn as_ref(&self) -> ElementSegmentRef<'_> {
3434
ElementSegmentRef::from(self)
3535
}
3636

crates/wasmi/src/engine/code_map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ impl CodeMap {
310310

311311
/// Returns the [`CompiledFuncRef`] of `func` if possible, otherwise returns `None`.
312312
#[inline]
313-
fn get_compiled(&self, func: EngineFunc) -> Option<CompiledFuncRef> {
313+
fn get_compiled(&self, func: EngineFunc) -> Option<CompiledFuncRef<'_>> {
314314
let funcs = self.funcs.lock();
315315
let Some(entity) = funcs.get(func) else {
316316
// Safety: this is just called internally with function indices
@@ -396,7 +396,7 @@ impl CodeMap {
396396
/// - If `ctx` ran out of fuel in case fuel consumption is enabled.
397397
#[cold]
398398
#[inline(never)]
399-
fn wait_for_compilation(&self, func: EngineFunc) -> Result<CompiledFuncRef, Error> {
399+
fn wait_for_compilation(&self, func: EngineFunc) -> Result<CompiledFuncRef<'_>, Error> {
400400
'wait: loop {
401401
let funcs = self.funcs.lock();
402402
let Some(entity) = funcs.get(func) else {
@@ -470,7 +470,7 @@ impl FuncEntity {
470470
///
471471
/// Returns `None` if the [`FuncEntity`] has not yet been compiled.
472472
#[inline]
473-
pub fn get_compiled(&self) -> Option<CompiledFuncRef> {
473+
pub fn get_compiled(&self) -> Option<CompiledFuncRef<'_>> {
474474
match self {
475475
FuncEntity::Compiled(func) => Some(func.into()),
476476
_ => None,
@@ -509,7 +509,7 @@ impl FuncEntity {
509509
///
510510
/// If `func` has already been initialized.
511511
#[inline]
512-
pub fn set_compiled(&mut self, entity: CompiledFuncEntity) -> CompiledFuncRef {
512+
pub fn set_compiled(&mut self, entity: CompiledFuncEntity) -> CompiledFuncRef<'_> {
513513
assert!(matches!(self, Self::Compiling));
514514
*self = Self::Compiled(entity);
515515
let Self::Compiled(entity) = self else {

crates/wasmi/src/engine/translator/func/control_stack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl ControlStack {
9898
/// Pops the top-most [`Provider`] slice of an `else` branch of an [`IfControlFrame`] to the [`ControlStack`].
9999
///
100100
/// [`IfControlFrame`]: super::control_frame::IfControlFrame
101-
pub fn pop_else_providers(&mut self) -> Drain<Provider<TypedVal>> {
101+
pub fn pop_else_providers(&mut self) -> Drain<'_, Provider<TypedVal>> {
102102
self.else_providers
103103
.pop()
104104
.expect("missing else providers for `else` branch")
@@ -133,7 +133,7 @@ impl ControlStack {
133133
}
134134

135135
/// Acquires the target [`ControlFrame`] at the given relative `depth`.
136-
pub fn acquire_target(&mut self, depth: u32) -> AcquiredTarget {
136+
pub fn acquire_target(&mut self, depth: u32) -> AcquiredTarget<'_> {
137137
let is_root = self.is_root(depth);
138138
let frame = self.nth_back_mut(depth);
139139
if is_root {

crates/wasmi/src/engine/translator/func/instr_encoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl InstrSequence {
139139
/// # Note
140140
///
141141
/// The [`InstrSequence`] will be in an empty state after this operation.
142-
pub fn drain(&mut self) -> Drain<Instruction> {
142+
pub fn drain(&mut self) -> Drain<'_, Instruction> {
143143
self.instrs.drain(..)
144144
}
145145

@@ -191,7 +191,7 @@ impl InstrEncoder {
191191
/// # Note
192192
///
193193
/// The [`InstrEncoder`] will be in an empty state after this operation.
194-
pub fn drain_instrs(&mut self) -> Drain<Instruction> {
194+
pub fn drain_instrs(&mut self) -> Drain<'_, Instruction> {
195195
self.instrs.drain()
196196
}
197197

crates/wasmi/src/engine/translator/func/provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl<T> ProviderSliceStack<T> {
123123
}
124124

125125
/// Pops the top-most [`Reg`] slice from the [`ProviderSliceStack`] and returns it.
126-
pub fn pop(&mut self) -> Option<Drain<Provider<T>>> {
126+
pub fn pop(&mut self) -> Option<Drain<'_, Provider<T>>> {
127127
let end = self.ends.pop()?;
128128
let start = self.ends.last().copied().unwrap_or(0);
129129
Some(self.providers.drain(start..end))

crates/wasmi/src/engine/translator/func/stack/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl FuncLocalConsts {
9797
/// # Note
9898
///
9999
/// The function local constant values are yielded in their allocation order.
100-
pub fn iter(&self) -> FuncLocalConstsIter {
100+
pub fn iter(&self) -> FuncLocalConstsIter<'_> {
101101
FuncLocalConstsIter::new(self)
102102
}
103103
}

crates/wasmi/src/engine/translator/func/stack/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl ValueStack {
184184
/// and accessed via negative [`Reg`] index where the 0 index is referring
185185
/// to the first function local and the -1 index is referring to the first
186186
/// allocated function local constant value.
187-
pub fn func_local_consts(&self) -> FuncLocalConstsIter {
187+
pub fn func_local_consts(&self) -> FuncLocalConstsIter<'_> {
188188
self.consts.iter()
189189
}
190190

crates/wasmi/src/engine/translator/labels.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ impl LabelRegistry {
174174
/// # Panics
175175
///
176176
/// If used before all used branching labels have been pinned.
177-
pub fn resolved_users(&self) -> ResolvedUserIter {
177+
pub fn resolved_users(&self) -> ResolvedUserIter<'_> {
178178
ResolvedUserIter {
179179
users: self.users.iter(),
180180
registry: self,

0 commit comments

Comments
 (0)