refactor(cleanup): remove dead code and optimize Option checks
- Remove 5 unused functions that were left over from migration refactoring: - get_archive_root, ensure_unique_path, archive_file (config.rs) - read_config_text_from_path, read_and_validate_config_from_path (codex_config.rs) - Simplify is_v1 check using is_some_and instead of map_or for better readability - Remove outdated comments about removed functions This eliminates all dead_code warnings and improves code maintainability.
This commit is contained in:
@@ -106,7 +106,7 @@ impl MultiAppConfig {
|
||||
// 满足:顶层同时包含 providers(object) + current(string),且不包含 version/apps/mcp 关键键,即视为 v1
|
||||
let value: serde_json::Value =
|
||||
serde_json::from_str(&content).map_err(|e| AppError::json(&config_path, e))?;
|
||||
let is_v1 = value.as_object().map_or(false, |map| {
|
||||
let is_v1 = value.as_object().is_some_and(|map| {
|
||||
let has_providers = map
|
||||
.get("providers")
|
||||
.map(|v| v.is_object())
|
||||
|
||||
Reference in New Issue
Block a user