cleanup: auto-fix clippy warnings in poc-memory
Applied cargo clippy --fix for collapsible_if, manual_char_comparison, and other auto-fixable warnings.
This commit is contained in:
parent
3640de444b
commit
653da40dcd
21 changed files with 99 additions and 149 deletions
|
|
@ -17,8 +17,10 @@ static CONFIG: OnceLock<RwLock<Arc<Config>>> = OnceLock::new();
|
|||
|
||||
#[derive(Debug, Clone, PartialEq, serde::Deserialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[derive(Default)]
|
||||
pub enum ContextSource {
|
||||
#[serde(alias = "")]
|
||||
#[default]
|
||||
Store,
|
||||
File,
|
||||
Journal,
|
||||
|
|
@ -33,9 +35,6 @@ pub struct ContextGroup {
|
|||
pub source: ContextSource,
|
||||
}
|
||||
|
||||
impl Default for ContextSource {
|
||||
fn default() -> Self { Self::Store }
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Deserialize)]
|
||||
#[serde(default)]
|
||||
|
|
@ -133,8 +132,8 @@ impl Config {
|
|||
config.llm_concurrency = config.llm_concurrency.max(1);
|
||||
|
||||
// Resolve API settings: agent_model → models → backend
|
||||
if let Some(model_name) = &config.agent_model {
|
||||
if let Some(model_cfg) = root.get("models").and_then(|m| m.get(model_name.as_str())) {
|
||||
if let Some(model_name) = &config.agent_model
|
||||
&& let Some(model_cfg) = root.get("models").and_then(|m| m.get(model_name.as_str())) {
|
||||
let backend_name = model_cfg.get("backend").and_then(|v| v.as_str()).unwrap_or("");
|
||||
let model_id = model_cfg.get("model_id").and_then(|v| v.as_str()).unwrap_or("");
|
||||
|
||||
|
|
@ -146,7 +145,6 @@ impl Config {
|
|||
}
|
||||
config.api_model = Some(model_id.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
Some(config)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue