Enable unused_async clippy lint
This commit is contained in:
@@ -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"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user