mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-22 13:44:05 +02:00
refactor: cleaning and formatting
This commit is contained in:
parent
e674e0a0ec
commit
00749a9d3a
12 changed files with 479 additions and 120 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue