Fix cargo clippy issues
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-08-28 08:15:50 +02:00
parent 6e53486832
commit 0540f515ec
6 changed files with 29 additions and 43 deletions

View File

@@ -36,16 +36,15 @@ async fn get_photo(id: &PhotoIdPath, full_size: bool, req: HttpRequest) -> HttpR
};
// Check if an upload is un-necessary
if let Some(c) = req.headers().get(header::IF_NONE_MATCH) {
if c.to_str().unwrap_or("") == hash {
if let Some(c) = req.headers().get(header::IF_NONE_MATCH)
&& c.to_str().unwrap_or("") == hash {
return Ok(HttpResponse::NotModified().finish());
}
}
if let Some(c) = req.headers().get(header::IF_MODIFIED_SINCE) {
let date_str = c.to_str().unwrap_or("");
if let Ok(date) = httpdate::parse_http_date(date_str) {
if date
if let Ok(date) = httpdate::parse_http_date(date_str)
&& date
.add(Duration::from_secs(1))
.duration_since(UNIX_EPOCH)
.unwrap()
@@ -54,7 +53,6 @@ async fn get_photo(id: &PhotoIdPath, full_size: bool, req: HttpRequest) -> HttpR
{
return Ok(HttpResponse::NotModified().finish());
}
}
}
let bytes = s3_connection::get_file(&match full_size {