mirror of
https://github.com/lune-org/mlua-luau-scheduler.git
synced 2025-04-07 12:00:58 +01:00
Fix readme example
This commit is contained in:
parent
317936770b
commit
c14f84262f
1 changed files with 1 additions and 1 deletions
|
@ -52,7 +52,7 @@ lua.globals().set(
|
||||||
lua.create_async_function(|lua, path: String| async move {
|
lua.create_async_function(|lua, path: String| async move {
|
||||||
// Spawn background task that does not take up resources on the lua thread
|
// Spawn background task that does not take up resources on the lua thread
|
||||||
// Normally, futures in mlua can not be shared across threads, but this can
|
// Normally, futures in mlua can not be shared across threads, but this can
|
||||||
let task = lua.spawn_future(async move {
|
let task = lua.spawn(async move {
|
||||||
match read_to_string(path).await {
|
match read_to_string(path).await {
|
||||||
Ok(s) => Ok(Some(s)),
|
Ok(s) => Ok(Some(s)),
|
||||||
Err(e) if e.kind() == ErrorKind::NotFound => Ok(None),
|
Err(e) if e.kind() == ErrorKind::NotFound => Ok(None),
|
||||||
|
|
Loading…
Add table
Reference in a new issue