Closed cppcoffee closed 5 months ago
I'm sorry. It's my problem, code as follow:
let chars = vec!['h', 'e', 'l', 'l', 'o'];
let table = lua.create_table()?;
for (i, &char) in chars.iter().enumerate() {
table.set(i + 1, char.to_string())?;
}
Ok(table)
I'm sorry. It's my problem, code as follow:
let chars = vec!['h', 'e', 'l', 'l', 'o']; let table = lua.create_table()?; for (i, &char) in chars.iter().enumerate() { table.set(i + 1, char.to_string())?; } Ok(table)
Another version:
let table = lua.create_sequence_from("hello".split_terminator("").skip(1))?;
Define
UserData
, accessfield
to return anVec<u8>
, calltable.concat
expecting "hello", which outputs "104101108108111".version and features:
example:
output:
expect lua output: