Skip to content

Commit c9a6f31

Browse files
committed
fix(clippy): resolve all lint errors for Rust 1.94
1 parent 8e4aa9c commit c9a6f31

3 files changed

Lines changed: 6 additions & 22 deletions

File tree

core/src/task/idle.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl std::fmt::Display for IdlePhase {
6262
}
6363

6464
/// A single turn in the idle execution
65-
#[derive(Debug, Clone, Serialize, Deserialize)]
65+
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
6666
pub struct IdleTurn {
6767
/// Turn text (assistant message)
6868
pub text: String,
@@ -75,18 +75,6 @@ pub struct IdleTurn {
7575
pub output_tokens: u64,
7676
}
7777

78-
impl Default for IdleTurn {
79-
fn default() -> Self {
80-
Self {
81-
text: String::new(),
82-
tool_calls: Vec::new(),
83-
touched_files: Vec::new(),
84-
input_tokens: 0,
85-
output_tokens: 0,
86-
}
87-
}
88-
}
89-
9078
impl IdleTurn {
9179
/// Create a new idle turn
9280
pub fn new(text: impl Into<String>) -> Self {

core/src/task/types.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ impl TaskId {
1515
}
1616

1717
/// Create a TaskId from a UUID string
18+
#[allow(clippy::should_implement_trait)]
1819
pub fn from_str(s: &str) -> Option<Self> {
1920
Uuid::parse_str(s).ok().map(Self)
2021
}
@@ -94,10 +95,11 @@ pub enum TaskType {
9495
}
9596

9697
/// Task status
97-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
98+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)]
9899
#[serde(rename_all = "snake_case")]
99100
pub enum TaskStatus {
100101
/// Task is queued, not yet started
102+
#[default]
101103
Pending,
102104
/// Task is currently executing
103105
Running,
@@ -257,12 +259,6 @@ impl Task {
257259
}
258260
}
259261

260-
impl Default for TaskStatus {
261-
fn default() -> Self {
262-
TaskStatus::Pending
263-
}
264-
}
265-
266262
#[cfg(test)]
267263
mod tests {
268264
use super::*;

core/src/undercover.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! - There is NO force-OFF — safe default
1212
1313
use crate::prompts::UNDERCOVER_INSTRUCTIONS;
14-
use std::path::PathBuf;
14+
use std::path::{Path, PathBuf};
1515
use std::sync::RwLock;
1616

1717
/// Undercover mode status
@@ -112,7 +112,7 @@ impl UndercoverService {
112112
}
113113

114114
/// Get the remote URL for a repository
115-
fn get_remote_url(repo_path: &PathBuf) -> Option<String> {
115+
fn get_remote_url(repo_path: &Path) -> Option<String> {
116116
// Try to read .git/config
117117
let config_path = repo_path.join(".git").join("config");
118118
let config = std::fs::read_to_string(&config_path).ok()?;

0 commit comments

Comments
 (0)