Remove unnecessary mut from response_channels

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-10-16 07:56:57 -03:00
parent 1fdf76b530
commit 34b4612a93

View file

@ -91,7 +91,7 @@ pub fn talk_keyword(state: Arc<AppState>, user: UserSession, engine: &mut Engine
// by an async `tokio::sync::Mutex`, so we use `try_lock` to avoid awaiting // by an async `tokio::sync::Mutex`, so we use `try_lock` to avoid awaiting
// inside this nonasync closure. // inside this nonasync closure.
match state_clone.response_channels.try_lock() { match state_clone.response_channels.try_lock() {
Ok(mut response_channels) => { Ok(response_channels) => {
if let Some(tx) = response_channels.get(&user_id) { if let Some(tx) = response_channels.get(&user_id) {
// Use `try_send` to avoid blocking the runtime. // Use `try_send` to avoid blocking the runtime.
if let Err(e) = tx.try_send(response.clone()) { if let Err(e) = tx.try_send(response.clone()) {