fix: refactor config

This commit is contained in:
2024-12-31 23:56:00 +08:00
parent abd399aacd
commit 393f704e52
56 changed files with 274 additions and 536 deletions

View File

@@ -1,18 +1,8 @@
use bytes::Bytes;
use reqwest::IntoUrl;
use super::{
bytes::{download_bytes, download_bytes_with_client},
HttpClient,
};
use super::{bytes::fetch_bytes, HttpClient};
pub async fn download_image<U: IntoUrl>(url: U) -> eyre::Result<Bytes> {
download_bytes(url).await
}
pub async fn download_image_with_client<T: IntoUrl>(
client: Option<&HttpClient>,
url: T,
) -> eyre::Result<Bytes> {
download_bytes_with_client(client, url).await
pub async fn fetch_image<T: IntoUrl>(client: Option<&HttpClient>, url: T) -> eyre::Result<Bytes> {
fetch_bytes(client, url).await
}