From cd0a20b3712d6235181a0fd1375d9d1175866de2 Mon Sep 17 00:00:00 2001 From: AsynchronousMatrix Date: Thu, 10 Aug 2023 14:55:56 +0100 Subject: [PATCH] chore: update returns for 'luau.*' methods --- src/lune/builtins/luau.rs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/lune/builtins/luau.rs b/src/lune/builtins/luau.rs index fb274f7..fdfa62a 100644 --- a/src/lune/builtins/luau.rs +++ b/src/lune/builtins/luau.rs @@ -41,10 +41,7 @@ fn compile_source<'lua>( .set_debug_level(debug_level) .compile(source); - match lua.create_string(source_bytecode_bytes) { - Ok(lua_string) => Ok(lua_string), - Err(exception) => Err(LuaError::RuntimeError(exception.to_string())), - } + lua.create_string(source_bytecode_bytes) } fn load_source<'a>( @@ -60,13 +57,7 @@ fn load_source<'a>( }; } - let lua_object = lua - .load(source.to_str()?.trim_start()) + lua.load(source.to_str()?.trim_start()) .set_name(lua_debug_name.unwrap_or("luau.load(...)".to_string())) - .into_function(); - - match lua_object { - Ok(lua_function) => Ok(lua_function), - Err(exception) => Err(LuaError::RuntimeError(exception.to_string())), - } + .into_function() }