From 2a8c5c7f82e1b8cc2f9c0ef572756e5c16ae90b1 Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Sun, 15 May 2022 01:15:31 +0100 Subject: Refactor `Function::bind` implementation. Make it possible to bind async function arguments. Fixes #161 --- tests/async.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/async.rs') diff --git a/tests/async.rs b/tests/async.rs index 9200da6..fcfb9c7 100644 --- a/tests/async.rs +++ b/tests/async.rs @@ -75,7 +75,10 @@ async fn test_async_call() -> Result<()> { async fn test_async_bind_call() -> Result<()> { let lua = Lua::new(); - let sum = lua.create_async_function(|_lua, (a, b): (i64, i64)| async move { Ok(a + b) })?; + let sum = lua.create_async_function(|_lua, (a, b): (i64, i64)| async move { + tokio::task::yield_now().await; + Ok(a + b) + })?; let plus_10 = sum.bind(10)?; lua.globals().set("plus_10", plus_10)?; -- cgit v1.2.3