Hi everyone!
I've been learning Rust and recently built RustLens, an open-source desktop application using Rust and Tauri 2. I'd really appreciate a code review from more experienced Rust developers.
What does RustLens do?
RustLens is a Windows application designed to help with learning English, particularly while playing video games.
It allows users to:
Select a region of the screen and extract text using OCR (ocrs). Translate English text into Ukrainian using locally installed Ollama models. Store translations in an SQLite database. Bookmark useful phrases and export them to Anki for studying.
The backend is written in Rust, while the frontend uses React and TypeScript. OCR and translation run locally.
Project status and LLM usage
This project is currently just an MVP (Minimum Viable Product). My main goal was to build a working prototype, experiment with Rust, and explore how different technologies could work together.
I also want to be transparent that I used LLM assistance during development, including generating, modifying, and improving parts of the code.
Since I'm still learning Rust, I'm aware that some of the generated code might not follow best practices or idiomatic Rust patterns.
That's one of the main reasons I'm requesting this review. I don't just want the application to work — I want to understand how to write better, cleaner, and more maintainable Rust code.
What kind of feedback am I looking for?
I'm particularly interested in the quality of the Rust code rather than the UI.
Some areas I'd appreciate feedback on:
Architecture: Is the backend structured appropriately? Are responsibilities separated well? Idiomatic Rust: Am I using Rust's features and conventions correctly? Are there unnecessary clones or overly complicated abstractions? Error handling: Are errors handled properly? Could the approach be improved? Concurrency and cancellation: Are asynchronous operations, application state, and cancellation handled safely and efficiently? Performance and resource management: Are there potential bottlenecks or resource-management issues? Testing and maintainability: What would you improve to make the code easier to test and maintain? LLM-generated code: Are there any patterns that look unnecessarily complicated, unidiomatic, or potentially problematic?
The Rust code is located in src-tauri/src/.
If reviewing the entire project is too much, I'd especially appreciate feedback on pipeline.rs, capture.rs, and commands.rs.
The application currently targets Windows, so I understand that not everyone will be able to run it. Feedback based solely on the source code would still be very valuable.
I'm not expecting a full review of the entire codebase. Even a few specific observations or suggestions would help me improve.
I'm open to constructive criticism, including major architectural changes. If possible, I'd also appreciate explanations of why a particular approach would be better, since my primary goal is to learn and improve my Rust skills.
Thanks in advance for your time and feedback!
1 post - 1 participant