From 268a1dee0988829348c238500b6ec98c1d417a5e Mon Sep 17 00:00:00 2001 From: Chummy Date: Thu, 19 Feb 2026 17:52:32 +0800 Subject: [PATCH] style: apply rustfmt after rebase --- src/channels/qq.rs | 4 +++- src/channels/whatsapp.rs | 4 +++- src/gateway/mod.rs | 11 ++++++----- src/tools/composio.rs | 4 +++- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/channels/qq.rs b/src/channels/qq.rs index 7373512..582c7f6 100644 --- a/src/channels/qq.rs +++ b/src/channels/qq.rs @@ -13,7 +13,9 @@ const QQ_AUTH_URL: &str = "https://bots.qq.com/app/getAppAccessToken"; fn ensure_https(url: &str) -> anyhow::Result<()> { if !url.starts_with("https://") { - anyhow::bail!("Refusing to transmit sensitive data over non-HTTPS URL: URL scheme must be https"); + anyhow::bail!( + "Refusing to transmit sensitive data over non-HTTPS URL: URL scheme must be https" + ); } Ok(()) } diff --git a/src/channels/whatsapp.rs b/src/channels/whatsapp.rs index b9bdd7d..20db157 100644 --- a/src/channels/whatsapp.rs +++ b/src/channels/whatsapp.rs @@ -10,7 +10,9 @@ use uuid::Uuid; /// happens in the gateway when Meta sends webhook events. fn ensure_https(url: &str) -> anyhow::Result<()> { if !url.starts_with("https://") { - anyhow::bail!("Refusing to transmit sensitive data over non-HTTPS URL: URL scheme must be https"); + anyhow::bail!( + "Refusing to transmit sensitive data over non-HTTPS URL: URL scheme must be https" + ); } Ok(()) } diff --git a/src/gateway/mod.rs b/src/gateway/mod.rs index 1c254d3..c3c4e31 100644 --- a/src/gateway/mod.rs +++ b/src/gateway/mod.rs @@ -1817,10 +1817,7 @@ mod tests { }; let mut headers = HeaderMap::new(); - headers.insert( - "X-Webhook-Secret", - HeaderValue::from_str(&secret).unwrap(), - ); + headers.insert("X-Webhook-Secret", HeaderValue::from_str(&secret).unwrap()); let response = handle_webhook( State(state), @@ -1992,7 +1989,11 @@ mod tests { // Correct prefix should pass let correct_prefix = format!("sha256={hex_sig}"); - assert!(verify_whatsapp_signature(&app_secret, body, &correct_prefix)); + assert!(verify_whatsapp_signature( + &app_secret, + body, + &correct_prefix + )); } #[test] diff --git a/src/tools/composio.rs b/src/tools/composio.rs index cf4b01e..ed846f7 100644 --- a/src/tools/composio.rs +++ b/src/tools/composio.rs @@ -21,7 +21,9 @@ const COMPOSIO_API_BASE_V3: &str = "https://backend.composio.dev/api/v3"; fn ensure_https(url: &str) -> anyhow::Result<()> { if !url.starts_with("https://") { - anyhow::bail!("Refusing to transmit sensitive data over non-HTTPS URL: URL scheme must be https"); + anyhow::bail!( + "Refusing to transmit sensitive data over non-HTTPS URL: URL scheme must be https" + ); } Ok(()) }