* 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
* feat: add signal handling for graceful shutdown on Windows and Unix
Co-authored-by: oomeow <oomeow@outlook.com>
* chore: update Cargo.lock
* fix(windows): restore shutdown hook build by enabling missing Win32 APIs and removing stray tracing call
Includes the required windows-sys feature expansions and replaces a leftover tracing reference so the Windows shutdown hook builds successfully.
* fix: add deprecation warnings for encrypt_data and decrypt_data functions
---------
Co-authored-by: oomeow <oomeow@outlook.com>
Co-authored-by: Slinetrac <realakayuki@gmail.com>
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
* feat: add Clippy alias commands and improve build process for Clippy integration
* fix(lint-clippy): update Clippy run command to use working directory for src-tauri
* 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