fix: resolve clippy warnings (collapsible_if, manual_clamp)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -635,10 +635,10 @@ impl FileHandler {
|
||||
use crate::infrastructure::services::exif_service::ExifService;
|
||||
match tokio::fs::read(&file_path).await {
|
||||
Ok(data) => {
|
||||
if let Some(meta) = ExifService::extract(&data) {
|
||||
if let Err(e) = metadata_repo.upsert(&file_id, &meta).await {
|
||||
tracing::warn!("Failed to store EXIF for {}: {}", file_id, e);
|
||||
}
|
||||
if let Some(meta) = ExifService::extract(&data)
|
||||
&& let Err(e) = metadata_repo.upsert(&file_id, &meta).await
|
||||
{
|
||||
tracing::warn!("Failed to store EXIF for {}: {}", file_id, e);
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
|
||||
@@ -32,7 +32,7 @@ pub async fn list_photos(
|
||||
Query(params): Query<PhotosQueryParams>,
|
||||
) -> impl IntoResponse {
|
||||
let user_id = &auth_user.id;
|
||||
let limit = params.limit.unwrap_or(200).min(500).max(1);
|
||||
let limit = params.limit.unwrap_or(200).clamp(1, 500);
|
||||
|
||||
let file_read = &state.repositories.file_read_repository;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user