diff options
author | Alex Orlenko <zxteam@protonmail.com> | 2022-05-15 01:15:31 +0100 |
---|---|---|
committer | Alex Orlenko <zxteam@protonmail.com> | 2022-05-15 01:15:31 +0100 |
commit | 2a8c5c7f82e1b8cc2f9c0ef572756e5c16ae90b1 (patch) | |
tree | 104b64b6815ad91753678bb0d725c6cf84678a79 /tests/async.rs | |
parent | 6b2ceb60c42f540a652b53861a8d6df1121a43d8 (diff) | |
download | mlua-2a8c5c7f82e1b8cc2f9c0ef572756e5c16ae90b1.zip |
Refactor `Function::bind` implementation.
Make it possible to bind async function arguments.
Fixes #161
Diffstat (limited to 'tests/async.rs')
-rw-r--r-- | tests/async.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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)?; |