Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dhil committed Aug 16, 2024
1 parent 8492c40 commit 878eedb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 1 addition & 3 deletions crates/wasm-encoder/src/core/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ impl Encode for CompositeType {
CompositeInnerType::Struct(ty) => {
TypeSection::encode_struct(sink, ty.fields.iter().cloned())
}
CompositeInnerType::Cont(ty) => {
TypeSection::encode_continuation(sink, ty.0)
}
CompositeInnerType::Cont(ty) => TypeSection::encode_continuation(sink, ty.0),
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions crates/wasm-encoder/src/reencode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ pub trait Reencode {
utils::resume_table(self, table)
}


fn block_type(
&mut self,
arg: wasmparser::BlockType,
Expand Down Expand Up @@ -1496,7 +1495,10 @@ pub mod utils {
_reencoder: &mut T,
resumetable: wasmparser::ResumeTable<'_>,
) -> Result<crate::ResumeTable, Error<T::Error>> {
let targets = resumetable.targets().map(|i| i.unwrap()).collect::<Vec<(u32,u32)>>();
let targets = resumetable
.targets()
.map(|i| i.unwrap())
.collect::<Vec<(u32, u32)>>();
Ok(crate::ResumeTable { targets })
}

Expand Down
13 changes: 11 additions & 2 deletions crates/wasm-mutate/src/mutators/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,17 @@ pub trait Translator {
})
}

fn translate_resume_table(&mut self, table: &wasmparser::ResumeTable<'_>) -> Result<ResumeTable> {
Ok(ResumeTable { targets: table.targets().map(|i| i.unwrap()).collect::<Vec<(u32, u32)>>().into() })
fn translate_resume_table(
&mut self,
table: &wasmparser::ResumeTable<'_>,
) -> Result<ResumeTable> {
Ok(ResumeTable {
targets: table
.targets()
.map(|i| i.unwrap())
.collect::<Vec<(u32, u32)>>()
.into(),
})
}

fn remap(&mut self, item: Item, idx: u32) -> Result<u32> {
Expand Down

0 comments on commit 878eedb

Please sign in to comment.