chore(tauri): remove dead code warnings and drop unused uuid dep

- Delete unused Provider::new, ProviderManager::get_current_provider
- Delete unused AppState::reload
- Remove uuid crate and related imports
- Keep functionality unchanged; frontend uses ID string for current provider
This commit is contained in:
Jason
2025-08-25 21:41:35 +08:00
parent dac8ebe03b
commit 78bc0a1a31
5 changed files with 3 additions and 66 deletions

View File

@@ -2,7 +2,6 @@ use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;
use std::path::Path;
use uuid::Uuid;
use crate::config::{
copy_file, delete_file, get_provider_config_path, read_json_file, write_json_file,
@@ -22,16 +21,6 @@ pub struct Provider {
}
impl Provider {
/// 创建新的供应商
pub fn new(name: String, settings_config: Value, website_url: Option<String>) -> Self {
Self {
id: Uuid::new_v4().to_string(),
name,
settings_config,
website_url,
}
}
/// 从现有ID创建供应商
pub fn with_id(id: String, name: String, settings_config: Value, website_url: Option<String>) -> Self {
Self {
@@ -170,15 +159,6 @@ impl ProviderManager {
Ok(())
}
/// 获取当前供应商
pub fn get_current_provider(&self) -> Option<&Provider> {
if self.current.is_empty() {
None
} else {
self.providers.get(&self.current)
}
}
/// 获取所有供应商
pub fn get_all_providers(&self) -> &HashMap<String, Provider> {
&self.providers