14 Commits

Author SHA1 Message Date
Tunglies
bd338cb5de
fix: memory leak when switching profiles 2026-01-28 02:31:30 +08:00
Tunglies
5e976c2fe1
chore: inline crate clash-verge-types to module for better maintenance (#6142) 2026-01-23 14:00:51 +00:00
Tunglies
c82cefe80e
feat: add clash-verge-types crate and integrate IRuntime struct 2025-11-22 15:33:24 +08:00
Tunglies
2d2167e048
refactor: replace unwrap_or with unwrap_or_else for improved error handling (#5163)
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.
2025-10-22 17:33:55 +08:00
Tunglies
a05ea64bcd
perf: utilize smartstring for string handling (#5149)
* 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
2025-10-22 16:25:44 +08:00
Junkai W.
909c4028f1
添加链式代理下规则适配 2025-09-22 18:16:17 +08:00
Junkai W.
f2073a2f83
Add Func 链式代理 (#4624)
* 添加链式代理gui和语言支持
在Iruntime中添跟新链式代理配置方法
同时添加了cmd

* 修复读取运行时代理链配置文件bug

* t

* 完成链式代理配置构造

* 修复获取链式代理运行时配置的bug

* 完整的链式代理功能
2025-09-15 07:44:54 +08:00
Tunglies
3939741a06
refactor: migrate from serde_yaml to serde_yaml_ng for improved YAML handling (#4568)
* refactor: migrate from serde_yaml to serde_yaml_ng for improved YAML handling

* refactor: format code for better readability in DNS configuration
2025-08-30 02:24:47 +08:00
huzibaca
cb3bff589f feat: add unified delay 2024-11-05 16:24:58 +08:00
huzibaca
cc81b443be refactor: IRuntime::patch_config() 2024-10-23 10:34:14 +08:00
MystiPanda
7551b45da2 feat: Support Tun Config (#416) 2024-02-20 23:27:03 +08:00
wonfen
01be65a624 chore: delete clash core, update CI, change profile name, change URL test link 2023-11-22 02:56:47 +08:00
GyDi
868b6f141c feat: save some fields in the runtime config, close #292 2022-11-24 17:52:25 +08:00
GyDi
bedd3abf8a refactor: done 2022-11-18 18:18:41 +08:00