Use better name for context
This commit is contained in:
1 parent
18b05338bf
commit
2739c45181
8 files changed
+92
-106
No files matched your search
@@ -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))?;
|
||||
|
||||
Reference in new issue
Block a user