From ba49876f8076a4a432732f5e589e557abc578346 Mon Sep 17 00:00:00 2001 From: Condorra Date: Fri, 20 Sep 2024 23:02:51 +1000 Subject: [PATCH] Clean up superfluous calls to debrace. --- src/lua_engine/frames.rs | 13 +++++-------- src/lua_engine/muds.rs | 5 ++--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/lua_engine/frames.rs b/src/lua_engine/frames.rs index 5d423b6..693e58d 100644 --- a/src/lua_engine/frames.rs +++ b/src/lua_engine/frames.rs @@ -1,6 +1,6 @@ use crate::{ - command_handler::debrace, echo_to_term_frame, id_intern::intern_id, GlobalLayoutCell, - GlobalLayoutState, GlobalMemoCell, TermFrame, + echo_to_term_frame, id_intern::intern_id, GlobalLayoutCell, GlobalLayoutState, GlobalMemoCell, + TermFrame, }; use gc_arena::{Gc, Rootable}; use piccolo::{ @@ -86,13 +86,12 @@ pub fn vsplit<'gc>( let global_memo = global_memo.clone(); Callback::from_fn(&ctx, move |ctx, _ex, mut stack| { let path: String = stack.from_front(ctx)?; - let path: &str = debrace(&path); let frame: TermFrame = TermFrame(stack.from_front(ctx)?); let new_splits = global_memo .layout .borrow() .term_splits - .vsplit(path, frame.clone()) + .vsplit(&path, frame.clone()) .map_err(|e| e.into_value(ctx))?; let new_layout = Rc::new(GlobalLayoutState { term_splits: new_splits.clone(), @@ -115,13 +114,12 @@ pub fn hsplit<'gc>( let global_memo = global_memo.clone(); Callback::from_fn(&ctx, move |ctx, _ex, mut stack| { let path: String = stack.from_front(ctx)?; - let path: &str = debrace(&path); let frame: TermFrame = TermFrame(stack.from_front(ctx)?); let new_splits = global_memo .layout .borrow() .term_splits - .hsplit(path, frame.clone()) + .hsplit(&path, frame.clone()) .map_err(|e| e.into_value(ctx))?; let new_layout = Rc::new(GlobalLayoutState { term_splits: new_splits.clone(), @@ -144,12 +142,11 @@ pub fn panel_merge<'gc>( let global_memo = global_memo.clone(); Callback::from_fn(&ctx, move |ctx, _ex, mut stack| { let path: String = stack.from_front(ctx)?; - let path: &str = debrace(&path); let new_splits = global_memo .layout .borrow() .term_splits - .join(path) + .join(&path) .map_err(|e| e.into_value(ctx))?; let new_layout = Rc::new(GlobalLayoutState { term_splits: new_splits.clone(), diff --git a/src/lua_engine/muds.rs b/src/lua_engine/muds.rs index 3c87405..2f3d0ae 100644 --- a/src/lua_engine/muds.rs +++ b/src/lua_engine/muds.rs @@ -9,7 +9,6 @@ use web_sys::console; use yew::UseStateSetter; use crate::{ - command_handler::debrace, id_intern::{intern_id, unintern_id}, telnet::{parse_telnet_buf, TelnetOutput}, websocket::{connect_websocket, send_message_to_mud, WebSocketId}, @@ -141,7 +140,7 @@ pub(super) fn connect_mud<'gc>( } break v; }; - let name: Value<'gc> = ctx.intern(debrace(&name).as_bytes()).into(); + let name: Value<'gc> = ctx.intern(&name.as_bytes()).into(); let muds: Table = ctx.get_global("muds")?; if !muds.get_value(ctx, name).is_nil() { @@ -258,7 +257,7 @@ pub(super) fn delete_mud<'gc>( let global_memo = global_memo.clone(); Callback::from_fn(&ctx, move |ctx, _ex, mut stack| { let name: String = stack.from_front(ctx)?; - let name: Value<'gc> = ctx.intern(debrace(&name).as_bytes()).into(); + let name: Value<'gc> = ctx.intern(name.as_bytes()).into(); let muds: Table = ctx.get_global("muds")?; let mud_value = muds.get_value(ctx, name);