Skip to content

Commit 98c706a

Browse files
committed
apply rustfmt
1 parent e6d8b83 commit 98c706a

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
use super::{Reset, ReusableAllocations};
22
use crate::{
33
core::FuelCostsProvider,
4-
engine::translator::{
5-
comparator::{
6-
CmpSelectFusion,
7-
CompareResult as _,
8-
TryIntoCmpSelectInstr as _,
9-
UpdateBranchOffset as _,
4+
engine::{
5+
translator::{
6+
comparator::{
7+
CmpSelectFusion,
8+
CompareResult as _,
9+
TryIntoCmpSelectInstr as _,
10+
UpdateBranchOffset as _,
11+
},
12+
func::{Stack, StackLayout, StackSpace},
13+
relink_result::RelinkResult,
14+
utils::{BumpFuelConsumption as _, OpPos},
1015
},
11-
func::{Stack, StackLayout, StackSpace},
12-
relink_result::RelinkResult,
13-
utils::{BumpFuelConsumption as _, OpPos},
16+
TranslationError,
1417
},
1518
ir::{BranchOffset, Op, Slot},
1619
Engine,
@@ -23,9 +26,9 @@ use alloc::vec::{self, Vec};
2326
#[derive(Debug, Default)]
2427
pub struct OpEncoder {
2528
/// The last pushed [`Op`].
26-
///
29+
///
2730
/// # Note
28-
///
31+
///
2932
/// - This allows the last [`Op`] to be peeked and manipulated.
3033
/// - For example, this is useful to perform op-code fusion or adjusting the result slot.
3134
last: Option<OpPos>,
@@ -41,9 +44,7 @@ impl ReusableAllocations for OpEncoder {
4144
type Allocations = OpEncoderAllocations;
4245

4346
fn into_allocations(self) -> Self::Allocations {
44-
Self::Allocations {
45-
instrs: self.ops,
46-
}
47+
Self::Allocations { instrs: self.ops }
4748
}
4849
}
4950

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ use self::{
3333
},
3434
utils::{Input, Reset, ReusableAllocations, UpdateResultSlot},
3535
};
36+
#[cfg(feature = "simd")]
37+
use crate::V128;
3638
use crate::{
3739
core::{FuelCostsProvider, IndexType, Typed, TypedVal, UntypedVal},
3840
engine::{
@@ -44,7 +46,7 @@ use crate::{
4446
TryIntoCmpBranchInstr as _,
4547
},
4648
labels::{LabelRef, LabelRegistry},
47-
utils::{OpPos, IntoShiftAmount, ToBits, WasmFloat, WasmInteger},
49+
utils::{IntoShiftAmount, OpPos, ToBits, WasmFloat, WasmInteger},
4850
WasmTranslator,
4951
},
5052
BlockType,
@@ -59,8 +61,6 @@ use crate::{
5961
TrapCode,
6062
ValType,
6163
};
62-
#[cfg(feature = "simd")]
63-
use crate::V128;
6464
use alloc::vec::Vec;
6565
use wasmparser::{MemArg, WasmFeatures};
6666

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
use crate::{engine::{translator::utils::OpPos, TranslationError}, ir::BranchOffset, Error};
1+
use crate::{
2+
engine::{translator::utils::OpPos, TranslationError},
3+
ir::BranchOffset,
4+
Error,
5+
};
26
use alloc::vec::Vec;
37
use core::{
48
fmt::{self, Display},
@@ -146,7 +150,7 @@ impl LabelRegistry {
146150
i32::try_from(offset).ok()
147151
}
148152
let Some(offset) = trace_offset32(src, dst) else {
149-
return Err(Error::from(TranslationError::BranchOffsetOutOfBounds))
153+
return Err(Error::from(TranslationError::BranchOffsetOutOfBounds));
150154
};
151155
Ok(BranchOffset::from(offset))
152156
}
@@ -164,9 +168,7 @@ impl LabelRegistry {
164168
user: OpPos,
165169
) -> Result<BranchOffset, Error> {
166170
let offset = match *self.get_label(label) {
167-
Label::Pinned(target) => {
168-
Self::trace_branch_offset(user, target)?
169-
}
171+
Label::Pinned(target) => Self::trace_branch_offset(user, target)?,
170172
Label::Unpinned => {
171173
self.users.push(LabelUser::new(label, user));
172174
BranchOffset::uninit()

0 commit comments

Comments
 (0)