Fix Rust borrow checker errors: event_type clone, Arc clone, leptess import

This commit is contained in:
Aether 2026-02-23 21:06:52 +00:00
parent 940b995951
commit f2ad2f3423
No known key found for this signature in database
GPG Key ID: 95AFEE837E39AFD2
3 changed files with 6 additions and 4 deletions

View File

@ -64,9 +64,11 @@ impl EventBus {
let mut subs = self.subscribers.lock().unwrap(); let mut subs = self.subscribers.lock().unwrap();
let handlers = subs.entry(event_type.clone()).or_insert_with(Vec::new); let handlers = subs.entry(event_type.clone()).or_insert_with(Vec::new);
let event_type_for_handler = event_type.clone();
// Create a handler that emits to frontend // Create a handler that emits to frontend
let handler = Box::new(move |data: Value| { let handler = Box::new(move |data: Value| {
debug!("Event {} dispatched to {}", event_type, handler_id); debug!("Event {} dispatched to {}", event_type_for_handler, handler_id);
// Frontend callback handled via Tauri events // Frontend callback handled via Tauri events
}) as EventHandler; }) as EventHandler;

View File

@ -89,8 +89,8 @@ fn main() {
// Store in app state // Store in app state
app.manage(event_bus); app.manage(event_bus);
app.manage(settings); app.manage(settings);
app.manage(plugin_manager); app.manage(plugin_manager.clone());
app.manage(hotkey_manager); app.manage(hotkey_manager.clone());
app.manage(plugin_api); app.manage(plugin_api);
// Setup main window // Setup main window

View File

@ -1,6 +1,6 @@
use image::{DynamicImage, GrayImage, ImageBuffer, Luma}; use image::{DynamicImage, GrayImage, ImageBuffer, Luma};
use imageproc::contrast::{stretch_contrast, threshold}; use imageproc::contrast::{stretch_contrast, threshold};
use leptess::tesseract::TessBaseApi; use leptess::TessBaseApi;
use std::collections::HashMap; use std::collections::HashMap;
use tracing::{debug, error, info}; use tracing::{debug, error, info};