Skip to content

Commit 1582b9f

Browse files
Alan Shumclaude
andcommitted
fix: resolve clippy warnings in config and llm modules
Derive Default instead of manual impl for RawConfig and CliConfig, and use strip_prefix instead of manual slicing in LLM parser. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6c7ed4d commit 1582b9f

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

src/config.rs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub enum AiCli {
1818
}
1919

2020
/// Raw JSON-serializable config (matches the file format).
21-
#[derive(Debug, Deserialize)]
21+
#[derive(Debug, Default, Deserialize)]
2222
#[serde(default)]
2323
struct RawConfig {
2424
#[serde(rename = "preferred-ai-cli")]
@@ -27,27 +27,12 @@ struct RawConfig {
2727
copilot: CliConfig,
2828
}
2929

30-
#[derive(Debug, Deserialize)]
30+
#[derive(Debug, Default, Deserialize)]
3131
#[serde(default)]
3232
struct CliConfig {
3333
model: Option<String>,
3434
}
3535

36-
impl Default for RawConfig {
37-
fn default() -> Self {
38-
Self {
39-
preferred_ai_cli: None,
40-
claude: CliConfig::default(),
41-
copilot: CliConfig::default(),
42-
}
43-
}
44-
}
45-
46-
impl Default for CliConfig {
47-
fn default() -> Self {
48-
Self { model: None }
49-
}
50-
}
5136

5237
/// Model tier for intelligent cross-backend mapping.
5338
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]

src/grouper/llm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ pub async fn request_grouping(
6363
.lines()
6464
.filter_map(|line| {
6565
let line = line.trim();
66-
if line.starts_with("FILE: ") {
67-
let rest = &line[6..];
66+
if let Some(rest) = line.strip_prefix("FILE: ") {
6867
let end = rest.find(" (")?;
6968
Some(&rest[..end])
7069
} else {

0 commit comments

Comments
 (0)