Skip to content

Commit 4b67cd4

Browse files
committed
fix: resolve clippy warnings in cortex-engine crate
- Replace deprecated into_path() with keep() in artifacts.rs tests - Replace manual contains check with DISALLOWED_TOOLS.contains() in batch.rs - Move Clone impl for FileTimeTracker before test module in file_time.rs
1 parent 1774acf commit 4b67cd4

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/cortex-engine/src/security/file_time.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ pub fn global_tracker() -> &'static FileTimeTracker {
170170
GLOBAL_TRACKER.get_or_init(FileTimeTracker::new)
171171
}
172172

173+
impl Clone for FileTimeTracker {
174+
fn clone(&self) -> Self {
175+
Self {
176+
records: Arc::clone(&self.records),
177+
locks: Arc::clone(&self.locks),
178+
}
179+
}
180+
}
181+
173182
#[cfg(test)]
174183
mod tests {
175184
use super::*;
@@ -252,12 +261,3 @@ mod tests {
252261
h2.await.unwrap();
253262
}
254263
}
255-
256-
impl Clone for FileTimeTracker {
257-
fn clone(&self) -> Self {
258-
Self {
259-
records: Arc::clone(&self.records),
260-
locks: Arc::clone(&self.locks),
261-
}
262-
}
263-
}

src/cortex-engine/src/tools/artifacts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ mod tests {
277277
#[test]
278278
fn test_no_truncation_below_threshold() {
279279
let config = ArtifactConfig {
280-
artifacts_dir: tempdir().unwrap().into_path(),
280+
artifacts_dir: tempdir().unwrap().keep(),
281281
truncate_threshold: 1000,
282282
truncate_lines: 10,
283283
enabled: true,
@@ -319,7 +319,7 @@ mod tests {
319319
#[test]
320320
fn test_disabled_config() {
321321
let config = ArtifactConfig {
322-
artifacts_dir: tempdir().unwrap().into_path(),
322+
artifacts_dir: tempdir().unwrap().keep(),
323323
truncate_threshold: 10,
324324
truncate_lines: 1,
325325
enabled: false,

src/cortex-engine/src/tools/handlers/batch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ mod tests {
491491
assert!(DISALLOWED_TOOLS.contains(&"Agent"));
492492
// Task is now allowed in batch for parallel task execution
493493
assert!(!DISALLOWED_TOOLS.contains(&"Task"));
494-
assert!(!DISALLOWED_TOOLS.iter().any(|&t| t == "Read"));
494+
assert!(!DISALLOWED_TOOLS.contains(&"Read"));
495495
}
496496

497497
#[tokio::test]

0 commit comments

Comments
 (0)