Skip to content

refactor: misc rust improvements#184

Merged
olivermrose merged 1 commit intomainfrom
refactor/rust
Mar 16, 2026
Merged

refactor: misc rust improvements#184
olivermrose merged 1 commit intomainfrom
refactor/rust

Conversation

@olivermrose
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings March 16, 2026 02:05
@olivermrose olivermrose added lang: rust perf Related to performance labels Mar 16, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors and small improvements across the Tauri Rust backend, focusing on safer error handling, reduced cloning, and minor performance/build optimizations.

Changes:

  • Replace several .clone() calls with Arc::clone and reduce unnecessary cloning/locking in async code paths.
  • Improve robustness by replacing panics/unreachable paths with proper error reporting/logging.
  • Adjust release build settings (LTO tuning, single codegen unit, stripping symbols) and apply small parsing/formatting optimizations.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src-tauri/src/seventv/mod.rs Use Arc::clone when storing/connecting the 7TV client.
src-tauri/src/server.rs Replace unwrap() I/O handling with logged errors and early returns.
src-tauri/src/log.rs Replace unreachable!() with a proper Serde unknown_variant error.
src-tauri/src/irc/message/tags.rs Pre-allocate tag map capacity based on estimated tag count.
src-tauri/src/irc/message/commands.rs Optimize emote substring extraction by pre-collecting chars (but see bug comment).
src-tauri/src/irc/connection/event_loop.rs Avoid cloning ServerMessage by reordering reconnect handling and send path.
src-tauri/src/eventsub/mod.rs Use Arc::clone when storing/connecting the EventSub client.
src-tauri/src/eventsub/client.rs Use Arc::clone for Arc<Self> method calls instead of self.clone().
src-tauri/src/commands.rs Fix/adjust byte formatting logic (but see grammar bug comment).
src-tauri/src/api.rs Reduce time spent holding the app state mutex; avoid unnecessary clones in EventSub/7TV join flow.
src-tauri/Cargo.toml Tighten release profile (codegen units, stripping).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +1111 to +1115
let code: String = chars
.get(start..end)
.unwrap_or_default()
.iter()
.collect();
@olivermrose olivermrose merged commit cee3691 into main Mar 16, 2026
6 checks passed
@olivermrose olivermrose deleted the refactor/rust branch March 16, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang: rust perf Related to performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants