Skip to content

Commit

Permalink
chore: rerun cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
esoterra committed Mar 6, 2024
1 parent 9432221 commit a708fed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
21 changes: 9 additions & 12 deletions crates/codegen/src/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,15 @@ impl<'gen> CodeGenerator<'gen> {
let locals_start = local_space.len();

// If the result spills, allocate it a local right after the flat params
let return_index = encoded_func
.results
.as_ref()
.and_then(|info| {
if info.spill.spill() {
let index = local_space.len();
local_space.push(enc::ValType::I32);
Some(index as u32)
} else {
None
}
});
let return_index = encoded_func.results.as_ref().and_then(|info| {
if info.spill.spill() {
let index = local_space.len();
local_space.push(enc::ValType::I32);
Some(index as u32)
} else {
None
}
});

let call_params_index = local_space.len() as u32;
local_space.push(enc::ValType::I32);
Expand Down
4 changes: 1 addition & 3 deletions crates/codegen/src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ impl<'gen> FunctionEncoder<'gen> {
(name, rtype)
})
.collect();
let results = function
.results
.map(ResolvedType::Defined);
let results = function.results.map(ResolvedType::Defined);

let func = EncodedFunction::new(params, results, self.resolved_comp);
Ok(func)
Expand Down
5 changes: 1 addition & 4 deletions crates/codegen/src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,7 @@ impl<'gen> ImportEncoder<'gen> {
})
}

fn encode_interface(
&mut self,
interface: &ResolvedInterface,
) -> Result<(), GenerationError> {
fn encode_interface(&mut self, interface: &ResolvedInterface) -> Result<(), GenerationError> {
ImportInterfaceEncoder::new(self, interface).encode()
}

Expand Down

0 comments on commit a708fed

Please sign in to comment.