From eadb1565c3ef58e0c103d3e67f1232d2ef619a5c Mon Sep 17 00:00:00 2001 From: amtoaer Date: Tue, 31 Mar 2026 01:40:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E7=AB=AF=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/bili_sync/src/notifier/mod.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/crates/bili_sync/src/notifier/mod.rs b/crates/bili_sync/src/notifier/mod.rs index 5c50032..45b15ee 100644 --- a/crates/bili_sync/src/notifier/mod.rs +++ b/crates/bili_sync/src/notifier/mod.rs @@ -2,6 +2,7 @@ mod info; mod message; use std::collections::HashMap; + use anyhow::Result; use futures::future; pub use info::DownloadNotifyInfo; @@ -88,21 +89,18 @@ impl Notifier { }; let mut headers_map = header::HeaderMap::new(); headers_map.insert(header::CONTENT_TYPE, "application/json".try_into()?); - + if let Some(custom_headers) = headers { for (key, value) in custom_headers { - if let (Ok(key), Ok(value)) = (header::HeaderName::try_from(key), header::HeaderValue::try_from(value)) { + if let (Ok(key), Ok(value)) = + (header::HeaderName::try_from(key), header::HeaderValue::try_from(value)) + { headers_map.insert(key, value); } } } - - client - .post(url) - .headers(headers_map) - .body(payload) - .send() - .await?; + + client.post(url).headers(headers_map).body(payload).send().await?; } } Ok(())