-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Consider the following example:
use ezlua::prelude::*;
fn main() {
let lua = Lua::with_open_libs();
let st = std::rc::Rc::new(std::cell::RefCell::new(None));
let st2 = st.clone();
let f = lua
.new_closure(move |s: LuaString<'static>| {
st2.borrow_mut().replace(s);
})
.unwrap();
lua.global().set("f", f).unwrap();
lua.do_string("f('')", None).unwrap();
let s = st.borrow();
println!("{:?}", s.as_ref().map(|s| s.to_str()));
}ezlua v0.3.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels