From cf0dee5c1803e4a2831089f7cbaea1c4be3c2963 Mon Sep 17 00:00:00 2001 From: Sergey Pepyakin Date: Mon, 1 Apr 2019 17:20:26 +0200 Subject: [PATCH] return_type isn't failable --- src/validation/func.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/validation/func.rs b/src/validation/func.rs index 8d7dd75..ddce429 100644 --- a/src/validation/func.rs +++ b/src/validation/func.rs @@ -358,7 +358,7 @@ impl FunctionReader { // an explicit return. // Check the return type. - if let BlockType::Value(value_type) = context.return_type()? { + if let BlockType::Value(value_type) = context.return_type() { tee_value( &mut context.value_stack, &context.frame_stack, @@ -413,7 +413,7 @@ impl FunctionReader { return Ok(Outcome::Unreachable); } Return => { - if let BlockType::Value(value_type) = context.return_type()? { + if let BlockType::Value(value_type) = context.return_type() { tee_value( &mut context.value_stack, &context.frame_stack, @@ -1582,8 +1582,8 @@ impl<'a> FunctionValidationContext<'a> { } } - fn return_type(&self) -> Result { - Ok(self.return_type) + fn return_type(&self) -> BlockType { + self.return_type } fn into_code(self) -> isa::Instructions {