This commit is contained in:
sxyazi 2025-03-20 18:56:56 +08:00
parent 8466adcff1
commit 9c075a825f
No known key found for this signature in database

View file

@ -1,8 +1,7 @@
use mlua::{ExternalResult, Function, Lua, Value}; use mlua::{ExternalResult, Function, Lua, Value};
use yazi_dds::body::Body; use yazi_dds::body::Body;
use yazi_shared::Id;
use crate::runtime::RtRef; use crate::{Id, runtime::RtRef};
pub struct Pubsub; pub struct Pubsub;
@ -15,8 +14,8 @@ impl Pubsub {
} }
pub(super) fn pub_to(lua: &Lua) -> mlua::Result<Function> { pub(super) fn pub_to(lua: &Lua) -> mlua::Result<Function> {
lua.create_function(|_, (receiver, kind, value): (u64, mlua::String, Value)| { lua.create_function(|_, (receiver, kind, value): (Id, mlua::String, Value)| {
yazi_dds::Pubsub::pub_to(Id(receiver), Body::from_lua(&kind.to_str()?, value)?); yazi_dds::Pubsub::pub_to(*receiver, Body::from_lua(&kind.to_str()?, value)?);
Ok(()) Ok(())
}) })
} }