refactor: improve code quality and fix linting issues
- Derive Default trait instead of manual implementation for McpRoot and ProviderManager - Remove redundant closures in codex_config.rs and config.rs - Simplify match statements to if let patterns in migration.rs and lib.rs - Remove unnecessary type conversions and borrows in lib.rs - Fix i18n key inconsistency: sequentialThinking → sequential-thinking - Format TypeScript files to match Prettier style All clippy warnings resolved, code passes all quality checks.
This commit is contained in:
@@ -10,7 +10,7 @@ pub struct McpConfig {
|
||||
}
|
||||
|
||||
/// MCP 根:按客户端分开维护(无历史兼容压力,直接以 v2 结构落地)
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
pub struct McpRoot {
|
||||
#[serde(default)]
|
||||
pub claude: McpConfig,
|
||||
@@ -18,15 +18,6 @@ pub struct McpRoot {
|
||||
pub codex: McpConfig,
|
||||
}
|
||||
|
||||
impl Default for McpRoot {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
claude: McpConfig::default(),
|
||||
codex: McpConfig::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
use crate::config::{copy_file, get_app_config_dir, get_app_config_path, write_json_file};
|
||||
use crate::provider::ProviderManager;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user