Clean up superfluous calls to debrace.
This commit is contained in:
parent
f6486498f6
commit
ba49876f80
@ -1,6 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
command_handler::debrace, echo_to_term_frame, id_intern::intern_id, GlobalLayoutCell,
|
echo_to_term_frame, id_intern::intern_id, GlobalLayoutCell, GlobalLayoutState, GlobalMemoCell,
|
||||||
GlobalLayoutState, GlobalMemoCell, TermFrame,
|
TermFrame,
|
||||||
};
|
};
|
||||||
use gc_arena::{Gc, Rootable};
|
use gc_arena::{Gc, Rootable};
|
||||||
use piccolo::{
|
use piccolo::{
|
||||||
@ -86,13 +86,12 @@ pub fn vsplit<'gc>(
|
|||||||
let global_memo = global_memo.clone();
|
let global_memo = global_memo.clone();
|
||||||
Callback::from_fn(&ctx, move |ctx, _ex, mut stack| {
|
Callback::from_fn(&ctx, move |ctx, _ex, mut stack| {
|
||||||
let path: String = stack.from_front(ctx)?;
|
let path: String = stack.from_front(ctx)?;
|
||||||
let path: &str = debrace(&path);
|
|
||||||
let frame: TermFrame = TermFrame(stack.from_front(ctx)?);
|
let frame: TermFrame = TermFrame(stack.from_front(ctx)?);
|
||||||
let new_splits = global_memo
|
let new_splits = global_memo
|
||||||
.layout
|
.layout
|
||||||
.borrow()
|
.borrow()
|
||||||
.term_splits
|
.term_splits
|
||||||
.vsplit(path, frame.clone())
|
.vsplit(&path, frame.clone())
|
||||||
.map_err(|e| e.into_value(ctx))?;
|
.map_err(|e| e.into_value(ctx))?;
|
||||||
let new_layout = Rc::new(GlobalLayoutState {
|
let new_layout = Rc::new(GlobalLayoutState {
|
||||||
term_splits: new_splits.clone(),
|
term_splits: new_splits.clone(),
|
||||||
@ -115,13 +114,12 @@ pub fn hsplit<'gc>(
|
|||||||
let global_memo = global_memo.clone();
|
let global_memo = global_memo.clone();
|
||||||
Callback::from_fn(&ctx, move |ctx, _ex, mut stack| {
|
Callback::from_fn(&ctx, move |ctx, _ex, mut stack| {
|
||||||
let path: String = stack.from_front(ctx)?;
|
let path: String = stack.from_front(ctx)?;
|
||||||
let path: &str = debrace(&path);
|
|
||||||
let frame: TermFrame = TermFrame(stack.from_front(ctx)?);
|
let frame: TermFrame = TermFrame(stack.from_front(ctx)?);
|
||||||
let new_splits = global_memo
|
let new_splits = global_memo
|
||||||
.layout
|
.layout
|
||||||
.borrow()
|
.borrow()
|
||||||
.term_splits
|
.term_splits
|
||||||
.hsplit(path, frame.clone())
|
.hsplit(&path, frame.clone())
|
||||||
.map_err(|e| e.into_value(ctx))?;
|
.map_err(|e| e.into_value(ctx))?;
|
||||||
let new_layout = Rc::new(GlobalLayoutState {
|
let new_layout = Rc::new(GlobalLayoutState {
|
||||||
term_splits: new_splits.clone(),
|
term_splits: new_splits.clone(),
|
||||||
@ -144,12 +142,11 @@ pub fn panel_merge<'gc>(
|
|||||||
let global_memo = global_memo.clone();
|
let global_memo = global_memo.clone();
|
||||||
Callback::from_fn(&ctx, move |ctx, _ex, mut stack| {
|
Callback::from_fn(&ctx, move |ctx, _ex, mut stack| {
|
||||||
let path: String = stack.from_front(ctx)?;
|
let path: String = stack.from_front(ctx)?;
|
||||||
let path: &str = debrace(&path);
|
|
||||||
let new_splits = global_memo
|
let new_splits = global_memo
|
||||||
.layout
|
.layout
|
||||||
.borrow()
|
.borrow()
|
||||||
.term_splits
|
.term_splits
|
||||||
.join(path)
|
.join(&path)
|
||||||
.map_err(|e| e.into_value(ctx))?;
|
.map_err(|e| e.into_value(ctx))?;
|
||||||
let new_layout = Rc::new(GlobalLayoutState {
|
let new_layout = Rc::new(GlobalLayoutState {
|
||||||
term_splits: new_splits.clone(),
|
term_splits: new_splits.clone(),
|
||||||
|
@ -9,7 +9,6 @@ use web_sys::console;
|
|||||||
use yew::UseStateSetter;
|
use yew::UseStateSetter;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
command_handler::debrace,
|
|
||||||
id_intern::{intern_id, unintern_id},
|
id_intern::{intern_id, unintern_id},
|
||||||
telnet::{parse_telnet_buf, TelnetOutput},
|
telnet::{parse_telnet_buf, TelnetOutput},
|
||||||
websocket::{connect_websocket, send_message_to_mud, WebSocketId},
|
websocket::{connect_websocket, send_message_to_mud, WebSocketId},
|
||||||
@ -141,7 +140,7 @@ pub(super) fn connect_mud<'gc>(
|
|||||||
}
|
}
|
||||||
break v;
|
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")?;
|
let muds: Table = ctx.get_global("muds")?;
|
||||||
if !muds.get_value(ctx, name).is_nil() {
|
if !muds.get_value(ctx, name).is_nil() {
|
||||||
@ -258,7 +257,7 @@ pub(super) fn delete_mud<'gc>(
|
|||||||
let global_memo = global_memo.clone();
|
let global_memo = global_memo.clone();
|
||||||
Callback::from_fn(&ctx, move |ctx, _ex, mut stack| {
|
Callback::from_fn(&ctx, move |ctx, _ex, mut stack| {
|
||||||
let name: String = stack.from_front(ctx)?;
|
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 muds: Table = ctx.get_global("muds")?;
|
||||||
let mud_value = muds.get_value(ctx, name);
|
let mud_value = muds.get_value(ctx, name);
|
||||||
|
Loading…
Reference in New Issue
Block a user