From 2d37efaab63d37e572dfdccaec6ff8b75b323717 Mon Sep 17 00:00:00 2001 From: jhqxxx <18280426169@163.com> Date: Fri, 6 Mar 2026 17:28:08 +0800 Subject: [PATCH] update fmt --- src/utils/img_utils.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/img_utils.rs b/src/utils/img_utils.rs index 438b1c2..0acb084 100644 --- a/src/utils/img_utils.rs +++ b/src/utils/img_utils.rs @@ -18,10 +18,12 @@ pub fn load_image_from_url(url: &str) -> Result { thread::spawn(move || { let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { - let response = reqwest::get(url).await + let response = reqwest::get(url) + .await .map_err(|e| anyhow!(format!("Failed to fetch image from url: {}", e)))?; let bytes = response - .bytes().await + .bytes() + .await .map_err(|e| anyhow!(format!("Failed to get image bytes: {}", e)))?; let cursor = Cursor::new(bytes);