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