refactor(tray): change menu text storage to use Arc<str> for improved performance
refactor(service): utilize SmartString for error messages to enhance memory management
* feat(config): enhance configuration initialization and validation process
* refactor(profile): streamline profile update logic and enhance error handling
* refactor(config): simplify profile item checks and streamline update flag processing
* refactor(disney_plus): add cognitive complexity allowance for check_disney_plus function
* refactor(enhance): restructure configuration and profile item handling for improved clarity and maintainability
* refactor(tray): add cognitive complexity allowance for create_tray_menu function
* refactor(config): add cognitive complexity allowance for patch_config function
* refactor(profiles): simplify item removal logic by introducing take_item_file_by_uid helper function
* refactor(profile): add new validation logic for profile configuration syntax
* refactor(profiles): improve formatting and readability of take_item_file_by_uid function
* refactor(cargo): change cognitive complexity level from warn to deny
* refactor(cargo): ensure cognitive complexity is denied in Cargo.toml
* refactor(i18n): clean up imports and improve code readability
refactor(proxy): simplify system proxy toggle logic
refactor(service): remove unnecessary `as_str()` conversion in error handling
refactor(tray): modularize tray menu creation for better maintainability
* refactor(tray): update menu item text handling to use references for improved performance
In Rust, the `or` and `or_else` methods have distinct behavioral differences. The `or` method always eagerly evaluates its argument and executes any associated function calls. This can lead to unnecessary performance costs—especially in expensive operations like string processing or file handling—and may even trigger unintended side effects.
In contrast, `or_else` evaluates its closure lazily, only when necessary. Introducing a Clippy lint to disallow `or` sacrifices a bit of code simplicity but ensures predictable behavior and enforces lazy evaluation for better performance.
* perf: utilize smartstring for string handling
- Updated various modules to replace standard String with smartstring::alias::String for improved performance and memory efficiency.
- Adjusted string manipulations and conversions throughout the codebase to ensure compatibility with the new smartstring type.
- Enhanced readability and maintainability by using `.into()` for conversions where applicable.
- Ensured that all instances of string handling in configuration, logging, and network management leverage the benefits of smartstring.
* fix: replace wrap_err with stringify_err for better error handling in UWP tool invocation
* refactor: update import path for StringifyErr and adjust string handling in sysopt
* fix: correct import path for CmdResult in UWP module
* fix: update argument type for execute_sysproxy_command to use std::string::String
* fix: add missing CmdResult import in UWP platform module
* fix: improve string handling and error messaging across multiple files
* style: format code for improved readability and consistency across multiple files
* fix: remove unused file
- add retry path that restarts Mihomo on connection-related reload errors
- guard runtime config state by discarding on repeated failures and returning rich errors
* fix: specify type for mode and host variables to improve clarity and type safety
* fix: specify types for pac_url and host variables to enhance type safety
* fix: change type of pac_url from Url to String for consistency in handling PAC output
* fix(shutdown): mark shutdown as exiting to stop background tasks
- lib.rs:570 → Flag app as exiting on ExitRequested, notify proxy guard, start cleanup immediately, with fallback in Exit event
- tray/mod.rs:190 → Add unified exit checks around tray init/updates to prevent UI recreation during shutdown
- event_driven_proxy.rs:252 → Ensure proxy guard skips all restore/re-enable work (including sysproxy.exe calls) once exit flag is set
* fix(shutdown): refine exit handling and proxy guard notifications
* fix(shutdown): add guard to run shutdown routine only once per lifecycle
* feat: update service installation scripts and IPC integration
- Updated `Cargo.toml` to use version 2.0.8 of `clash_verge_service_ipc` with "client" feature.
- Renamed service installation and uninstallation scripts in `post-install.sh` and `pre-remove.sh`.
- Removed `service_ipc` module and refactored IPC handling in `service.rs` to use the new `clash_verge_service_ipc` directly.
- Adjusted service version checking and core management to align with the new IPC structure.
- Simplified directory checks in `dirs.rs` and updated logging configurations in `init.rs`.
- Updated Linux configuration file to reflect new script names.
- Enhanced service installer hook to manage state more effectively.
* refactor: simplify ClashConfig instantiation and remove unused service log file function
* feat: update clash_verge_service_ipc to version 2.0.9 and enhance service initialization logging
* chore: update clash_verge_service_ipc to version 2.0.10 and refactor async service manager initialization
* fix: update clash_verge_service_ipc to version 2.0.11 and improve service manager initialization
* fix: increase sleep duration for socket readiness check to improve stability
* fix: update clash_verge_service_ipc to version 2.0.12 and kode-bridge to version 0.3.4; refactor service management and IPC path checks
* fix: update clash_verge_service_ipc to version 2.0.13; refactor service connection and initialization logic
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
- Build Record inline so fmt::Arguments temporary only lives through writer.write, avoiding dropped-temporary borrow.
- Add explicit 'static annotation on leaked string before reboxing for clarity.
Introduced `write_sidecar_log` to prevent temporary `format_args!` values
from dropping early.
- src-tauri/src/core/core.rs:60 — adds `write_sidecar_log`, which temporarily
leaks the message into a `Box<str>`, builds the `Record`, writes it, then
immediately reclaims the boxed string. The `unsafe` block is limited to
`Box::from_raw` needed to undo `Box::leak`.
- src-tauri/src/core/core.rs:794, 802, 806 — all three sidecar events now route
through this helper, reusing the returned string for the in-memory log and
avoiding extra UTF-8 decoding.