refactor(validators,main): 重构 Lua 配置解析与校验逻辑,提取 LuaValidator 模块; 抽离进程执行与 Win32 提权逻辑
- 重构 Lua 配置解析与校验逻辑 - 将控制台事件监听与 UAC 提权执行逻辑迁移至 win.rs 模块 - 简化 main 函数,提升代码可读性与模块化程度 - 清理废弃的注释代码
This commit is contained in:
7
src/utils.rs
Normal file
7
src/utils.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
use std::path::Path;
|
||||
|
||||
pub fn normalize_path_for_lua(path: &Path) -> String {
|
||||
// 自动将 Windows UNC 规范路径转回传统路径
|
||||
let simplified = dunce::simplified(path);
|
||||
simplified.to_string_lossy().replace('\\', "/")
|
||||
}
|
||||
Reference in New Issue
Block a user