- Removed unused `id` and `app_state` fields from `ChatPanel`; updated constructor to accept but ignore the state, reducing memory footprint. - Switched database access in `ChatPanel` from a raw `Mutex` lock to a connection pool (`app_state.conn.get()`), improving concurrency and error handling. - Reordered and cleaned up imports in `status_panel.rs` and formatted struct fields for readability. - Updated VS Code launch configuration to pass `--noui` argument, enabling headless mode for debugging. - Bumped several crate versions in `Cargo.lock` (e.g., `bitflags` to 2.10.0, `syn` to 2.0.108, `cookie` to 0.16.2) and added the new `ashpd` dependency, aligning the project with latest library releases.
15 lines
418 B
Rust
15 lines
418 B
Rust
use log::trace;
|
|
use rhai::Dynamic;
|
|
use rhai::Engine;
|
|
use crate::shared::state::AppState;
|
|
use crate::shared::models::UserSession;
|
|
pub fn print_keyword(_state: &AppState, _user: UserSession, engine: &mut Engine) {
|
|
engine
|
|
.register_custom_syntax(&["PRINT", "$expr$"], true, |context, inputs| {
|
|
let value = context.eval_expression_tree(&inputs[0])?;
|
|
trace!("PRINT: {}", value);
|
|
Ok(Dynamic::UNIT)
|
|
},
|
|
)
|
|
.unwrap();
|
|
}
|