mirror of
https://github.com/lune-org/lune.git
synced 2025-04-10 21:40:54 +01:00
fix: remove buffer returns, only accept buffers
This commit is contained in:
parent
8dbe5325ec
commit
39b8c89e8b
2 changed files with 6 additions and 6 deletions
|
@ -31,10 +31,10 @@ pub fn create(lua: &Lua) -> LuaResult<LuaTable> {
|
||||||
.build_readonly()
|
.build_readonly()
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn fs_read_file(lua: &Lua, path: String) -> LuaResult<LuaAnyUserData> {
|
async fn fs_read_file(lua: &Lua, path: String) -> LuaResult<LuaString> {
|
||||||
let bytes = fs::read(&path).await.into_lua_err()?;
|
let bytes = fs::read(&path).await.into_lua_err()?;
|
||||||
|
|
||||||
lua.create_buffer(bytes)
|
lua.create_string(bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn fs_read_dir(_: &Lua, path: String) -> LuaResult<Vec<String>> {
|
async fn fs_read_dir(_: &Lua, path: String) -> LuaResult<Vec<String>> {
|
||||||
|
|
|
@ -37,15 +37,15 @@ fn serde_decode<'lua>(
|
||||||
async fn serde_compress<'lua>(
|
async fn serde_compress<'lua>(
|
||||||
lua: &'lua Lua,
|
lua: &'lua Lua,
|
||||||
(format, str): (CompressDecompressFormat, BString),
|
(format, str): (CompressDecompressFormat, BString),
|
||||||
) -> LuaResult<LuaAnyUserData<'lua>> {
|
) -> LuaResult<LuaString<'lua>> {
|
||||||
let bytes = compress(format, str).await?;
|
let bytes = compress(format, str).await?;
|
||||||
lua.create_buffer(bytes)
|
lua.create_string(bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn serde_decompress<'lua>(
|
async fn serde_decompress<'lua>(
|
||||||
lua: &'lua Lua,
|
lua: &'lua Lua,
|
||||||
(format, str): (CompressDecompressFormat, BString),
|
(format, str): (CompressDecompressFormat, BString),
|
||||||
) -> LuaResult<LuaAnyUserData<'lua>> {
|
) -> LuaResult<LuaString<'lua>> {
|
||||||
let bytes = decompress(format, str).await?;
|
let bytes = decompress(format, str).await?;
|
||||||
lua.create_buffer(bytes)
|
lua.create_string(bytes)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue