Skip to content

Commit e857668

Browse files
committed
fix(ci): satisfy strict clippy checks and guardrails
1 parent 4ff3839 commit e857668

6 files changed

Lines changed: 8 additions & 13 deletions

File tree

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
let target = "tool3";
1717
black_box(tools.iter().find(|&&t| t == target));
1818
})

src/bridges/traits.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/// Bridge traits for inter-sister communication.
22
/// All methods have NoOp defaults for standalone operation.
3-
43
pub trait MemoryBridge {
54
fn store_context(&self, _key: &str, _value: &str) -> Result<(), String> {
65
Ok(())

src/cache/lru.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ impl<K: Eq + Hash + Clone, V: Clone> LruCache<K, V> {
7575
}
7676

7777
pub fn contains(&self, key: &K) -> bool {
78-
self.store.get(key).map_or(false, |e| {
79-
Instant::now().duration_since(e.inserted_at) <= self.ttl
80-
})
78+
self.store
79+
.get(key)
80+
.is_some_and(|e| Instant::now().duration_since(e.inserted_at) <= self.ttl)
8181
}
8282

8383
pub fn len(&self) -> usize {

src/mcp/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::workspace::{ContextRole, TranslationMap, TranslationStatus, Workspace
2020
use super::protocol::{JsonRpcError, JsonRpcRequest, JsonRpcResponse};
2121

2222
/// Inject token conservation parameters into every tool's inputSchema.
23-
fn inject_token_conservation_params(tools: &mut Vec<Value>) {
23+
fn inject_token_conservation_params(tools: &mut [Value]) {
2424
let conservation_props = json!({
2525
"include_content": { "type": "boolean", "default": false, "description": "Return full content (default: IDs only)" },
2626
"intent": { "type": "string", "enum": ["exists", "ids", "summary", "fields", "full"], "description": "Extraction intent level" },

src/metrics/audit.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pub struct AuditEntry {
3131

3232
impl AuditEntry {
3333
/// Create a new audit entry with the current timestamp.
34+
#[allow(clippy::too_many_arguments)]
3435
pub fn new(
3536
tool: impl Into<String>,
3637
layer: Layer,

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)