Skip to content

Commit 373d961

Browse files
hikejsclaude
andcommitted
style: cargo fmt
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 97d34f8 commit 373d961

7 files changed

Lines changed: 30 additions & 24 deletions

File tree

core/src/config.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -611,10 +611,7 @@ fn eval_func_call(func_call: &hcl::expr::FuncCall) -> JsonValue {
611611
let var_name = match arg {
612612
hcl::Expression::String(s) => s.as_str(),
613613
_ => {
614-
tracing::warn!(
615-
"env() expects a string argument, got: {:?}",
616-
arg
617-
);
614+
tracing::warn!("env() expects a string argument, got: {:?}", arg);
618615
return JsonValue::Null;
619616
}
620617
};
@@ -1790,8 +1787,14 @@ mod tests {
17901787
assert_eq!(env.get("SIMPLE").unwrap().as_str().unwrap(), "value");
17911788

17921789
// These mangled keys must NOT exist
1793-
assert!(env.get("apiKey").is_none(), "env var key should not be camelCase'd");
1794-
assert!(env.get("APIKEY").is_none(), "env var key should not have underscores stripped");
1790+
assert!(
1791+
env.get("apiKey").is_none(),
1792+
"env var key should not be camelCase'd"
1793+
);
1794+
assert!(
1795+
env.get("APIKEY").is_none(),
1796+
"env var key should not have underscores stripped"
1797+
);
17951798
assert!(env.get("anthropicApiKey").is_none());
17961799

17971800
std::env::remove_var("A3S_TEST_SECRET");
@@ -1821,7 +1824,10 @@ mod tests {
18211824

18221825
assert_eq!(env.get("MY_VAR").unwrap().as_str().unwrap(), "hello");
18231826
assert_eq!(env.get("OTHER_VAR").unwrap().as_str().unwrap(), "world");
1824-
assert!(env.get("myVar").is_none(), "block env keys should not be camelCase'd");
1827+
assert!(
1828+
env.get("myVar").is_none(),
1829+
"block env keys should not be camelCase'd"
1830+
);
18251831
}
18261832

18271833
#[test]

core/src/security/default.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@ impl DefaultSecurityProvider {
146146

147147
// Add custom patterns (user-provided — log and skip invalid regexes)
148148
for p in &config.custom_patterns {
149-
match SensitivePattern::try_new(p.name.clone(), p.regex.as_str(), p.redaction_label.clone()) {
149+
match SensitivePattern::try_new(
150+
p.name.clone(),
151+
p.regex.as_str(),
152+
p.redaction_label.clone(),
153+
) {
150154
Ok(pattern) => patterns.push(pattern),
151155
Err(e) => tracing::warn!(
152156
"Skipping invalid custom security pattern '{}': {}",

core/src/session/compaction.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ pub(crate) async fn compact_messages(
7070
KEEP_RECENT_MESSAGES
7171
);
7272
let mut result = messages[..KEEP_INITIAL_MESSAGES.min(total)].to_vec();
73-
let recent_start = total.saturating_sub(KEEP_RECENT_MESSAGES).max(KEEP_INITIAL_MESSAGES);
73+
let recent_start = total
74+
.saturating_sub(KEEP_RECENT_MESSAGES)
75+
.max(KEEP_INITIAL_MESSAGES);
7476
result.extend_from_slice(&messages[recent_start..]);
7577
return Ok(Some(result));
7678
}

core/src/subagent.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,8 @@ permissions:
670670
// Verify rules are functional
671671
assert!(agent.permissions.allow[0].matches("read", &serde_json::json!({})));
672672
assert!(agent.permissions.allow[1].matches("grep", &serde_json::json!({})));
673-
assert!(agent.permissions.allow[2].matches("Bash", &serde_json::json!({"command": "cargo build"})));
673+
assert!(agent.permissions.allow[2]
674+
.matches("Bash", &serde_json::json!({"command": "cargo build"})));
674675
assert!(agent.permissions.deny[0].matches("write", &serde_json::json!({})));
675676
}
676677

core/src/tools/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,7 @@ impl ToolExecutor {
170170
.parent()
171171
.and_then(|p| p.canonicalize().ok())
172172
.ok_or_else(|| {
173-
std::io::Error::new(
174-
std::io::ErrorKind::NotFound,
175-
"parent not found",
176-
)
173+
std::io::Error::new(std::io::ErrorKind::NotFound, "parent not found")
177174
})
178175
});
179176

core/src/tools/process.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,13 @@ pub(crate) async fn read_process_output(
1414
let stdout = match child.stdout.take() {
1515
Some(s) => s,
1616
None => {
17-
return (
18-
"Internal error: child stdout not piped".to_string(),
19-
false,
20-
);
17+
return ("Internal error: child stdout not piped".to_string(), false);
2118
}
2219
};
2320
let stderr = match child.stderr.take() {
2421
Some(s) => s,
2522
None => {
26-
return (
27-
"Internal error: child stderr not piped".to_string(),
28-
false,
29-
);
23+
return ("Internal error: child stderr not piped".to_string(), false);
3024
}
3125
};
3226

core/src/tools/task.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ impl TaskExecutor {
132132
// Register MCP tools so child agents can access MCP servers.
133133
if let Some(ref mcp) = self.mcp_manager {
134134
let all_tools = mcp.get_all_tools().await;
135-
let mut by_server: std::collections::HashMap<String, Vec<crate::mcp::protocol::McpTool>> =
136-
std::collections::HashMap::new();
135+
let mut by_server: std::collections::HashMap<
136+
String,
137+
Vec<crate::mcp::protocol::McpTool>,
138+
> = std::collections::HashMap::new();
137139
for (server, tool) in all_tools {
138140
by_server.entry(server).or_default().push(tool);
139141
}

0 commit comments

Comments
 (0)