mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-06-29 01:45:54 +08:00
fix: 审查修复 — save_profile 保留原始 created、&str 参数、clippy 清理
- CRITICAL: save_profile 覆盖已有配置时保留原始创建时间 - HIGH: profiles.rs 函数参数 String → &str(减少不必要的克隆) - MEDIUM: 修复 18 个 clippy警告(空行 + map_or + collapsible-if) - CLI: 移除不必要的 name.clone() 调用 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -3,10 +3,10 @@ use path_editor_core::profiles;
|
||||
#[tauri::command]
|
||||
pub fn list_profiles() -> Result<Vec<profiles::ProfileMeta>, String> { profiles::list_profiles() }
|
||||
#[tauri::command]
|
||||
pub fn save_profile(name: String, sys: Vec<profiles::ProfilePathEntry>, user: Vec<profiles::ProfilePathEntry>) -> Result<(), String> { profiles::save_profile(name, sys, user) }
|
||||
pub fn save_profile(name: String, sys: Vec<profiles::ProfilePathEntry>, user: Vec<profiles::ProfilePathEntry>) -> Result<(), String> { profiles::save_profile(&name, sys, user) }
|
||||
#[tauri::command]
|
||||
pub fn load_profile(name: String) -> Result<profiles::ProfileData, String> { profiles::load_profile(name) }
|
||||
pub fn load_profile(name: String) -> Result<profiles::ProfileData, String> { profiles::load_profile(&name) }
|
||||
#[tauri::command]
|
||||
pub fn delete_profile(name: String) -> Result<(), String> { profiles::delete_profile(name) }
|
||||
pub fn delete_profile(name: String) -> Result<(), String> { profiles::delete_profile(&name) }
|
||||
#[tauri::command]
|
||||
pub fn rename_profile(old_name: String, new_name: String) -> Result<(), String> { profiles::rename_profile(old_name, new_name) }
|
||||
pub fn rename_profile(old_name: String, new_name: String) -> Result<(), String> { profiles::rename_profile(&old_name, &new_name) }
|
||||
|
||||
Reference in New Issue
Block a user