refactor: fix unwrap panics, optimize string formatting, and update README#213
refactor: fix unwrap panics, optimize string formatting, and update README#213
Conversation
- Removed panicking `unwrap()` calls on Mutex locks in `server_manager/src/interface/web.rs` - Handled Option returns properly without unwrapping in `server_manager/src/core/users.rs` tests - Optimized string formatting in `server_manager/src/interface/cli.rs` and `server_manager/src/services/infra.rs` by replacing `push_str(&format!(...))` with `std::fmt::Write::write_fmt` - Updated `README.md` to document Gitea SSH port (2222) in the Services and Ports Matrix - Ran `cargo fmt` and `cargo clippy`
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR addresses safety improvements, code optimizations, and documentation updates across the codebase:
Safety Fixes:
.unwrap()on Mutex locks with.unwrap_or_else(|poisoned| poisoned.into_inner())inweb.rsto prevent panics in case of thread poisoning..unwrap()calls in theusers.rstest suite, properly checking results viais_ok()andif let Some().Optimizations:
push_str(&format!(...))patterns incli.rsandinfra.rsto usestd::fmt::Write::write_fmtdirectly on the mutable string, avoiding intermediate allocations.Documentation:
README.md(both English and French sections) to properly include Gitea's external SSH port 2222.All tests have been run and pass successfully. The codebase has been verified with
cargo fmtandcargo clippy.PR created automatically by Jules for task 15140561039869505128 started by @Cylae