From d33dc4ff01df2a95dd1d672fb9ebb0e4af9cb001 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Wed, 13 Nov 2024 11:13:44 +0800 Subject: [PATCH] .. --- yazi-plugin/src/utils/call.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/yazi-plugin/src/utils/call.rs b/yazi-plugin/src/utils/call.rs index a01a737f..06e43d1e 100644 --- a/yazi-plugin/src/utils/call.rs +++ b/yazi-plugin/src/utils/call.rs @@ -20,20 +20,19 @@ impl Utils { pub(super) fn redraw_with(lua: &Lua) -> mlua::Result { lua.create_function(|lua, c: Table| { let id: mlua::String = c.get("_id")?; - let id = id.to_str()?; let mut layout = LAYOUT.get(); - match id.as_ref() { - "current" => layout.current = *c.raw_get::("_area")?, - "preview" => layout.preview = *c.raw_get::("_area")?, - "progress" => layout.progress = *c.raw_get::("_area")?, + match id.as_bytes().as_ref() { + b"current" => layout.current = *c.raw_get::("_area")?, + b"preview" => layout.preview = *c.raw_get::("_area")?, + b"progress" => layout.progress = *c.raw_get::("_area")?, _ => {} } LAYOUT.set(layout); match c.call_method::("redraw", ()) { Err(e) => { - error!("Failed to `redraw()` the `{id}` component:\n{e}"); + error!("Failed to `redraw()` the `{}` component:\n{e}", id.display()); lua.create_table() } ok => ok,