1
0
mirror of https://gitlab.com/Anson-Projects/zine.git synced 2025-07-27 00:31:23 +00:00

Thanks Clippy

This commit is contained in:
2025-01-10 12:26:35 -07:00
parent 7b520be7b3
commit 4028cd0967
2 changed files with 103 additions and 82 deletions

View File

@@ -42,9 +42,7 @@ pub fn is_valid_image_url(url: &str) -> Result<bool, Box<dyn std::error::Error>>
let content_type = response.headers().get(reqwest::header::CONTENT_TYPE);
Ok(status.is_success()
&& content_type.map_or(false, |ct| {
ct.to_str().map_or(false, |s| s.starts_with("image/"))
}))
&& content_type.is_some_and(|ct| ct.to_str().is_ok_and(|s| s.starts_with("image/"))))
}
pub fn is_valid_url(url: &str) -> bool {