* Remove unnecessary references

* Shorten expressions

* Remove unnecessary reference

* Simplify expression

* Fix formatting
This commit is contained in:
Chevdor authored and GitHub committed 2021-07-27 15:14:55 +02:00
1 parent a0b548b37d
commit cb023973e8
7 files changed
+25 -37

No files matched your search

+1 -4
View File
@@ -80,10 +80,7 @@ impl Stack {
/// Returns `Err` if the control stack is empty.
fn pop_frame(&mut self) -> Result<Frame, Error> {
trace!(target: "max_height", "pop_frame: {:?}", self.control_stack.last());
Ok(self
.control_stack
.pop()
.ok_or_else(|| Error("stack must be non-empty".into()))?)
self.control_stack.pop().ok_or_else(|| Error("stack must be non-empty".into()))
}
/// Truncate the height of value stack to the specified height.
+1 -1
View File
@@ -176,7 +176,7 @@ fn compute_stack_costs(module: &elements::Module) -> Result<Vec<u32>, Error> {
// We can't calculate stack_cost of the import functions.
Ok(0)
} else {
compute_stack_cost(func_idx as u32, &module)
compute_stack_cost(func_idx as u32, module)
}
})
.collect()