refactor: cleaning and formatting

This commit is contained in:
PandaDEV 2024-12-16 23:39:37 +10:00
parent e674e0a0ec
commit 00749a9d3a
No known key found for this signature in database
GPG key ID: 13EFF9BAF70EE75C
12 changed files with 479 additions and 120 deletions

View file

@ -4,7 +4,9 @@ use image::ImageFormat;
use reqwest;
use url::Url;
pub async fn fetch_favicon_as_base64(url: Url) -> Result<Option<String>, Box<dyn std::error::Error>> {
pub async fn fetch_favicon_as_base64(
url: Url,
) -> Result<Option<String>, Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let favicon_url = format!("https://favicone.com/{}", url.host_str().unwrap());
let response = client.get(&favicon_url).send().await?;
@ -18,4 +20,4 @@ pub async fn fetch_favicon_as_base64(url: Url) -> Result<Option<String>, Box<dyn
} else {
Ok(None)
}
}
}