chore: update returns for 'luau.*' methods

This commit is contained in:
AsynchronousMatrix 2023-08-10 14:55:56 +01:00
parent a36a996ac8
commit cd0a20b371

View file

@ -41,10 +41,7 @@ fn compile_source<'lua>(
.set_debug_level(debug_level) .set_debug_level(debug_level)
.compile(source); .compile(source);
match lua.create_string(source_bytecode_bytes) { lua.create_string(source_bytecode_bytes)
Ok(lua_string) => Ok(lua_string),
Err(exception) => Err(LuaError::RuntimeError(exception.to_string())),
}
} }
fn load_source<'a>( fn load_source<'a>(
@ -60,13 +57,7 @@ fn load_source<'a>(
}; };
} }
let lua_object = lua lua.load(source.to_str()?.trim_start())
.load(source.to_str()?.trim_start())
.set_name(lua_debug_name.unwrap_or("luau.load(...)".to_string())) .set_name(lua_debug_name.unwrap_or("luau.load(...)".to_string()))
.into_function(); .into_function()
match lua_object {
Ok(lua_function) => Ok(lua_function),
Err(exception) => Err(LuaError::RuntimeError(exception.to_string())),
}
} }