chore: 解决一些编译警告

This commit is contained in:
lanyeeee
2026-01-24 04:22:47 +08:00
parent e2974ed0f6
commit 813c0757b4
4 changed files with 9 additions and 12 deletions
@@ -171,7 +171,7 @@ impl<W: Write> AssWriter<W> {
}
}
fn escape_text(text: &str) -> Cow<str> {
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"))
+7 -7
View File
@@ -31,19 +31,19 @@ impl AnyhowErrorToStringChain for anyhow::Error {
}
pub trait AppHandleExt {
fn get_config(&self) -> State<RwLock<Config>>;
fn get_bili_client(&self) -> State<BiliClient>;
fn get_download_manager(&self) -> State<DownloadManager>;
fn get_config(&self) -> State<'_, RwLock<Config>>;
fn get_bili_client(&self) -> State<'_, BiliClient>;
fn get_download_manager(&self) -> State<'_, DownloadManager>;
}
impl AppHandleExt for tauri::AppHandle {
fn get_config(&self) -> State<RwLock<Config>> {
impl AppHandleExt for AppHandle {
fn get_config(&self) -> State<'_, RwLock<Config>> {
self.state::<RwLock<Config>>()
}
fn get_bili_client(&self) -> State<BiliClient> {
fn get_bili_client(&self) -> State<'_, BiliClient> {
self.state::<BiliClient>()
}
fn get_download_manager(&self) -> State<DownloadManager> {
fn get_download_manager(&self) -> State<'_, DownloadManager> {
self.state::<DownloadManager>()
}
}
+1
View File
@@ -10,6 +10,7 @@ mod logger;
mod types;
mod utils;
mod wbi;
#[allow(dead_code)]
mod protobuf {
include!("./bilibili.community.service.dm.v1.rs");
}
-4
View File
@@ -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 {