From 813c0757b4ce7289245f88704ed35342efd3531f Mon Sep 17 00:00:00 2001 From: lanyeeee Date: Sat, 24 Jan 2026 04:22:47 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=A7=A3=E5=86=B3=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/danmaku_xml_to_ass/ass_writer.rs | 2 +- src-tauri/src/extensions.rs | 14 +++++++------- src-tauri/src/lib.rs | 1 + src-tauri/src/types/user_info.rs | 4 ---- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src-tauri/src/danmaku_xml_to_ass/ass_writer.rs b/src-tauri/src/danmaku_xml_to_ass/ass_writer.rs index 520b8a0..ff4d168 100644 --- a/src-tauri/src/danmaku_xml_to_ass/ass_writer.rs +++ b/src-tauri/src/danmaku_xml_to_ass/ass_writer.rs @@ -171,7 +171,7 @@ impl AssWriter { } } -fn escape_text(text: &str) -> Cow { +fn escape_text(text: &str) -> Cow<'_, str> { let text = text.trim(); if memchr::memchr(b'\n', text.as_bytes()).is_some() { Cow::from(text.replace('\n', "\\N")) diff --git a/src-tauri/src/extensions.rs b/src-tauri/src/extensions.rs index bedde53..96e265f 100644 --- a/src-tauri/src/extensions.rs +++ b/src-tauri/src/extensions.rs @@ -31,19 +31,19 @@ impl AnyhowErrorToStringChain for anyhow::Error { } pub trait AppHandleExt { - fn get_config(&self) -> State>; - fn get_bili_client(&self) -> State; - fn get_download_manager(&self) -> State; + fn get_config(&self) -> State<'_, RwLock>; + fn get_bili_client(&self) -> State<'_, BiliClient>; + fn get_download_manager(&self) -> State<'_, DownloadManager>; } -impl AppHandleExt for tauri::AppHandle { - fn get_config(&self) -> State> { +impl AppHandleExt for AppHandle { + fn get_config(&self) -> State<'_, RwLock> { self.state::>() } - fn get_bili_client(&self) -> State { + fn get_bili_client(&self) -> State<'_, BiliClient> { self.state::() } - fn get_download_manager(&self) -> State { + fn get_download_manager(&self) -> State<'_, DownloadManager> { self.state::() } } diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 0472855..58bd3bb 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -10,6 +10,7 @@ mod logger; mod types; mod utils; mod wbi; +#[allow(dead_code)] mod protobuf { include!("./bilibili.community.service.dm.v1.rs"); } diff --git a/src-tauri/src/types/user_info.rs b/src-tauri/src/types/user_info.rs index 1d64496..8c331eb 100644 --- a/src-tauri/src/types/user_info.rs +++ b/src-tauri/src/types/user_info.rs @@ -136,10 +136,6 @@ pub struct LabelInUserInfo { pub img_label_uri_hant_static: String, } -#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)] -#[serde(default)] -pub struct IconResource {} - #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)] #[serde(default)] pub struct Wallet {