Skip to content

Commit 39fa41f

Browse files
committed
fix(ci): satisfy strict clippy checks
1 parent 808a6b7 commit 39fa41f

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

crates/agentic-contract/benches/mcp_bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn mcp_json_parse(c: &mut Criterion) {
1212
fn mcp_tool_dispatch(c: &mut Criterion) {
1313
c.bench_function("mcp_tool_dispatch", |b| {
1414
b.iter(|| {
15-
let tools = vec!["tool1", "tool2", "tool3", "tool4", "tool5"];
15+
let tools = ["tool1", "tool2", "tool3", "tool4", "tool5"];
1616
black_box(tools.iter().find(|&&t| t == "tool3"));
1717
})
1818
});

crates/agentic-contract/src/cache/lru.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ impl<K: Eq + Hash + Clone, V: Clone> LruCache<K, V> {
6969
self.metrics.set_size(0);
7070
}
7171
pub fn contains(&self, key: &K) -> bool {
72-
self.store.get(key).map_or(false, |e| {
73-
Instant::now().duration_since(e.inserted_at) <= self.ttl
74-
})
72+
self.store
73+
.get(key)
74+
.is_some_and(|e| Instant::now().duration_since(e.inserted_at) <= self.ttl)
7575
}
7676
pub fn len(&self) -> usize {
7777
self.store.len()

crates/agentic-contract/src/query/intent.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ use serde::{Deserialize, Serialize};
44
///
55
/// Ordered from cheapest (fewest tokens) to most expensive.
66
/// Default is `IdsOnly` to be maximally token-conservative.
7-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
7+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
88
pub enum ExtractionIntent {
99
/// Only check if the item exists. Cheapest possible query.
1010
Exists,
1111
/// Return only identifiers. Default and very cheap.
12+
#[default]
1213
IdsOnly,
1314
/// Return a compact summary (key fields only).
1415
Summary,
@@ -42,12 +43,6 @@ impl ExtractionIntent {
4243
}
4344
}
4445

45-
impl Default for ExtractionIntent {
46-
fn default() -> Self {
47-
ExtractionIntent::IdsOnly
48-
}
49-
}
50-
5146
/// Trait for types that can have an extraction intent applied to scope their output.
5247
pub trait Scopeable {
5348
/// The scoped output type.

0 commit comments

Comments
 (0)