* 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
* refactor: clash-verge-service management
* fix: correct service state checks in ProxyControlSwitches component
refactor: improve logging in service state update functions
* fix: add missing async handler for Windows and adjust logging import for macOS
* fix: streamline logging imports and add missing async handler for Windows
* refactor: remove unused useServiceStateSync hook and update imports in _layout
* refactor: remove unused useServiceStateSync import and clean up code in ProxyControlSwitches and _layout
* refactor: simplify service status checks and reduce wait time in useServiceInstaller hook
* refactor: remove unnecessary logging statements in service checks and IPC connection
* refactor: extract SwitchRow component for better code organization and readability
* refactor: enhance service state management and update related mutations in layout
* refactor: streamline core stopping logic and improve IPC connection logging
* refactor: consolidate service uninstallation logic and improve error handling
* fix: simplify conditional statements in CoreManager and service functions
* feat: add backoff dependency and implement retry strategy for IPC requests
* refactor: remove redundant Windows conditional and improve error handling in IPC tests
* test: improve error handling in IPC tests for message signing and verification
* fix: adjust IPC backoff retry parameters
* refactor: Remove service state tracking and related logic from service management
* feat: Enhance service status handling with logging and running mode updates
* fix: Improve service status handling with enhanced error logging
* fix: Ensure proper handling of service operations with error propagation
* refactor: Simplify service operation execution and enhance service status handling
* fix: Improve error message formatting in service operation execution and simplify service status retrieval
* refactor: Replace Cache with CacheProxy in multiple modules and update CacheEntry to be generic
* fix: Remove unnecessary success message from config validation
* refactor: Comment out logging statements in service version check and IPC request handling
* feat: update Cargo.toml for 2024 edition and optimize release profiles
* feat: refactor environment variable settings for Linux and improve code organization
* Refactor conditional statements to use `&&` for improved readability
- Updated multiple files to combine nested `if let` statements using `&&` for better clarity and conciseness.
- This change enhances the readability of the code by reducing indentation levels and making the conditions more straightforward.
- Affected files include: media_unlock_checker.rs, profile.rs, clash.rs, profiles.rs, async_proxy_query.rs, core.rs, handle.rs, hotkey.rs, service.rs, timer.rs, tray/mod.rs, merge.rs, seq.rs, config.rs, proxy.rs, window.rs, general.rs, dirs.rs, i18n.rs, init.rs, network.rs, and window.rs in the resolve module.
* refactor: streamline conditional checks using `&&` for improved readability
* fix: update release profile settings for panic behavior and optimization
* fix: adjust optimization level in Cargo.toml and reorder imports in lightweight.rs