resolve the last few relevant pedantic clippy lints

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-03-27 16:33:09 -04:00 committed by June
parent fa71dd4b4c
commit 48d1a3af3c
20 changed files with 464 additions and 560 deletions

View file

@ -788,13 +788,12 @@ async fn request_url_preview(url: &str) -> Result<UrlPreviewData> {
));
}
let content_type = match response
let Some(content_type) = response
.headers()
.get(reqwest::header::CONTENT_TYPE)
.and_then(|x| x.to_str().ok())
{
Some(ct) => ct,
None => return Err(Error::BadRequest(ErrorKind::Unknown, "Unknown Content-Type")),
else {
return Err(Error::BadRequest(ErrorKind::Unknown, "Unknown Content-Type"));
};
let data = match content_type {
html if html.starts_with("text/html") => download_html(client, url).await?,