From 5fcbd890e791be0261a06a91b7edd382331deba0 Mon Sep 17 00:00:00 2001 From: reoring Date: Tue, 10 Feb 2026 14:18:25 +0900 Subject: [PATCH] style: apply cargo fmt Co-Authored-By: Claude Opus 4.6 (1M context) --- src/allowlist.rs | 5 ++++- src/config.rs | 4 +++- src/proxy.rs | 5 ++++- src/secrets.rs | 3 ++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/allowlist.rs b/src/allowlist.rs index 2b2c04d..c944303 100644 --- a/src/allowlist.rs +++ b/src/allowlist.rs @@ -197,7 +197,10 @@ mod tests { allowed_ports: Some(vec![443, 8443]), }]; let al = Allowlist::new(&rules, Action::Deny); - assert!(matches!(al.check("api.openai.com:8443"), Decision::Allow(_))); + assert!(matches!( + al.check("api.openai.com:8443"), + Decision::Allow(_) + )); assert!(matches!(al.check("api.openai.com:9999"), Decision::Deny)); } diff --git a/src/config.rs b/src/config.rs index a8c1506..f148c37 100644 --- a/src/config.rs +++ b/src/config.rs @@ -108,7 +108,9 @@ impl Config { } pub fn secrets_dir(&self) -> &str { - self.secrets_dir.as_deref().unwrap_or("/var/run/secrets/botbox") + self.secrets_dir + .as_deref() + .unwrap_or("/var/run/secrets/botbox") } pub fn max_connections(&self) -> u32 { diff --git a/src/proxy.rs b/src/proxy.rs index 3c6c6b3..79afc1f 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -582,7 +582,10 @@ mod tests { #[test] fn test_host_header_value_ipv6_non_443_port() { assert_eq!(host_header_value("[::1]:8443"), "[::1]:8443"); - assert_eq!(host_header_value("[2001:db8::1]:8080"), "[2001:db8::1]:8080"); + assert_eq!( + host_header_value("[2001:db8::1]:8080"), + "[2001:db8::1]:8080" + ); } #[test] diff --git a/src/secrets.rs b/src/secrets.rs index e4c94f0..00573da 100644 --- a/src/secrets.rs +++ b/src/secrets.rs @@ -53,7 +53,8 @@ pub fn load_secrets_from_dir(dir: &Path) -> Result } // Canonicalize the base directory for prefix checking - let canonical_dir = dir.canonicalize() + let canonical_dir = dir + .canonicalize() .with_context(|| format!("canonicalizing secrets directory: {:?}", dir))?; let entries =