From 86c5e01b537f922a0346095a5e8a382cc1b8f5f8 Mon Sep 17 00:00:00 2001 From: Condorra Date: Sat, 9 Nov 2024 23:29:52 +1100 Subject: [PATCH] Clean up errors and fix build --- src/editor_view/editor_area.rs | 4 ++++ src/lineengine/line.rs | 2 -- src/lua_engine.rs | 8 ++++---- src/lua_engine/frames.rs | 4 ++-- src/lua_engine/muds.rs | 7 +++---- src/lua_engine/muds/telopt.rs | 8 ++++++-- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/editor_view/editor_area.rs b/src/editor_view/editor_area.rs index c1e2404..92648d9 100644 --- a/src/editor_view/editor_area.rs +++ b/src/editor_view/editor_area.rs @@ -13,17 +13,21 @@ use super::{load_file_contents, run_script, EditorViewDetailProps}; #[wasm_bindgen(getter_with_clone)] struct EditorViewConfig { + #[allow(unused)] pub doc: String, } #[wasm_bindgen(getter_with_clone)] struct EditorStateConfig { + #[allow(unused)] pub doc: String, + #[allow(unused)] pub extensions: Vec, } #[wasm_bindgen(getter_with_clone)] struct HighlightingConfig { + #[allow(unused)] pub fallback: bool, } diff --git a/src/lineengine/line.rs b/src/lineengine/line.rs index bbf55c9..1c4aa05 100644 --- a/src/lineengine/line.rs +++ b/src/lineengine/line.rs @@ -283,14 +283,12 @@ impl LineState { self.clear_and_render(term)?; } // Move to beginning - #[cfg(feature = "emacs")] KeyCode::Char('a') => { self.reset_cursor(term)?; self.move_cursor(-100000)?; self.set_cursor(term)?; } // Move to end - #[cfg(feature = "emacs")] KeyCode::Char('e') => { self.reset_cursor(term)?; self.move_cursor(100000)?; diff --git a/src/lua_engine.rs b/src/lua_engine.rs index 6e950c8..b680dab 100644 --- a/src/lua_engine.rs +++ b/src/lua_engine.rs @@ -125,7 +125,7 @@ impl LuaState { ); Ok(()) })?; - self.interp.execute(&self.exec)?; + self.interp.execute::<()>(&self.exec)?; Ok(()) } @@ -150,7 +150,7 @@ impl LuaState { ); Ok(()) })?; - self.interp.execute(&self.exec)?; + self.interp.execute::<()>(&self.exec)?; Ok(()) } } @@ -430,7 +430,7 @@ where { let call = seq.try_enter(|ctx, locals, _execution, mut stack| { let obj = locals.fetch(&obj); - stack.consume(ctx)?; + stack.consume::<()>(ctx)?; Ok(prep_metaop_call( ctx, stack, @@ -445,7 +445,7 @@ where let value = stack .pop_back() .ok_or_else(|| anyhow::Error::msg("Index didn't return value"))?; - stack.consume(ctx)?; + stack.consume::<()>(ctx)?; stack.push_back(locals.fetch(&obj).into_value(ctx)); for arg in arguments { stack.push_back(locals.fetch(arg)); diff --git a/src/lua_engine/frames.rs b/src/lua_engine/frames.rs index edc5ad5..181680e 100644 --- a/src/lua_engine/frames.rs +++ b/src/lua_engine/frames.rs @@ -394,7 +394,7 @@ pub(super) fn frame_input<'gc>(ctx: Context<'gc>, _global_memo: &GlobalMemoCell) let line: Value = stack .pop_front() .ok_or_else(|| anyhow::Error::msg("classes.frame:input missing line!"))?; - stack.consume(ctx)?; + stack.consume::<()>(ctx)?; let aliases: UserData = frame_tab.get(ctx, "aliases")?; let frame: Value = frame_tab.get(ctx, "frame")?; @@ -483,7 +483,7 @@ pub(super) fn frame_resize<'gc>(ctx: Context<'gc>, _global_memo: &GlobalMemoCell let height: Value = stack .pop_front() .ok_or_else(|| anyhow::Error::msg("classes.frame:resize missing height!"))?; - stack.consume(ctx)?; + stack.consume::<()>(ctx)?; frame_tab.set(ctx, "width", width)?; frame_tab.set(ctx, "height", height)?; diff --git a/src/lua_engine/muds.rs b/src/lua_engine/muds.rs index f5180e2..3e42c36 100644 --- a/src/lua_engine/muds.rs +++ b/src/lua_engine/muds.rs @@ -14,15 +14,14 @@ use crate::{ id_intern::{intern_id, unintern_id}, logging::{start_deleting_logs, start_downloading_logs, start_listing_logs}, match_table::{create_match_table, match_table_add, match_table_remove}, - telnet::{parse_telnet_buf, TelnetOutput, IAC}, + telnet::{parse_telnet_buf, TelnetOutput}, websocket::{connect_websocket, send_message_to_mud, WebSocketId}, FrameId, GlobalLayoutCell, GlobalMemoCell, }; use self::telopt::{ - get_option_state, handle_incoming_do, handle_incoming_dont, handle_incoming_will, - handle_incoming_wont, send_subnegotiation_if_allowed, set_option_supported, MudWithMemo, - OptionState, Side, Telopt, NAWS_TELOPT, + handle_incoming_do, handle_incoming_dont, handle_incoming_will, handle_incoming_wont, + send_subnegotiation_if_allowed, set_option_supported, MudWithMemo, Side, Telopt, NAWS_TELOPT, }; use super::{call_checking_metatable, list_match_tab, try_unwrap_frame, LuaState}; diff --git a/src/lua_engine/muds/telopt.rs b/src/lua_engine/muds/telopt.rs index 0fd54d4..93cd112 100644 --- a/src/lua_engine/muds/telopt.rs +++ b/src/lua_engine/muds/telopt.rs @@ -698,9 +698,13 @@ mod tests { buffer: &mut FakeMudBuffer, ) { match msg { - Some(TelnetOutput::Will(n)) => handle_incoming_will(ctx, buffer, &table, &Telopt(n)), + Some(TelnetOutput::Will(n)) => { + handle_incoming_will(ctx, buffer, &table, &Telopt(n)); + } Some(TelnetOutput::Wont(n)) => handle_incoming_wont(ctx, buffer, &table, &Telopt(n)), - Some(TelnetOutput::Do(n)) => handle_incoming_do(ctx, buffer, &table, &Telopt(n)), + Some(TelnetOutput::Do(n)) => { + handle_incoming_do(ctx, buffer, &table, &Telopt(n)); + } Some(TelnetOutput::Dont(n)) => handle_incoming_dont(ctx, buffer, &table, &Telopt(n)), _ => {} }