fix: resolve name collision in get_init_error command

The Tauri command `get_init_error` was importing a function with the
same name from `init_status` module, causing a compile-time error:
"the name `get_init_error` is defined multiple times".

Changes:
- Remove `get_init_error` from the use statement in misc.rs
- Use fully qualified path `crate::init_status::get_init_error()`
  in the command implementation to call the underlying function

This eliminates the ambiguity while keeping the public API unchanged.
This commit is contained in:
Jason
2025-11-03 22:51:01 +08:00
parent cc5d59ce56
commit 0f62829599

View File

@@ -2,7 +2,7 @@
use tauri::AppHandle;
use tauri_plugin_opener::OpenerExt;
use crate::init_status::{get_init_error, InitErrorPayload};
use crate::init_status::InitErrorPayload;
/// 打开外部链接
#[tauri::command]
@@ -49,5 +49,5 @@ pub async fn is_portable_mode() -> Result<bool, String> {
/// 用于前端在早期主动拉取,避免事件订阅竞态导致的提示缺失。
#[tauri::command]
pub async fn get_init_error() -> Result<Option<InitErrorPayload>, String> {
Ok(get_init_error())
Ok(crate::init_status::get_init_error())
}