From f257650c449f4225e73eea5d8044322b52d31095 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Fri, 16 Jan 2026 23:09:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E5=BA=93=E5=B9=B6=E7=BB=9F=E4=B8=80=E6=9C=AF=E8=AF=AD=E4=BD=BF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将库名称从 `tauri_demo_lib` 更改为 `tauri_shell_lib` 以确保名称唯一性并避免潜在冲突。 - 更新注释以统一使用“Sidecar”术语,明确标识进程启动与清理操作 - 将主函数中的库调用从 tauri_demo_lib 更改为 tauri_shell_lib。 --- Cargo.toml | 2 +- src/lib.rs | 4 ++-- src/main.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2bdbf67..7c97527 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ edition = "2021" # The `_lib` suffix may seem redundant but it is necessary # to make the lib name unique and wouldn't conflict with the bin name. # This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519 -name = "tauri_demo_lib" +name = "tauri_shell_lib" crate-type = ["staticlib", "cdylib", "rlib"] [build-dependencies] diff --git a/src/lib.rs b/src/lib.rs index f259618..a06fb8f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,7 @@ pub fn run() { // 注册全局状态 app.manage(SidecarProcess(std::sync::Mutex::new(None))); - // 启动 Sidecar Server 进程 + // 启动 Sidecar 进程 let app_handle = app.handle().clone(); sidecar::spawn_sidecar(app_handle); @@ -25,7 +25,7 @@ pub fn run() { .build(tauri::generate_context!()) .expect("error while building tauri application") .run(|app_handle, event| { - // 监听应用退出事件,清理 Sidecar Server 进程 + // 监听应用退出事件,清理 Sidecar 进程 match event { tauri::RunEvent::ExitRequested { .. } | tauri::RunEvent::Exit => { sidecar::cleanup_sidecar_process(app_handle); diff --git a/src/main.rs b/src/main.rs index 0e8a398..92d2dfa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,5 +2,5 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] fn main() { - tauri_demo_lib::run() + tauri_shell_lib::run() }