refactor: Switch to async closures
This commit is contained in:
@@ -99,7 +99,7 @@ impl AddAdditionalMethods for HueBridge {
|
||||
{
|
||||
methods.add_async_method(
|
||||
"set_flag",
|
||||
|lua, this, (flag, value): (mlua::Value, bool)| async move {
|
||||
async |lua, this, (flag, value): (mlua::Value, bool)| {
|
||||
let flag: Flag = lua.from_value(flag)?;
|
||||
|
||||
this.set_flag(flag, value).await;
|
||||
|
||||
@@ -170,7 +170,7 @@ impl AddAdditionalMethods for Ntfy {
|
||||
{
|
||||
methods.add_async_method(
|
||||
"send_notification",
|
||||
|lua, this, notification: mlua::Value| async move {
|
||||
async |lua, this, notification: mlua::Value| {
|
||||
let notification: Notification = lua.from_value(notification)?;
|
||||
|
||||
this.send(notification).await;
|
||||
|
||||
Reference in New Issue
Block a user