Use better name for context

This commit is contained in:
meehl committed 2025-11-02 09:53:37 +01:00
1 parent 18b05338bf
commit 2739c45181
8 files changed
+92 -106

No files matched your search

+5 -5
View File
@@ -1,9 +1,9 @@
use crate::lua::ContextSocket;
use crate::lua::Context;
use mlua::{Lua, Result as LuaResult};
pub fn copy(l: &Lua, text: String) -> LuaResult<()> {
let socket = l.app_data_ref::<&'static ContextSocket>().unwrap();
socket
let ctx = l.app_data_ref::<&'static Context>().unwrap();
ctx
.clipboard()
.set_text(text)
.map_err(|e| anyhow::anyhow!("{}", e))?;
@@ -11,8 +11,8 @@ pub fn copy(l: &Lua, text: String) -> LuaResult<()> {
}
pub fn paste(l: &Lua, _: ()) -> LuaResult<String> {
let socket = l.app_data_ref::<&'static ContextSocket>().unwrap();
let text = socket
let ctx = l.app_data_ref::<&'static Context>().unwrap();
let text = ctx
.clipboard()
.get_text()
.map_err(|e| anyhow::anyhow!("{}", e))?;