fix(rust): reveal 命令插入时重复了 rename_path 的 tauri::command 属性(Windows 构建 E0428)
This commit is contained in:
@@ -426,7 +426,6 @@ pub fn create_dir(path: String) -> Result<(), String> {
|
|||||||
fs::create_dir_all(&path).map_err(|e| format!("创建文件夹失败:{e}"))
|
fs::create_dir_all(&path).map_err(|e| format!("创建文件夹失败:{e}"))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 重命名/移动文件或文件夹;目标已存在时报错。
|
|
||||||
/// 在 Windows 资源管理器中定位路径:打开父目录并选中该文件/文件夹。
|
/// 在 Windows 资源管理器中定位路径:打开父目录并选中该文件/文件夹。
|
||||||
/// explorer 即使成功也常以退出码 1 结束,因此只 spawn 不等结果。
|
/// explorer 即使成功也常以退出码 1 结束,因此只 spawn 不等结果。
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
@@ -441,7 +440,7 @@ pub fn reveal_in_explorer(path: String) -> Result<(), String> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
/// 重命名/移动文件或文件夹;目标已存在时报错。
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn rename_path(from: String, to: String) -> Result<(), String> {
|
pub fn rename_path(from: String, to: String) -> Result<(), String> {
|
||||||
if Path::new(&to).exists() {
|
if Path::new(&to).exists() {
|
||||||
|
|||||||
Reference in New Issue
Block a user