Skip to content

Commit 1f123ab

Browse files
author
beann
committed
fix: apply cargo fmt formatting fixes
1 parent e810ff0 commit 1f123ab

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
lines changed

crates/openfang-kernel/src/kernel.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -881,12 +881,12 @@ impl OpenFangKernel {
881881
// Auto-detect embedding provider by checking API key env vars in
882882
// priority order. First match wins.
883883
const API_KEY_PROVIDERS: &[(&str, &str)] = &[
884-
("OPENAI_API_KEY", "openai"),
885-
("GROQ_API_KEY", "groq"),
886-
("MISTRAL_API_KEY", "mistral"),
887-
("TOGETHER_API_KEY", "together"),
884+
("OPENAI_API_KEY", "openai"),
885+
("GROQ_API_KEY", "groq"),
886+
("MISTRAL_API_KEY", "mistral"),
887+
("TOGETHER_API_KEY", "together"),
888888
("FIREWORKS_API_KEY", "fireworks"),
889-
("COHERE_API_KEY", "cohere"),
889+
("COHERE_API_KEY", "cohere"),
890890
];
891891

892892
let detected_from_key = API_KEY_PROVIDERS
@@ -1127,8 +1127,7 @@ impl OpenFangKernel {
11271127
!= entry.manifest.tool_allowlist
11281128
|| disk_manifest.tool_blocklist
11291129
!= entry.manifest.tool_blocklist
1130-
|| disk_manifest.skills
1131-
!= entry.manifest.skills
1130+
|| disk_manifest.skills != entry.manifest.skills
11321131
|| disk_manifest.mcp_servers
11331132
!= entry.manifest.mcp_servers;
11341133
if changed {

crates/openfang-runtime/src/tool_runner.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,9 @@ pub async fn execute_tool(
238238
"list_searxng_categories" => {
239239
if let Some(ctx) = web_ctx {
240240
match ctx.search.list_searxng_categories().await {
241-
Ok(categories) => Ok(serde_json::to_string(&categories)
242-
.unwrap_or_else(|_| "[]".to_string())),
241+
Ok(categories) => {
242+
Ok(serde_json::to_string(&categories).unwrap_or_else(|_| "[]".to_string()))
243+
}
243244
Err(e) => Err(e),
244245
}
245246
} else {

crates/openfang-runtime/src/web_fetch.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,11 @@ mod tests {
506506
assert!(check_ssrf("http://169.254.169.254/latest/meta-data/", &allow).is_err());
507507
// Also verify hostname-based metadata blocks
508508
let allow2 = vec!["metadata.google.internal".to_string()];
509-
assert!(check_ssrf("http://metadata.google.internal/computeMetadata/v1/", &allow2).is_err());
509+
assert!(check_ssrf(
510+
"http://metadata.google.internal/computeMetadata/v1/",
511+
&allow2
512+
)
513+
.is_err());
510514
}
511515

512516
#[test]

crates/openfang-runtime/src/web_search.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,11 @@ impl WebSearchEngine {
339339

340340
let resp = self
341341
.client
342-
.get(format!("{}/search", self.config.searxng.url.trim_end_matches('/')))
343-
.query(&[
344-
("q", query),
345-
("format", "json"),
346-
])
342+
.get(format!(
343+
"{}/search",
344+
self.config.searxng.url.trim_end_matches('/')
345+
))
346+
.query(&[("q", query), ("format", "json")])
347347
.header("User-Agent", "Mozilla/5.0 (compatible; OpenFangAgent/0.1)")
348348
.send()
349349
.await
@@ -430,7 +430,10 @@ impl WebSearchEngine {
430430

431431
let resp = self
432432
.client
433-
.get(format!("{}/config", self.config.searxng.url.trim_end_matches('/')))
433+
.get(format!(
434+
"{}/config",
435+
self.config.searxng.url.trim_end_matches('/')
436+
))
434437
.header("User-Agent", "Mozilla/5.0 (compatible; OpenFangAgent/0.1)")
435438
.send()
436439
.await

0 commit comments

Comments
 (0)