Enable unused_async clippy lint

This commit is contained in:
dasha_uwu
2026-01-10 09:08:48 +05:00
committed by Jason Volk
parent fd519ff7f1
commit d095a4fd3b
20 changed files with 60 additions and 64 deletions

View File

@@ -49,13 +49,13 @@ pub struct UrlPreviewData {
}
#[implement(Service)]
pub async fn remove_url_preview(&self, url: &str) -> Result {
pub fn remove_url_preview(&self, url: &str) -> Result {
// TODO: also remove the downloaded image
self.db.remove_url_preview(url)
}
#[implement(Service)]
pub async fn set_url_preview(&self, url: &str, data: &UrlPreviewData) -> Result {
pub fn set_url_preview(&self, url: &str, data: &UrlPreviewData) -> Result {
let now = SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
.expect("valid system time");
@@ -117,7 +117,7 @@ async fn request_url_preview(&self, url: &Url) -> Result<UrlPreviewData> {
| _ => return Err!(Request(Unknown("Unsupported Content-Type"))),
};
self.set_url_preview(url.as_str(), &data).await?;
self.set_url_preview(url.as_str(), &data)?;
Ok(data)
}
@@ -165,6 +165,7 @@ pub async fn download_image(&self, url: &str) -> Result<UrlPreviewData> {
#[cfg(not(feature = "url_preview"))]
#[implement(Service)]
#[allow(clippy::unused_async)]
pub async fn download_image(&self, _url: &str) -> Result<UrlPreviewData> {
Err!(FeatureDisabled("url_preview"))
}
@@ -214,6 +215,7 @@ async fn download_html(&self, url: &str) -> Result<UrlPreviewData> {
#[cfg(not(feature = "url_preview"))]
#[implement(Service)]
#[allow(clippy::unused_async)]
async fn download_html(&self, _url: &str) -> Result<UrlPreviewData> {
Err!(FeatureDisabled("url_preview"))
}